# Trouble finding example material for the DNN functionality

**URL:** <https://forum.opencv.org/t/trouble-finding-example-material-for-the-dnn-functionality/6750>\
**Category:** Python\
**Tags:** dnn, yolov5\
**Created:** [December 15, 2021, 11:15am UTC](https://forum.opencv.org/t/trouble-finding-example-material-for-the-dnn-functionality/6750 "2021-12-15T11:15:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![EyemationNiels](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@EyemationNiels](https://forum.opencv.org/u/EyemationNiels)\
**Post date:** [December 15, 2021, 11:15am UTC](https://forum.opencv.org/t/trouble-finding-example-material-for-the-dnn-functionality/6750/1 "2021-12-15T11:15:31Z")

</div>

Good day to whichever beautiful person is reading this.  
I’m currently working on a project with which i would like to identify different sorts of Dutch fryable snacks. I have trained myself a yolov5 model, which i can convert to the .onnx format, or the .pb format. Only thing is, i’m having a lot of trouble finding example material and understandable information on how to properly implement the model into OpenCV. I have already checked the [documentation](https://docs.opencv.org/4.x/dc/d70/pytorch_cls_tutorial_dnn_conversion.html) but i’m still having difficulty getting it up and running. I’m wondering if anyone here has some good examples available, or another source of information which i could use. Thank you for reading and have a good day.

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [December 15, 2021, 3:42pm UTC](https://forum.opencv.org/t/trouble-finding-example-material-for-the-dnn-functionality/6750/2 "2021-12-15T15:42:15Z")

</div>

> [@EyemationNiels](#):
>
> i’m having a lot of trouble finding example material and understandable information on how to properly implement the model into OpenCV. I

that’s no wonder it only _works_ since a few weeks,  
so make sure to use latest code for all this.

assuming , you did

```
git clone https://github.com/ultralytics/yolov5
cd yolov5

... train your model ...

```

you can export it to onnx using:

```
python export.py --weights yolov5s.pt --img 640 --opset 12 --include onnx

```

(opset version seems crucial !)

unfortunately, the result parsing differs _a lot_ from v3 or v4, and so far, we only have a working c++ example code here (at least, give it a star, please !):

> **[GitHub - UNeedCryDear/yolov5-opencv-dnn-cpp: 使用opencv模块部署yolov5-6.0版本](https://github.com/UNeedCryDear/yolov5-opencv-dnn-cpp)**
>
> 使用opencv模块部署yolov5-6.0版本. Contribute to UNeedCryDear/yolov5-opencv-dnn-cpp development by creating an account on GitHub.

hopefully someone will port it to python soon, gl in the meantime…

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [December 16, 2021, 5:41pm UTC](https://forum.opencv.org/t/trouble-finding-example-material-for-the-dnn-functionality/6750/3 "2021-12-16T17:41:47Z")

</div>

update: python example:

> <https://gist.github.com/berak/245691f62622f5f2cc0abe8da25cbaa9>
