Recent update has flipped RPi camera input in Detection.py example

Since the recent Hailo update where the pipelines have been split off into hailo_app_infra, I have noticed that in Detection.py (and also my own app) the SOURCE_PIPELINE is flipping the image horizontally from the RPi camera when –input=rpi. If I use –input=libcamera, the problem goes away but I have found that my application is not stable (it hangs after a while) with this setup.

I can see that the new SOURCE_PIPELINE includes a video flip element for the rpi case and I just wonder why this is? Should I be using libcamera instead and, if so, does anyone have any clue as to why processing in my app seems to stop after around 5 secs, whereas it is fine with –input=rpi.

Thanks

Hey @bower ,

I’ll investigate the stability issue you see here.

Regarding the horizontal flip: We previously encountered the opposite issue, which was resolved by adding the flip. You can resolve your current situation by removing the videoflip element from this section of code in gstreamer_helper_pipelines.py:

elif source_type == 'rpi':
    source_element = (
        f'appsrc name=app_source is-live=true leaky-type=downstream max-buffers=3 ! '
        'videoflip name=videoflip video-direction=horiz ! '
        f'video/x-raw, format={video_format}, width={video_width}, height={video_height} ! '
    )

You can find this in our repository at: hailo-apps-infra/hailo_apps_infra/gstreamer_helper_pipelines.py at main · hailo-ai/hailo-apps-infra · GitHub

Let me know if you need any clarification.

Best regards,
Omria

Thanks, your suggestion to remove the videoflip works just fine. I managed to subclass the GStreamerDetection app and then override get_pipeline_string() method to replace the SOURCE_PIPELINE.

I’m still seeing the hang up when using libcamera input however.