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 521 forks source link

TensorFlow, NumPy and OpenCV bindings needed for Object Detection Retrain #359

Open sayanshaw24 opened 5 years ago

sayanshaw24 commented 5 years ago

I have been working on writing a final layer retrain for object detection with the YOLOv3 model. I am looking at the following Python example, writing implementation for it in C# on ML.NET, and using TF.NET for python bindings: https://github.com/YunYang1994/tensorflow-yolov3

I have written some missing bindings already, however the following are some that I need assistance for in order to load label and truth Tensors and compute the confidence, classification and GIOU loss functions for YOLO:

For the OpenCV bindings, I found a .NET wrapper called Emgu CV that we could use: http://www.emgu.com/wiki/index.php/Main_Page

Thanks

Nucs commented 5 years ago

Hey @sayanshaw24, This weekend we will release TF.NET and NumSharp version 0.20 which will np's include min, max, copy. newaxis is tricky with C#'s strong typing. If it is used in a reshape method - just replace it with a value 1. Alternatively you can use np.expanddim

Regarding the rest, @Oceania2018

Nucs commented 5 years ago

Also I don't think TF.NET have anything to do with OpenCV bindings. You might need to look up a solution for OpenCV on your own.

dgerding commented 5 years ago

Emgu is the long standing rapper of open CV for net. There is an open source or no cost option and then you can move up into commercial versions as well if I recall

Enjoy now. Make it count. or do both.


From: Eli Belash notifications@github.com Sent: Tuesday, August 20, 2019 4:16:24 PM To: SciSharp/TensorFlow.NET TensorFlow.NET@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [SciSharp/TensorFlow.NET] TensorFlow, NumPy and OpenCV bindings needed for Object Detection Retrain (#359)

Also I don't think TF.NET have anything to do with OpenCV bindings. You might need to find a solution on your own.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/SciSharp/TensorFlow.NET/issues/359?email_source=notifications&email_token=AAD7YD25W2PDZN3MLIK47UDQFRNKRA5CNFSM4IN42ZBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4XV5NY#issuecomment-523198135, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAD7YD6PWISQX5MQU6UE5ILQFRNKRANCNFSM4IN42ZBA.

sayanshaw24 commented 5 years ago

Ok, sounds good, thanks!

Will the new NumSharp nugget include np.full @Nucs? I could just use a duplicate object, but I am worried about issues raising from the pointers having the same memory allocation, but I can try it.

@dgerding Alright, I will start embedding Emgu CV in ML.NET.

Nucs commented 5 years ago

Will the new NumSharp nugget include np.full @Nucs?

Yes.

Oceania2018 commented 5 years ago

@sayanshaw24 Please describe more detail about:

tf: train.ExponentialMovingAverage, trainable_variables, no_op(), GraphKeys

I'm not really understand what you need. It would be better if you can provide the unit test in python or link. Or can you share your current work, so I can take look at it, and know exactly what should I do.

sayanshaw24 commented 5 years ago

I need the following TensorFlow optimizers/variables in TF.NET so I can use it with ML.NET for object detection retrain: tf.train.ExponentialMovingAverage, an exponential decay optimizer: https://www.tensorflow.org/api_docs/python/tf/train/ExponentialMovingAverage

tf.trainable_variables, a list of trainables: https://www.tensorflow.org/api_docs/python/tf/trainable_variables

tf.no_op, a placeholder operation: https://www.tensorflow.org/api_docs/python/tf/no_op

tf.GraphKeys, for access to the graph keys, such as updated operations: https://www.tensorflow.org/api_docs/python/tf/GraphKeys