# Annotating overlapping classes

**URL:** <https://discuss.roboflow.com/t/annotating-overlapping-classes/10902>\
**Category:** 🤝  Community Help\
**Tags:** segmentation\
**Created:** [August 11, 2025, 1:05pm UTC](https://discuss.roboflow.com/t/annotating-overlapping-classes/10902 "2025-08-11T13:05:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![E\_Meyer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/e_meyer/32/7814_2.png) [@E\_Meyer](https://discuss.roboflow.com/u/E_Meyer)\
**Post date:** [August 11, 2025, 1:05pm UTC](https://discuss.roboflow.com/t/annotating-overlapping-classes/10902/1 "2025-08-11T13:05:34Z")

</div>

For Instance Segmentation, what is the best approach to annotating masks partially hidden by an object? I’m labeling ‘dumpsters’ and ‘trash’. The below image shows ‘trash’ sitting on top of the ‘dumpster’. When annotating the ‘dumpster’, should I include this boundary in the ‘dumpster’ class or should I act like the trash isn’t there and draw a straight line through to connect the visible parts of the dumpster? I’ve drawn a red box around the specific area in question.

Are there any transformations that can help with this? My main concern is training my model that a dumpster has an erratic shape, when in actuality it’s straight lines.

 ![rdobpzu751gf1](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/e/ed919cc82b45ebd4be174065fb566e7157320a24.jpeg)

---

<div class="post-metadata">

**Author:** ![Ford](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/ford/32/7747_2.png) [@Ford](https://discuss.roboflow.com/u/Ford)\
**Post date:** [August 11, 2025, 7:09pm UTC](https://discuss.roboflow.com/t/annotating-overlapping-classes/10902/2 "2025-08-11T19:09:24Z")

</div>

Hi @E_Meyer!  
The dumpster mask should go straight through the trash mask, this will properly account for the straight lines of a dumpster.

You are exactly right, you do not want to train your model that a dumpster has an erratic shape. Great work!!

---

<div class="post-metadata">

**Author:** ![E\_Meyer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/e_meyer/32/7814_2.png) [@E\_Meyer](https://discuss.roboflow.com/u/E_Meyer)\
**Post date:** [August 11, 2025, 7:24pm UTC](https://discuss.roboflow.com/t/annotating-overlapping-classes/10902/3 "2025-08-11T19:24:17Z")

</div>

Thank you so much @Ford ! You’re the only person to respond in the several different websites I was asking this. For those that stumble upon this…take a step back and ask yourself what you’re trying to do. For my use case, I want to get a rough % of fullness based on the ‘dumpster’ and ‘trash’ masks. I was so far into my project that I took a step back and simply asked “is that piece of trash part of that dumpster?”. In my case, No…it is not. Furthermore, based on what I’m trying to do I’d get getting erroneous ‘volume’ for my dumpster.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/1X/bb6edbfa56d0cf2ee603f061e9e09103502cc8cc.png) [@system](https://discuss.roboflow.com/u/system)\
**Post date:** [August 18, 2025, 7:25pm UTC](https://discuss.roboflow.com/t/annotating-overlapping-classes/10902/4 "2025-08-18T19:25:02Z")

</div>

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