Detecting Objects which are not trained

I have trained my custom dataset, I am using webcam to detect the custom object which has been trained. It detect the object which has not been trained. How do i solve this , I need only the objects which are trained.

Thank you

Hi @Jaishankar_Vetrivel

Similar to your other post, please provide more detail about the issues you are experiencing. Things that would help include screenshots and a deeper explanation of what a solution would look like for you. This helps us assist you better!

Thanks for the reply, I am newbie, to start with i have my own data model, trained only 4 images.
Model Link

In the python code, I have used webcam to detect my custom model .
Used Filter Detetction, detections = detections[detections.class_id == 0]
It is not working.
I have attached the python code and the classes.txt

During training is there any specific epochs value to set during training.

yolo task=detect mode=train epochs=50 data=data.yaml imgsz=640 amp=False batch=8 patience=50

It detects other images like photo frame, clock etc , other than the trained images.

Hi @Jaishankar_Vetrivel

Thanks for the added detail. It looks like you are using Ultralytics YOLO. Generally, we don’t support other packages here on the Roboflow forum, but here’s some things I notice:

  • The line detections = detections[detections.class == 0] is not a valid way to filter a array in Python.
    • Something like this should work: detection = list(filter(lambda detections: detections.get('y') == 0, test))[0]
  • Your dataset has a total of four generated images, which is not enough to train a well-performing model.
    • You should try taking more example images, and take advantage of Roboflow’s augmentation features to create more images for the model to “learn from”
    • Try adding around ten more images and enable augmentations. Monitor your model’s performance and add images of cases where the model isn’t performing well.
  • The number of epochs is not an exact number that can be predicted before training. While 50 should be enough for your use case, if your mAP (mean average precision) is increasing significantly at the end of epochs, you should consider increasing that number. On the other hand, if your mAP is staying the same or even decreasing, you should consider decreasing the number of epochs.

Hope this helps

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.