Skip to content

error with “scannerpy.common.ScannerException: Attempted to re-register op MTCNNDetectFaces:26b1de2b94414c76b520eb59bd0ef338”  #291

Open
@ABNER-1

Description

@ABNER-1

I get a error "scannerpy.common.ScannerException: Attempted to re-register op MTCNNDetectFaces:26b1de2b94414c76b520eb59bd0ef338" when I run a simple demo with face_detect code.
It can be simplified with these code:

def detect_face_from_video(video_path):
    sc = sp.Client()
    video = sp.NamedVideoStream(sc, 'example', path=video_path)
    frames = sc.io.Input([video])
    # detect faces
    faces = sc.ops.MTCNNDetectFaces(frame=frames)
    # convert into vector
    feature = sc.ops.EmbedFaces(frame = frames, bboxes = faces)

    output_feature = sp.NamedStream(sc, "example_feature")
    extrace_feature_op = sc.io.Output(feature, [output_feature])
    sc.run(extrace_feature_op, sp.PerfParams.estimate(), cache_mode=sp.CacheMode.Overwrite)

    bytes = output_feature.load()
    bounds = save_vector_to_file(bytes)
    return bounds

bounds = detect_face_from_video(src_video)
bounds = detect_face_from_video(src_video)

Can not I use an op twice in a python script?
I find it registers the ops into client and already write into the _python_ops, but why it register too when second invoke the getattr function?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions