Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ABNER-1 opened this issue Jan 17, 2020 · 0 comments

Comments

@ABNER-1
Copy link

ABNER-1 commented Jan 17, 2020

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant