Queue frames
Change-Id: Id176d529f224fcb58376219194f26fc93539bc24
diff --git a/person_detection/person_detection.py b/person_detection/person_detection.py
index 8eff1bc..9c5f0d9 100644
--- a/person_detection/person_detection.py
+++ b/person_detection/person_detection.py
@@ -29,7 +29,7 @@
def __init__(self, device, args):
log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout)
- self.model = args.model
+ self.model_xml = args.model
self.input = args.input
self.prob_threshold = args.prob_threshold
@@ -61,12 +61,11 @@
def init_inference(self):
- model_xml = self.model
- model_bin = os.path.splitext(model_xml)[0] + ".bin"
+ self.model_bin = os.path.splitext(self.model_xml)[0] + ".bin"
# Read IR
log.info("Reading IR...")
- net = IECore().read_network(model=model_xml, weights=model_bin)
+ net = IECore().read_network(model=self.model_xml, weights=self.model_bin)
assert len(net.inputs.keys()) == 1, "Demo supports only single input topologies"
assert len(net.outputs) == 1, "Demo supports only single output topologies"
@@ -77,6 +76,7 @@
exec_net = IECore().load_network(network=net, device_name="CPU", num_requests=2)
# Read and pre-process input image
shape = Shape(*net.inputs[input_blob].shape)
+
del net
return exec_net, shape, input_blob, out_blob
@@ -90,10 +90,6 @@
cur_request_id = 0
next_request_id = 1
- log.info("Starting inference in async mode...")
- log.info("To switch between sync and async modes press Tab button")
- log.info("To stop the demo execution press Esc button")
-
# Async doesn't work if True
# Request issues = Runtime Error: [REQUEST BUSY]
# self.is_async_mode = False
@@ -146,8 +142,6 @@
det_label = str(class_id)
cv2.putText(frame, det_label + ' ' + str(round(obj[2] * 100, 1)) + ' %', (xmin, ymin - 7),
cv2.FONT_HERSHEY_COMPLEX, 0.6, color, 1)
- # print('Object detected, class_id:', class_id, 'probability:', obj[2], 'xmin:', xmin, 'ymin:', ymin,
- # 'xmax:', xmax, 'ymax:', ymax)
cv2.putText(frame, self.device, (10, int(initial_h - 20)),
cv2.FONT_HERSHEY_COMPLEX, 0.5, (10, 10, 200), 1)