When should one train YOLOv5 on custom dataset or use standard COCO weights?

I am running a YOLOv5 detector on the below video to detect persons in the stream.

It is giving me satisfactory response.

I need to know if I should train the model on my custom dataset, or continue to use the standard weights given in the Ultralytics Github repo.

When should one train the model on their custom data?

Also how many annotated images should I arrange if I want to train on my custom dataset?

Topic yolo computer-vision deep-learning

Category Data Science


COCO dataset contains more than 91 stuff categories with 330K images (>200K labeled). Perhaps it is not the best way to identify people using YOLOv5 because your workshop has illumination changes during the daytime (natural light and lamps?). Thus, I suggest the following:

  1. Use other pre-trained weights for people detection only, use this. I got them from this website, and they work pretty well.
  2. Label people from recorded videos in different hours and check the recommendations below.
  • Images per class. ≥ 1500 images per class recommended
  • Instances per class. ≥ 10000 instances (labeled objects) per class recommended
  • Image variety. Must be representative of deployed environment. For real-world use cases we recommend images from different times of day, different seasons, different weather, different lighting, different angles, different sources (scraped online, collected locally, different cameras) etc.
  • Label consistency. All instances of all classes in all images must be labelled.
  • Partial labelling will not work.
  • Label accuracy. Labels must closely enclose each object. No space should exist between an object and it's bounding box. No objects should be missing a label.
  • Background images. Background images are images with no objects that are added to a dataset to reduce False Positives (FP). We recommend about 0-10% background images to help reduce FPs (COCO has 1000 background images for reference, 1% of the total). No labels are required for background images.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.