# Deploying Custom segmentation model to deepstream-test5

**URL:** <https://forums.developer.nvidia.com/t/deploying-custom-segmentation-model-to-deepstream-test5/285285>\
**Category:** DeepStream SDK\
**Created:** [March 7, 2024, 3:53pm UTC](https://forums.developer.nvidia.com/t/deploying-custom-segmentation-model-to-deepstream-test5/285285 "2024-03-07T15:53:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![d.sowmiya86](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@d.sowmiya86](https://forums.developer.nvidia.com/u/d.sowmiya86)\
**Post date:** [March 7, 2024, 3:53pm UTC](https://forums.developer.nvidia.com/t/deploying-custom-segmentation-model-to-deepstream-test5/285285/1 "2024-03-07T15:53:41Z")

</div>

Please provide complete information as applicable to your setup.

**• Hardware Platform (Jetson / GPU)**:

nvidia-smi  
Thu Mar 7 20:21:59 2024  
±----------------------------------------------------------------------------+  
| NVIDIA-SMI 525.147.05 Driver Version: 525.147.05 CUDA Version: 12.0 |  
|-------------------------------±---------------------±---------------------+  
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |  
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |  
| | | MIG M. |  
|===============================+======================+======================|  
| 0 NVIDIA GeForce … Off | 00000000:01:00.0 Off | N/A |  
| N/A 44C P0 N/A / 80W | 6MiB / 6144MiB | 0% Default |  
| | | N/A |  
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+  
| Processes: |  
| GPU GI CI PID Type Process name GPU Memory |  
| ID ID Usage |  
|=============================================================================|  
| 0 N/A N/A 2904 G /usr/lib/xorg/Xorg 4MiB |  
±----------------------------------------------------------------------------+

**• DeepStream Version** :6.2

We had trained an custom Pytorch model using the below repository

> **[GitHub - milesial/Pytorch-UNet: PyTorch implementation of the U-Net for image...](https://github.com/milesial/Pytorch-UNet)**
>
> PyTorch implementation of the U-Net for image semantic segmentation with high quality images

We are able to successfully run the model and observe inference outputs using both `.pth` and `.onnx` formats outside of DeepStream. However, when we attempt to integrate the ONNX model with the DeepStream SDK 6.2 as the primary GIE in the `deepstream-test5-app`, although the ONNX to TensorRT engine conversion occurs without issues and the application runs, we do not see any inference results in the output. Additionally, when we enable the Kafka sink, the application fails. We would appreciate your support in resolving these issues to successfully port our model to the DeepStream test application. We have attached all the necessary files in the below link for you to replicate the scenario as well the the weight files.

> **[Google Drive: Sign-in](https://accounts.google.com/v3/signin/identifier?continue=https%3A%2F%2Fdrive.google.com%2Fdrive%2Ffolders%2F1r7tsLfhCrSmV5zss3RRlNt7LJ0BNwZ2h%3Fusp%3Ddrive_link&dsh=S789050272%3A1772898448290717&followup=https%3A%2F%2Fdrive.google.com%2Fdrive%2Ffolders%2F1r7tsLfhCrSmV5zss3RRlNt7LJ0BNwZ2h%3Fusp%3Ddrive_link&ifkv=ASfE1-o-Ied7L71WbasjvNIIRoVzdM_OQx2jU9J8G1XYzB_IFF34V1PznriSBqaYFiL0FH26SxwhvA&osid=1&passive=1209600&service=wise&flowName=GlifWebSignIn&flowEntry=ServiceLogin)**
>
> Access Google Drive with a Google account (for personal use) or Google Workspace account (for business use).

---

<div class="post-metadata">

**Author:** ![junshengy](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/junshengy/32/251332_2.png) [@junshengy](https://forums.developer.nvidia.com/u/junshengy)\
**Post date:** [March 11, 2024, 12:33pm UTC](https://forums.developer.nvidia.com/t/deploying-custom-segmentation-model-to-deepstream-test5/285285/3 "2024-03-11T12:33:09Z")

</div>

You can refer to the example below.

```auto
deepstream-segmentation-test

```

In addition, you can read the part about `NvDsInferSegmentationMeta` in the document.` nvinfer` will put the inference results into the metadata.  
[https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS\_plugin\_gst-nvinfer.html](https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvinfer.html)

---

<div class="post-metadata">

**Author:** ![junshengy](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/junshengy/32/251332_2.png) [@junshengy](https://forums.developer.nvidia.com/u/junshengy)\
**Post date:** [March 20, 2024, 1:30am UTC](https://forums.developer.nvidia.com/t/deploying-custom-segmentation-model-to-deepstream-test5/285285/4 "2024-03-20T01:30:52Z")

</div>

**There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks**

sorry for the long delay. If you want to use unet, here is an official sample for reference.

> <https://github.com/NVIDIA-AI-IOT/deepstream_tao_apps/blob/master/apps/tao_segmentation/deepstream_seg_app.c>

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [April 15, 2024, 6:48am UTC](https://forums.developer.nvidia.com/t/deploying-custom-segmentation-model-to-deepstream-test5/285285/5 "2024-04-15T06:48:02Z")

</div>

Closed on April 15, 2024, 6:48am UTC

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