Enable async mode
Change-Id: Iabb6667850a181333a1c2bd7eeb95ddd592da42c
diff --git a/person_detection/person_detection.py b/person_detection/person_detection.py
index e321be8..3d1fe80 100644
--- a/person_detection/person_detection.py
+++ b/person_detection/person_detection.py
@@ -104,8 +104,8 @@
# Async doesn't work if True
# Request issues = Runtime Error: [REQUEST BUSY]
- self.is_async_mode = False
- #is_async_mode = True
+ # self.is_async_mode = False
+ self.is_async_mode = True
render_time = 0
ret, frame = self.cap.read()
@@ -118,8 +118,8 @@
ret, frame = self.cap.read()
if not ret:
break
- initial_w = self.cap.get(3)
- initial_h = self.cap.get(4)
+ initial_w = self.cap.get(cv2.CAP_PROP_FRAME_WIDTH)
+ initial_h = self.cap.get(cv2.CAP_PROP_FRAME_HEIGHT)
# Main sync point:
# in the truly Async mode we start the NEXT infer request, while waiting for the CURRENT to complete
@@ -152,7 +152,7 @@
ymax = int(obj[6] * initial_h)
class_id = int(obj[1])
# Draw box and label\class_id
- color = (min(class_id * 12.5, 255),min(class_id * 7, 255), min(class_id * 5, 255))
+ color = (0, 0, 255)
cv2.rectangle(frame, (xmin, ymin), (xmax, ymax), color, 2)
det_label = self.labels_map[class_id] if self.labels_map else str(class_id)
cv2.putText(frame, det_label + ' ' + str(round(obj[2] * 100, 1)) + ' %', (xmin, ymin - 7),