Building python application around hef semantic segmentation model

Hello,
I have an hef file represeting semantic segmentation model (segformer or fcn).
I am trying to build the application around it via hailo_platform module in python.
First - is there any example I can use for semantic segmentation for this task?
Second - I wish to view the shape of the input to the hef model? Is there any tool I can use to check what is exactly expected in the input?
So i will know exactly to prepare the preprocess step.
Thanks
David

Hi @dudibs,

Yes, there is a C++ example of using semantic segmentation available in the Hailo Application Code Examples repository. You can check it out here:
Hailo-Application-Code-Examples: Semantic Segmentation

To check the input and output shapes of your model, you can use the hailortcli tool. Run the following command inside a virtual environment:

hailortcli parse-hef <hef_name>  

I hope this helps! Let me know if you have any further questions or need additional assistance.

Best regards,
Ronit

thanks a lot Ronit but i am working in python. I took the object detection from the runtime python and some how adapt it to semantic segmentation. not easy since the inference there is using threads and its difficult to debug. if you will have a python example for semantic segmentation I would love to have it.

You can use this example as a reference:
Hailo RPi5 Semantic Segmentation Example

Please note that this is not an official implementation and has not been tested. It’s provided for reference purposes only.

Best regards,
Ronit

its instance segmentation. not semantic. I managed to adapt the object detection python code from the hailo application code examples to do inference from my custom trained hef model. my model is segformer accepting one channel gray images. thanks.