Hey, everybody!
When I use detection.py from hailo-rpi5-examples with a usb camera input I get a small window. I want to make the video to be full screen. I managed to modify DISPLAY_PIPELINE a little bit, but there are still unfilled spaces on the sides. How can I do this?
Here is just the modified code in hailo_rpi_common.py :
from screeninfo import get_monitors
...
def get_screen_resolution():
monitor = get_monitors()[0]
width = monitor.width
height = monitor.height
return width, height
....
def DISPLAY_PIPELINE(video_sink='xvimagesink', sync='true', show_fps='false', name='hailo_display'):
"""
Creates a GStreamer pipeline string for displaying the video.
It includes the hailooverlay plugin to draw bounding boxes and labels on the video.
Args:
video_sink (str, optional): The video sink element to use. Defaults to 'xvimagesink'.
sync (str, optional): The sync property for the video sink. Defaults to 'true'.
show_fps (str, optional): Whether to show the FPS on the video sink. Should be 'true' or 'false'. Defaults to 'false'.
name (str, optional): The prefix name for the pipeline elements. Defaults to 'hailo_display'.
Returns:
str: A string representing the GStreamer pipeline for displaying the video.
"""
screen_width, screen_height = get_screen_resolution()
# Construct the display pipeline string
display_pipeline = (
f'{QUEUE(name=f"{name}_hailooverlay_q")} ! '
f'hailooverlay name={name}_hailooverlay ! '
f'{QUEUE(name=f"{name}_videoscale_q")} ! '
f'videoscale ! '
f'video/x-raw, width={screen_width}, height={screen_height} ! '
f'{QUEUE(name=f"{name}_videoconvert_q")} ! '
f'videoconvert name={name}_videoconvert n-threads=2 qos=false ! '
f'{QUEUE(name=f"{name}_q")} ! '
f'fpsdisplaysink name={name} video-sink={video_sink} sync={sync} text-overlay={show_fps} signal-fps-measurements=true '
)
return display_pipeline
And this is what the screen looks like after changes in the code