zawarasal
zawarasal

Reputation: 11

Training Yolo to detect my custom object with already cropped images

I have a large set of "apple" images in various shapes, sizes, lighting, color, etc. These "apple" images were part of a larger image from different angles.

Now I want to train Darknet to detect "apple"s in images. I don't want to go through annotation process as I already have cropped out ready jpg images of apples.

Can I use these ready and cropped "apple" images to train Darknet or do I still have to go through annotation process?

Upvotes: 0

Views: 2497

Answers (2)

Cayman1021
Cayman1021

Reputation: 41

Your answer relates to a process that we called "Data Augmentation". You can google it how others do.

Since your apple images are all cropped-ready, you can assume all apple images were already tagged by their full sizes. Then collect some background images of which the sizes are all bigger than any of your apple images. And now you can write a tool to randomly select an apple image and combine it to your randomly-selected background to generate 'new' apple images with backgrounds. Since you must know the size of each apple image, you can definitely calculate the size of the bounding box and its position and then generate its tag file.

Upvotes: 2

Naruto137
Naruto137

Reputation: 94

In object detection models, you annotate the object in an image because it will understand where the object is in a particular image. If you have an entire dataset containing only apple images, the model will learn in a way such that every image you provide will contain the only apple. So even if you provide an "orange" as a test image, it might still give apple because it doesn't know another class except for apple.

So there are two important points to consider:

  1. Have dataset in such a way that there are apples, apples with other fruits or other objects. This will help the model to understand clearly what apple is.
  2. As the coordinates of the bounding box are inputs for the detection, although you can give the regular dimensions of the image as the bounding box, it won't learn effectively well as mentioned above. Therefore, have multiple objects in the image and then annotate well so that the model can learn well

Upvotes: 2

Related Questions