# Where have code sample for 2D-object-detection

**URL:** <https://community.stereolabs.com/t/where-have-code-sample-for-2d-object-detection/515>\
**Category:** Python\
**Tags:** python\
**Created:** [September 25, 2021, 4:12am UTC](https://community.stereolabs.com/t/where-have-code-sample-for-2d-object-detection/515 "2021-09-25T04:12:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wingto](https://community.stereolabs.com/user_avatar/community.stereolabs.com/wingto/32/220_2.png) [@Wingto](https://community.stereolabs.com/u/Wingto)\
**Post date:** [September 25, 2021, 4:12am UTC](https://community.stereolabs.com/t/where-have-code-sample-for-2d-object-detection/515/1 "2021-09-25T04:12:13Z")

</div>

Hi there I really want to try to use 2D object detection intergal with ZED2, rather than 3D, because in my case I need to detect object from long distance, I searched for it in offical tutorial but it haven’t 2D for me, have any resource to learn about 2D object detection?  
[https://www.stereolabs.com/docs/tutorials/3d-object-detection/](https://www.stereolabs.com/docs/tutorials/3d-object-detection/)

---

<div class="post-metadata">

**Author:** ![quythao.truong](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/q/c68b51/32.png) [@quythao.truong](https://community.stereolabs.com/u/quythao.truong)\
**Post date:** [September 27, 2021, 9:17am UTC](https://community.stereolabs.com/t/where-have-code-sample-for-2d-object-detection/515/2 "2021-09-27T09:17:27Z")

</div>

Hello @Wingto,

You can refer to our Object Detection tutorial [here](https://github.com/stereolabs/zed-examples/blob/982b2d842b611a7269e3565430fd3409cbab3d34/tutorials/tutorial%206%20-%20object%20detection/python/object_detection.py#L84) that shows how to retrieve 2D bounding boxes of detected objects.  
We also used to have an Object Detection sample showing how to draw 2D bounding boxes using OpenCV : you can find it [here](https://github.com/stereolabs/zed-examples/blob/ea9fdf306dc241a51e93db56dac2182dc8e3c1dc/object%20detection/image%20viewer/python/object_detection_2d.py)

Hope this helps

---

<div class="post-metadata">

**Author:** ![ChealsieBains01](https://community.stereolabs.com/user_avatar/community.stereolabs.com/chealsiebains01/32/278_2.png) [@ChealsieBains01](https://community.stereolabs.com/u/ChealsieBains01)\
**Post date:** [November 15, 2021, 9:30pm UTC](https://community.stereolabs.com/t/where-have-code-sample-for-2d-object-detection/515/3 "2021-11-15T21:30:54Z")

</div>

Hi @quythao.truong  
Are there any examples of drawing the 2D mask on the screen instead of bounding boxes?

---

<div class="post-metadata">

**Author:** ![quythao.truong](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/q/c68b51/32.png) [@quythao.truong](https://community.stereolabs.com/u/quythao.truong)\
**Post date:** [November 16, 2021, 1:08pm UTC](https://community.stereolabs.com/t/where-have-code-sample-for-2d-object-detection/515/4 "2021-11-16T13:08:58Z")

</div>

Hi @ChealsieBains01, please check the answer in [this post](https://community.stereolabs.com/t/object-detection-example-drawing-2d-mask-over-image/673/2) 🙂
