# Instance segmentation with YOLOv8

**URL:** <https://community.stereolabs.com/t/instance-segmentation-with-yolov8/4022>\
**Category:** Python\
**Created:** [November 21, 2023, 11:30am UTC](https://community.stereolabs.com/t/instance-segmentation-with-yolov8/4022 "2023-11-21T11:30:38Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![JPlou](https://community.stereolabs.com/user_avatar/community.stereolabs.com/jplou/32/1012_2.png) [@JPlou](https://community.stereolabs.com/u/JPlou)\
**Post date:** [November 23, 2023, 9:40am UTC](https://community.stereolabs.com/t/instance-segmentation-with-yolov8/4022/6 "2023-11-23T09:40:08Z")

</div>

@sanjaiiv04

As I said [in this post](https://community.stereolabs.com/t/image-segmentation-using-yolov8-with-zed-2i-python/3565/6) (thanks for the question, it was indeed not clear), the custom detector is able to output segmentation, but you can only input bounding boxes to it. So it’s not that it’s not capable of segmentation, just not capable of ingesting it.

In the sample you’re using, if you comment out the predict and for loop, does the code run? If yes, sorry but that’s not a ZED SDK issue and I won’t be able to help, you would have more luck looking for YOLO samples probably.

However, you may be able to achieve what you want by adding an overlay to the image using the [ObjectData.mask](https://www.stereolabs.com/docs/api/python/classpyzed_1_1sl_1_1ObjectData.html#aff25fe6cafaf46730a2b278426aaafbb) data if you enable the segmentation in the custom OD sample.

---

_[View the full topic](https://community.stereolabs.com/t/instance-segmentation-with-yolov8/4022)._
