How to perform pruning on trained object detection model? - object-detection-api

Hi I have trained object detection model using tensorflow 1.14 object detection API, my model is performing well. However, I want to reduce/optimize parameters of model to make it lighter. How can I use pruning on trained model?

Did you check the Pruning guide on the Tensorflow website ?
It has concrete examples on how to prune a model and benchmark the size and performance improvements.

Related

Automatic image labelling for custom training YOLOv5

There are manual tools like Makesense.ai to create the labelled data for custom training YOLO, but is there any method for automatic labelling of multiple objects in an image so that the image labelling process would be faster?
Makesense.ai has the very feature you are asking for. You can use a network trained on coco or provide your own yolov5 tensorflow js model.

Training face detection models from object detection repositories

For training a model for face detection, is it possible to take a model for object detection and train it on a face detection data set (with only one class)? Are there any issues with having only 1 class for the object detection model?
The repository I am planning on using is: https://github.com/qfgaohao/pytorch-ssd
What you are talking about is transfer learning. Without any further information about your problem, I think it's best to train both from scratch and using that pre-trained model to see which one performs better.
Are there any issues with having only 1 class for the object detection model?
I am working on a medical project that focuses on detecting one class (lesion), so it's not something unusual in the field.

Ml.Net Imageclassification incremental learning

Is Ml.net image classification trainer support incremental learning or not and if yes can anybody show me example or topic to read it
If by incremental learning you're referring to taking the weights from a trained model and using that as the starting point to continue training, it's not supported at the moment. Technically though you're not starting from scratch with the image classification trainer since you're using transfer learning to train the last layer of the chosen pretrained image classification network, but incremental learning on your trained model is currently not supported. I would suggest posting an issue in the repo requesting this feature so others who may want this feature as well are able to upvote / comment on it.
https://github.com/dotnet/machinelearning/issues/new/choose

How to convert Faster R-CNN with TensorRT?

I'm trying to use TensorRT to speed up my pre-trained model at inference time. Any object detection pre-trained model would work actually, doesn't have to be Faster R-CNN.
I saw that many layers are not supported by TensorRT yet, what would the procedure be in that case? I read that you can implement those layers yourself, but what does that mean? Would I need to retrain my model after "implementing those layers"?
Thanks

It's possible to do object detection (one-class) in images retraining Inception model?

There is a way to do object detection, retraining Inception model provided by Google in Tensorflow? The goal is to predict wheter an image contains a defined category of objects (e.g. balls) or not. I can think about it as a one-class classification or multi-class with only two categories (ball and not-ball images). However, in the latter I think that it's very difficult to create a good training set (how many and which kind of not-ball images I need?).
Yes, there is a way to tell if something is a ball. However, it is better to use Google's Tensorflow Object Detection API for Tensorflow. Instead of saying "ball/no ball," it will tell you it thinks something is a ball with XX% accuracy.
To answer your other questions: with object detection, you don't need non-ball images for training. You should gather about 400-500 ball images (more is almost always better), split them into a training and an eval group, and label them with this. Then you should convert your labels and images into a .record file according to this. After that, you should set up Tensorflow and train.
This entire process is not easy. It took me a good couple of weeks with an iOS background to successfully train a single object detector. But it is worth it in the end, because now I can rapidly switch out images to train a different object detector whenever an app needs it.
Bonus: use this to convert your new TF model into a .mlmodel usable by iOS/Android.

Resources