switch back to stretch for hwaccel issues

This commit is contained in:
Blake Blackshear
2020-01-12 12:48:43 -06:00
parent 382d7be50a
commit cfffb219ae
4 changed files with 9 additions and 8 deletions

View File

@@ -254,7 +254,7 @@ class ObjectTracker(threading.Thread):
self.camera.objects_tracked.notify_all()
def register(self, index, obj):
id = f"{str(obj['frame_time'])}-{index}"
id = "{}-{}".format(str(obj['frame_time']), index)
obj['id'] = id
obj['top_score'] = obj['score']
self.add_history(obj)
@@ -396,7 +396,7 @@ class BestFrames(threading.Thread):
best_frame = self.camera.frame_cache[obj['frame_time']]
draw_box_with_label(best_frame, obj['box']['xmin'], obj['box']['ymin'],
obj['box']['xmax'], obj['box']['ymax'], obj['name'], f"{int(obj['score']*100)}% {obj['area']}")
obj['box']['xmax'], obj['box']['ymax'], obj['name'], "{}% {}".format(int(obj['score']*100), obj['area']))
# print a timestamp
time_to_show = datetime.datetime.fromtimestamp(obj['frame_time']).strftime("%m/%d/%Y %H:%M:%S")

View File

@@ -329,11 +329,11 @@ class Camera:
tracked_objects = copy.deepcopy(self.object_tracker.tracked_objects)
for obj in detected_objects:
draw_box_with_label(frame, obj['box']['xmin'], obj['box']['ymin'], obj['box']['xmax'], obj['box']['ymax'], obj['name'], f"{int(obj['score']*100)}% {obj['area']}", thickness=3)
draw_box_with_label(frame, obj['box']['xmin'], obj['box']['ymin'], obj['box']['xmax'], obj['box']['ymax'], obj['name'], "{}% {}".format(int(obj['score']*100), obj['area']), thickness=3)
for id, obj in tracked_objects.items():
color = (0, 255,0) if obj['frame_time'] == frame_time else (255, 0, 0)
draw_box_with_label(frame, obj['box']['xmin'], obj['box']['ymin'], obj['box']['xmax'], obj['box']['ymax'], obj['name'], f"{id}", color=color, thickness=1, position='bl')
draw_box_with_label(frame, obj['box']['xmin'], obj['box']['ymin'], obj['box']['xmax'], obj['box']['ymax'], obj['name'], id, color=color, thickness=1, position='bl')
# print a timestamp
time_to_show = datetime.datetime.fromtimestamp(frame_time).strftime("%m/%d/%Y %H:%M:%S")