# detectnet-camera: using custom trained model

**URL:** <https://forums.developer.nvidia.com/t/detectnet-camera-using-custom-trained-model/111816>\
**Category:** Jetson Nano\
**Created:** [February 11, 2020, 3:02pm UTC](https://forums.developer.nvidia.com/t/detectnet-camera-using-custom-trained-model/111816 "2020-02-11T15:02:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shankarprasad\_hm](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@shankarprasad\_hm](https://forums.developer.nvidia.com/u/shankarprasad_hm)\
**Post date:** [February 11, 2020, 3:02pm UTC](https://forums.developer.nvidia.com/t/detectnet-camera-using-custom-trained-model/111816/1 "2020-02-11T15:02:55Z")

</div>

Hi,

I want to use my own custom trained model with detectnet-camera.py code. Please provide me complete details on how to do this.

Currently the detecnet-camera.py is by default referring to “SSD-Mobilenet-v2” network.

1. How and where to change this to another model (for eg:- googlenet). In detectnet-camera.py, if I change the below line to “googlenet” , still it is referring to “SSD-Mobilenet-v2”.  
net = jetson.inference.detectNet(“googlenet”, sys.argv, opt.threshold)

2. I have created my customized training model of cat\_dog and this has generated the “resnet18.onnx” .  
I need to use this as the training model in detectnet-camera instead of “SSD-Mobilenet-v2”. let me know how to do this?

Regards,  
Shankar

---

<div class="post-metadata">

**Author:** ![dusty\_nv](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dusty_nv/32/14043_2.png) [@dusty\_nv](https://forums.developer.nvidia.com/u/dusty_nv)\
**Post date:** [February 11, 2020, 6:17pm UTC](https://forums.developer.nvidia.com/t/detectnet-camera-using-custom-trained-model/111816/2 "2020-02-11T18:17:50Z")

</div>

Hi Shankar, googlenet and resnet18 are image classification networks and not object detection networks, so they should be used with imagenet-console/imagenet-camera.

See these commands for loading custom model with imagenet-console and imagenet-camera:

[https://github.com/dusty-nv/jetson-inference/blob/master/docs/pytorch-cat-dog.md#processing-images-with-tensorrt](https://github.com/dusty-nv/jetson-inference/blob/master/docs/pytorch-cat-dog.md#processing-images-with-tensorrt)  
[https://github.com/dusty-nv/jetson-inference/blob/master/docs/pytorch-cat-dog.md#running-the-live-camera-program](https://github.com/dusty-nv/jetson-inference/blob/master/docs/pytorch-cat-dog.md#running-the-live-camera-program)

---

<div class="post-metadata">

**Author:** ![shankarprasad\_hm](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@shankarprasad\_hm](https://forums.developer.nvidia.com/u/shankarprasad_hm)\
**Post date:** [February 12, 2020, 2:33am UTC](https://forums.developer.nvidia.com/t/detectnet-camera-using-custom-trained-model/111816/3 "2020-02-12T02:33:04Z")

</div>

Hi Dusty,

Got it. The classification networks cannot be used for detection networks. Thank you.

If I need to use the different network model for object detection, How and where to change?

For custom detection network model: Should I use the below reference for generating custom detection network?

> **[Nvidia Jetson Nano: Custom Object Detection from scratch using Tensorflow and...](https://medium.com/swlh/nvidia-jetson-nano-custom-object-detection-from-scratch-using-tensorflow-and-opencv-113fe4dba134)**
>
> The purpose of this blog is to guide users on the creation of a custom object detection model with performance optimization to be used on…

Please provide details for generating the custom detection networks and instructions on using it with detectnet-camera.py.

Regards,  
Shankar

---

<div class="post-metadata">

**Author:** ![dusty\_nv](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dusty_nv/32/14043_2.png) [@dusty\_nv](https://forums.developer.nvidia.com/u/dusty_nv)\
**Post date:** [February 12, 2020, 3:35pm UTC](https://forums.developer.nvidia.com/t/detectnet-camera-using-custom-trained-model/111816/4 "2020-02-12T15:35:48Z")

</div>

Hi Shankar, that post is a good starting point, and if you wanted to convert your re-trained SSD model to TensorRT, see some of the other resources listed in this post: [https://devtalk.nvidia.com/default/topic/1070225/jetson-nano/digits-or-somthing-else/post/5421938/#5421938](https://devtalk.nvidia.com/default/topic/1070225/jetson-nano/digits-or-somthing-else/post/5421938/#5421938)

---

<div class="post-metadata">

**Author:** ![nadeemm](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nadeemm/32/367020_2.png) [@nadeemm](https://forums.developer.nvidia.com/u/nadeemm)\
**Post date:** [October 14, 2021, 11:54pm UTC](https://forums.developer.nvidia.com/t/detectnet-camera-using-custom-trained-model/111816/5 "2021-10-14T23:54:31Z")

</div>

Closed on October 14, 2021, 11:54pm UTC


