Inference of my own tensorflow model

I am working on a project to detect rows of plants in agricultural fields.

This model will be used to create a steering system so that the tractor wheels pass between rows of plants.

My model is custom, built whith using tensorflow. The model takes color images (3 channels)as input and outputs an image with masks in a binary channel with 2 channels to separate plants from the background.

I am looking at Hailo RPi5 examples on GitHub and cannot find an example of a pipeline of my own model.

I have converted the model to a format.hef But I cannot figure out how to further build image processing for Rasperry PI 5 + Hailo8 .

Please tell me if you can help with this?

@Sergei_Zaharov
Can you elaborate where you are getting stuck? Since you already have the hef file, further integration should be easy. We developed a python SDK to simplify application development and wrote a detailed user guide on running your first inference: User Guide 1 Hailo World: Running Your First Inference on a Hailo Device Using DeGirum PySDK. Please see if it helps.

@shashi, thank you very much for your user guide! I’ve got the model prediction result of tht hef model. But the quality of segmentation turned out to be lower than I expected. I used a simple calibration of hailo tutorial. Мy tflite model does segmentation much better, but it gives too low fps. Please tell me how I can improve the quality of the hef model results? Do i need to use more advanced methods when calibrating and converting from tflite to hef model?

@Sergei_Zaharov
Glad to hear you got the model working. regarding the quality of segmentation, I think it would be helpful to compile with optimized settings and more calibration images. Did you evaluate the box map and mask map on both tflite and hef to compare?

@shashi
I’v used 1024 images for calibration. And tried different optimization and compression options when compiling the model. But I did not get the desired results. Also I’v used the analyze_noise. But it is difficult for me to interpret it and understand what to do with it further

Hi @Sergei_Zaharov
Did you get a chance to evaluate the box map and mask map of the compiled model and compare against the original values? This will give us some hint on what could be wrong. In our experience, we see some accuracy loss but it does not make the model unusable. If we see the accuracy metrics, we will know if something basic is going wrong. For example, if map drops by 10-15% (absolute), then there could definitely be something wrong with the compilation process.

Hi, @Shashi.
map of my original model is 0.5385. map of hef-model is 0.4339.
But in the process of comparing the models, I found the main problem that was holding me back. I was interpreting the results incorrectly. The model was giving me a mask with values ​​in the range [0, 255], while I was expecting [0, 1]. I converted the values ​​to the right range and the results were now more usable. But I need to continue improving the results.

@Sergei_Zaharov
Thanks for the information. Glad to see that the results are now usable. Let us know if we can be of any further help.