Skip to content

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

Open

Description

@sayanshaw24

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

Activity

  1. Nucs commented on Aug 20, 2019

    @Nucs
    Member

    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

  2. Nucs commented on Aug 20, 2019

    @Nucs
    Member

    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.

  3. dgerding commented on Aug 20, 2019

    @dgerding
  4. sayanshaw24 commented on Aug 20, 2019

    @sayanshaw24
    Author

    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.

  5. Nucs commented on Aug 20, 2019

    @Nucs
    Member

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

    Yes.

  6. Oceania2018 commented on Aug 20, 2019

    @Oceania2018
    Member

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

  7. added
    enhancement
    on Aug 20, 2019
  8. sayanshaw24 commented on Aug 21, 2019

    @sayanshaw24
    Author

    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

  9. added a commit that references this issue on Sep 2, 2019
  10. added a commit that references this issue on Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions