From: David Escalona Date: Mon, 16 Sep 2024 18:43:55 +0200 Subject: [PATCH 3/3] image-classification: set camera preview to 640x480 Signed-off-by: David Escalona --- .../files/stai-mpu/stai_mpu_image_classification.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stai-mpu/stai_mpu_image_classification.py b/stai-mpu/stai_mpu_image_classification.py index a86fcb0..f21196b 100644 --- a/stai-mpu/stai_mpu_image_classification.py +++ b/stai-mpu/stai_mpu_image_classification.py @@ -536,8 +536,10 @@ class MainWindow(Gtk.Window): if self.app.enable_camera_preview == True: # camera preview => gst stream self.video_widget = self.app.gst_widget + self.video_widget.set_size_request(640, 480); self.video_widget.set_app_paintable(True) - self.video_box.pack_start(self.video_widget, True, True, 0) + self.video_box.pack_start(self.video_widget, True, False, 0) + self.video_box.set_center_widget(self.video_widget) else : # still picture => openCV picture self.image = Gtk.Image() @@ -709,10 +711,12 @@ class OverlayWindow(Gtk.Window): self.video_box.set_name("gui_overlay_video") self.video_box.set_app_paintable(True) self.drawing_area = Gtk.DrawingArea() + self.drawing_area.set_size_request(640, 480); self.drawing_area.connect("draw", self.drawing) self.drawing_area.set_name("overlay_draw") self.drawing_area.set_app_paintable(True) - self.video_box.pack_start(self.drawing_area, True, True, 0) + self.video_box.pack_start(self.drawing_area, True, False, 0) + self.video_box.set_center_widget(self.drawing_area) # setup the exit box which contains the exit button self.exit_box = Gtk.VBox()