How to remove an object from the trained model in .pb format?

Question:

Iam training tello drone to detecting the cars, so I use this code here: https://github.com/Shreyas-dotcom/Tello_Obj_Recognition, but the code contain others objects names such as bike. So my question is: How can I remove others objects from the trained model.

Asked By: Shalaw Mshir

||

Answers:

Assuming you want to remove additional labels from a trained model, It is generally not possible to remove labels from a trained model. Since the model has updated its weights to provide the best predictions in all classes, it would require changing the underlying structure of the model and the model weights themselves.

Generally, you have three different options:

  1. Retrain the model with using a dataset that only contains labels (or object names as you’ve referred to it) that you need to take predictions.

  2. Look for a different model that has been trained with a dataset that only has the classes/labels that you want.

  3. Filter the outputs from the current model. You can apply a filter (maybe a postprocessing step) that can remove predictions regarding labels that you don’t need.

Given your situation, it is my opinion that the last option will suit you better if you are looking for a quick fix and if you have a dataset ready and computing resources to train a new model, you can go for the first option.

Answered By: Hiran Hasanka