Syn-McJ / TFClassify-Unity-Barracuda

An example of using Tensorflow and ONNX models with Unity Barracuda inference engine for image classification and object detection.
MIT License
124 stars 32 forks source link

Deploying a fast.ai resnet model for image segmentation? #7

Closed alter-sachin closed 4 years ago

alter-sachin commented 4 years ago

Hi. I have created a onnx file after building an image segmentation model that works to segment feet. I am unable to figure out how to deploy this to unity.

The model is based on this notebook. https://nbviewer.jupyter.org/github/fastai/course-v3/blob/master/nbs/dl1/lesson3-camvid.ipynb

I used the same method and exported the model to onnx format.

Would you able to point me to a direction where I can do this ?

Syn-McJ commented 4 years ago

@alter-sachin This example works specifically with mobilenet and yolo2 network architectures. Your image segmentation model has a different architecture (I'm guessing it's U-NET given that you use fast.ai). That means your model will produce output different from such of yolo2, which means you'll need to change all the code related to processing the output. The way that image is fed into the network can differ slightly as well.

I'm sure you understand that the purpose of this repository isn't to teach deep learning. The direction that I would go if I were you is to find a clear python example of inference using your model that works and try to port python code to C#. This can be a time-consuming and tedious process, but that is the process I followed to create this example for yolo2.

Wish you good luck.

alter-sachin commented 4 years ago

Thanks :)