SciSharp / TensorFlow.NET

.NET Standard bindings for Google's TensorFlow for developing, training and deploying Machine Learning models in C# and F#.
https://scisharp.github.io/tensorflow-net-docs
Apache License 2.0
3.25k stars 523 forks source link

[Question]: Object detection / inference model #1050

Closed Cilouche closed 1 year ago

Cilouche commented 1 year ago

Description

Hello,

Please, may I find an example of object detection / inference model with tensorflow and opencvSharp for images

Thanks

Alternatives

No response

AsakusaRinne commented 1 year ago

Hi, examples are available here: https://github.com/SciSharp/SciSharp-Stack-Examples/tree/master/src%2FTensorFlowNET.Examples%2FObjectDetection

The examples use SharpCV. If you want to use opencv sharp it may need 1-2 weeks. Opencv Adapter is under development, which allows you to use opencv sharp with tf.net. You can also use it now by compiling it yourself: https://github.com/SciSharp/OpencvAdapter

Cilouche commented 1 year ago

Hi,

Thank you for your feedback, concerning the first example, I have an error on the model input image

and when i cast var image_tensors = tf.cast(tn, tf.float32);

another error persists image

Thanks

AsakusaRinne commented 1 year ago

This is an example with tf v1. You can try to checkout the example repo to branch "tf-align-v1". If the problem still appears, @Oceania2018 is more familiar with tf v1 examples to help you. Or I'll give you a further feed back the day aftet tomorrow since I'm on vacation now and it's not convenient for me to debug it. :)

Oceania2018 commented 1 year ago

The data type doesn't match.

Cilouche commented 1 year ago

efficiently, data type problem, thank you