meta-digi/meta-digi-dey/dynamic-layers/stm32mpu-ai/recipes-samples/pose-estimation/files/patches/0003-pose-estimation-set-ca...

40 lines
1.8 KiB
Diff

From: David Escalona <david.escalona@digi.com>
Date: Mon, 16 Sep 2024 18:47:43 +0200
Subject: [PATCH 3/3] pose-estimation: set camera preview to 640x480
Signed-off-by: David Escalona <david.escalona@digi.com>
---
.../files/tflite/tflite_pose_estimation.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tflite/tflite_pose_estimation.py b/tflite/tflite_pose_estimation.py
index 9d83ae3..ed33d5c 100644
--- a/tflite/tflite_pose_estimation.py
+++ b/tflite/tflite_pose_estimation.py
@@ -574,8 +574,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()
@@ -759,10 +761,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()