Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sayanshaw24 opened this issue Aug 20, 2019 · 7 comments

Comments

@sayanshaw24
Copy link

commented Aug 20, 2019

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:

  • np: min, max, copy, full, newaxis
  • cv2: warpAffine, imread, cvtColor
  • tf: train.ExponentialMovingAverage, trainable_variables, no_op(), GraphKeys

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

This comment has been minimized.

Copy link
Member

commented Aug 20, 2019

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

This comment has been minimized.

Copy link
Member

commented Aug 20, 2019

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

This comment has been minimized.

Copy link

commented Aug 20, 2019

@sayanshaw24

This comment has been minimized.

Copy link
Author

commented Aug 20, 2019

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

This comment has been minimized.

Copy link
Member

commented Aug 20, 2019

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

Yes.

@Oceania2018

This comment has been minimized.

Copy link
Member

commented Aug 20, 2019

@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.

@Oceania2018 Oceania2018 added this to Needs triage in TensorFlowNET.Core via automation Aug 20, 2019
@sayanshaw24

This comment has been minimized.

Copy link
Author

commented Aug 21, 2019

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

Oceania2018 added a commit that referenced this issue Aug 21, 2019
Oceania2018 added a commit that referenced this issue Aug 21, 2019
Oceania2018 added a commit that referenced this issue Aug 21, 2019
Oceania2018 added a commit that referenced this issue Aug 24, 2019
Oceania2018 added a commit that referenced this issue Sep 2, 2019
Oceania2018 added a commit that referenced this issue Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
TensorFlowNET.Core
  
Needs triage
TensorFlowNET.Examples
  
Awaiting triage
4 participants
You can’t perform that action at this time.