From cfffb219aebf70b96500d31a8d68c10af7c5bb2e Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sun, 12 Jan 2020 12:48:43 -0600 Subject: [PATCH] switch back to stretch for hwaccel issues --- Dockerfile | 5 +++-- detect_objects.py | 4 ++-- frigate/objects.py | 4 ++-- frigate/video.py | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 86a339f51..201ba4bdb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,10 @@ -FROM debian:buster-slim +FROM debian:stretch-slim LABEL maintainer "blakeb@blakeshome.com" ENV DEBIAN_FRONTEND=noninteractive # Install packages for apt repo RUN apt -qq update && apt -qq install --no-install-recommends -y \ + apt-transport-https ca-certificates \ gnupg wget \ ffmpeg \ python3 \ @@ -15,7 +16,7 @@ RUN apt -qq update && apt -qq install --no-install-recommends -y \ # pillow-simd # zlib1g-dev libjpeg-dev \ # VAAPI drivers for Intel hardware accel - libva-drm2 libva2 i965-va-driver vainfo \ + i965-va-driver vainfo \ && echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" > /etc/apt/sources.list.d/coral-edgetpu.list \ && wget -q -O - https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \ && apt -qq update \ diff --git a/detect_objects.py b/detect_objects.py index b7156bab2..6eb1704e6 100644 --- a/detect_objects.py +++ b/detect_objects.py @@ -133,7 +133,7 @@ def main(): response.headers['Content-Type'] = 'image/jpg' return response else: - return f'Camera named {camera_name} not found', 404 + return "Camera named {} not found".format(camera_name), 404 @app.route('/') def mjpeg_feed(camera_name): @@ -142,7 +142,7 @@ def main(): return Response(imagestream(camera_name), mimetype='multipart/x-mixed-replace; boundary=frame') else: - return f'Camera named {camera_name} not found', 404 + return "Camera named {} not found".format(camera_name), 404 def imagestream(camera_name): while True: diff --git a/frigate/objects.py b/frigate/objects.py index 9703da123..eb3816801 100644 --- a/frigate/objects.py +++ b/frigate/objects.py @@ -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") diff --git a/frigate/video.py b/frigate/video.py index 54ffa69f4..a2a62d207 100644 --- a/frigate/video.py +++ b/frigate/video.py @@ -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")