Add object size to the bounding box

Remove script from Dockerfile

Fix framerate command

Move default value for framerate

update dockerfile

dockerfile changes

Add person_area label to surrounding box


Update dockerfile


ffmpeg config bug


Add `person_area` label to `best_person` frame


Resolve debug view showing area label for non-persons


Add object size to the bounding box


Add object size to the bounding box
This commit is contained in:
Kyle Niewiada 2019-07-02 18:20:06 -04:00
parent 4ce6f657a1
commit 9de0f12710
2 changed files with 8 additions and 2 deletions

View File

@ -81,7 +81,7 @@ class BestPersonFrame(threading.Thread):
if not self.best_person is None and self.best_person['frame_time'] in recent_frames:
best_frame = recent_frames[self.best_person['frame_time']]
label = "{}: {}%".format(self.best_person['name'],int(self.best_person['score']*100))
label = "{}: {}% {}".format(self.best_person['name'],int(self.best_person['score']*100),int(self.best_person['area']))
draw_box_with_label(best_frame, self.best_person['xmin'], self.best_person['ymin'],
self.best_person['xmax'], self.best_person['ymax'], label)

View File

@ -236,6 +236,10 @@ class Camera:
for obj in objects:
if obj['name'] == 'person':
person_area = (obj['xmax']-obj['xmin'])*(obj['ymax']-obj['ymin'])
# Store person_area to use in the label later
obj['area'] = person_area
# find the matching region
region = None
for r in self.regions:
@ -279,7 +283,9 @@ class Camera:
# draw the bounding boxes on the screen
for obj in detected_objects:
label = "{}: {}%".format(obj['name'],int(obj['score']*100))
# since debug mode can show all kinds of objects, we need to calculate the area outside of `add_objects`
area = (obj['xmax']-obj['xmin'])*(obj['ymax']-obj['ymin'])
label = "{}: {}% {}".format(obj['name'],int(obj['score']*100),int(area))
draw_box_with_label(frame, obj['xmin'], obj['ymin'], obj['xmax'], obj['ymax'], label)
for region in self.regions: