Enable async mode
Change-Id: Iabb6667850a181333a1c2bd7eeb95ddd592da42c
diff --git a/README.md b/README.md
index 5bb476e..e799671 100644
--- a/README.md
+++ b/README.md
@@ -11,17 +11,23 @@
## Build person-detection
```
-make build
+make docker-build
```
## Start RPi camera
+### M-JPEG
```
gst-launch-1.0 rpicamsrc bitrate=1000000 ! video/x-raw,width=640,height=480,framerate=25/1,profile=baseline ! jpegenc ! rtpjpegpay ! udpsink host=10.128.99.49 port=5000
```
-## Start persion-detection
+### H.264
```
-make run
+gst-launch-1.0 rpicamsrc bitrate=1000000 ! video/x-h264,width=640,height=480,framerate=15/1 ! h264parse ! rtph264pay config-interval=10 pt=96 ! udpsink host=10.128.99.49 port=5000
+```
+
+## Start person-detection-app
+```
+make docker-run
```
## Quick test
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 882c5d0..7cfcbfa 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -25,4 +25,4 @@
pip3 install -r requirements.txt
ENTRYPOINT ["./bin/person_detection.sh"]
-CMD ["-i gstreamer"]
+CMD ["-i gstreamer -pt 0.75"]
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),