mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 12:26:30 +00:00
make cython app exit correctly
This commit is contained in:
@@ -137,7 +137,7 @@ cdef class Inference:
|
||||
self._previous_annotation = None
|
||||
|
||||
v_input = cv2.VideoCapture(<str>video_name)
|
||||
while v_input.isOpened():
|
||||
while v_input.isOpened() and not self.stop_signal:
|
||||
ret, frame = v_input.read()
|
||||
if not ret or frame is None:
|
||||
break
|
||||
@@ -186,11 +186,9 @@ cdef class Inference:
|
||||
print(annotation.to_str(self.class_names))
|
||||
self.on_annotation(cmd, annotation)
|
||||
|
||||
|
||||
cdef stop(self):
|
||||
self.stop_signal = True
|
||||
|
||||
|
||||
cdef bint is_valid_annotation(self, Annotation annotation):
|
||||
# No detections, invalid
|
||||
if not annotation.detections:
|
||||
|
||||
Reference in New Issue
Block a user