Best practices to image annotation for object detection when objects overlap

If I have the following example:

How should I annotate the bottom image? I can think of those scenarios:

  1. Create a large box that captures class B and a second box that captures entirely class A. This will lead to overlapping boxes. Result:

  1. Create two boxes that do not overlap, but also do not covers the objects entirely. Result:

I think the right choice is scenario 1, but will the algorithm be able to capture this difference? Considering SSD, YOLO.

Topic object-detection labelling

Category Data Science

About

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