Answers.Body: <p>I recommend the first option: &quot;Annotate the full contour of the outer object. Some pixels belong to 2 classes.&quot; This option is easier to implement and better matches the human intuitive world model.</p>
  <h1>How to do it</h1>
  <p>I don't know what software implements this, but something I did in the 90s for this problem was to have one grayscale image per object being annotated. The pixel's intensity is the posterior probability of the pixel belonging to that object.</p>
  <p>You can make each object's probabilities a frame with modern animation formats (APNG, lossless WebP). Other image formats allow multiple layers (for example, <a href="https://netpbm.sourceforge.net/doc/pam.html" rel="nofollow noreferrer">PAM</a> with <code>DEPTH=#layers</code> and <code>MAXVAL=# values in a pixel in a layer</code>). And you can use 1-bit layers if you have binary rather than probabilistic classification.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-01-07T14:37:21.937Z
Answers.LastActivityDate: 2024-01-07T14:37:21.937Z
Answers.UserDisplayName: Eponymous
Body: <p>As I struggle to find any literature online about this, I wanted to create a discussion that other would be able to learn from.</p>
  <p>My question is inspired from a <a href="https://github.com/ultralytics/ultralytics/issues/3213" rel="nofollow noreferrer">Yolo GitHub issue</a>.</p>
  <p>In this example we have 2 objects, here a plate and an egg, with one object being inside the other one.</p>
  <p><a href="https://i.sstatic.net/kVPHD.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/kVPHD.png" alt="enter image description here" /></a></p>
  <p>The question is how to annotate the plate (aka the outer object).</p>
  <ol>
  <li>Annotate full contour of outer object. Some pixels belong to 2 classes.</li>
  <li>Make a little bridge to the inner object so that the contour of the outer object excludes the inner object.</li>
  </ol>
  <p>This question arose while using Yolo but can be extended to other instance segmentation models.</p>
  <p>Any more information regarding good practices in instance segmentation is more than welcome.</p>
  
Tags: <computer-vision><yolo><instance-segmentation>
Title: Handle overlapping objects in instance segmentation annotation
UserDisplayName: Timothee W
ThreadText: # Handle overlapping objects in instance segmentation annotation
  
  (Asked by: username_0 on 2024-01-07)
  
  As I struggle to find any literature online about this, I wanted to create a discussion that other would be able to learn from.
  
  My question is inspired from a [Yolo GitHub issue](https://github.com/ultralytics/ultralytics/issues/3213).
  
  In this example we have 2 objects, here a plate and an egg, with one object being inside the other one.
  
  [![enter image description here](https://i.sstatic.net/kVPHD.png)](https://i.sstatic.net/kVPHD.png)
  
  The question is how to annotate the plate (aka the outer object).
  
  1. Annotate full contour of outer object. Some pixels belong to 2 classes.
  2. Make a little bridge to the inner object so that the contour of the outer object excludes the inner object.
  
  This question arose while using Yolo but can be extended to other instance segmentation models.
  
  Any more information regarding good practices in instance segmentation is more than welcome.
  
  **Tags:** computer-vision, yolo, instance-segmentation
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-01-07. Score: 0
  
  I recommend the first option: "Annotate the full contour of the outer object. Some pixels belong to 2 classes." This option is easier to implement and better matches the human intuitive world model.
  
  # How to do it
  
  I don't know what software implements this, but something I did in the 90s for this problem was to have one grayscale image per object being annotated. The pixel's intensity is the posterior probability of the pixel belonging to that object.
  
  You can make each object's probabilities a frame with modern animation formats (APNG, lossless WebP). Other image formats allow multiple layers (for example, [PAM](https://netpbm.sourceforge.net/doc/pam.html) with `DEPTH=#layers` and `MAXVAL=# values in a pixel in a layer`). And you can use 1-bit layers if you have binary rather than probabilistic classification.
  
  
  ---
  
  