Open
Description
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
Labels
No labels