YOLO Object Detection on the Raspberry Pi AI Hat+ | How to Write Custom Python Code

Hi,
How do you flip the Camera in the example codes. Is anyone elses camera flipped? Can the resolution be changed when running these programs?
Thank you in advance I am a noobie at this and have been trying for a few days with out any luck

Hey Chris, welcome to the forums!

First of all, these things may seem like simple options to change, but to change them we need to dive deep into the pipelines which is quite an involved task. It took us half a day of experimenting just to figure out how to change the resolution without causing it to crash.

We have a section in the pose estimation version of this guide where we change the camera resolution. This only changes the initial capture resolution and not the processing resolution so its impact on performance is near zero. Since publishing it, Hailo has also juggled the repository a few times so the file may be located somewhere else in the project folder.

As for flipping the camera, your best bet would be to investigate the common folder from the section above. It also handles Gstreamer which is what manages the camera input. However, I don’t think it may even be possible to modify the pipeline to flip the camera input - its pretty tricky to work with this all.

Your best bet would be to maybe see if you can flip the camera before it goes into the pipeline. I’m unsure how this would be done, maybe @Dan might know?

Best of luck!

Thank you for the reply,
I had a look at the video you refered to and those files dont exist in my folders. I can see what I need to change on the video but i cant access this.

Hey @Chris257700

I’ve not had a chance to test it, but looking at the documentation for the regular pi cam either vflip or hflip will flip the camera, the syntax that’s used for changing the resolution looks similar to the documentation for doing so with the normal rpicam library. Potentially you can add in a line or modify an existing one to have either of these commands added.

I have also tried this with no luck as the camera setup is in the pipeline.

I have a found an easy workaround and aslo a way to change it in the pipeline thats is a bit harder.
For the easy option you can just set the input to libcamera. In the pipeline this camera feed has not been flipped.

for the harder option if you want to modify the pipline you need to install some tools from here

You can also adjust resolution in here.
Thanks again for the suggestions.

1 Like

Hi @Chris257700

Great to hear that you managed to get it sorted out. :slight_smile: