# How to customize nvinfer part of deepstream to process custom data

**URL:** <https://forums.developer.nvidia.com/t/how-to-customize-nvinfer-part-of-deepstream-to-process-custom-data/158438>\
**Category:** DeepStream SDK\
**Created:** [October 31, 2020, 10:24pm UTC](https://forums.developer.nvidia.com/t/how-to-customize-nvinfer-part-of-deepstream-to-process-custom-data/158438 "2020-10-31T22:24:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MediaJ](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@MediaJ](https://forums.developer.nvidia.com/u/MediaJ)\
**Post date:** [October 31, 2020, 10:24pm UTC](https://forums.developer.nvidia.com/t/how-to-customize-nvinfer-part-of-deepstream-to-process-custom-data/158438/1 "2020-10-31T22:24:01Z")

</div>

Hi all.  
I’m running a pipeline using deepstream-5.0 (on GPU) to inference on a video using a tlt object detection model.  
I want to customize the inference part of it. In detail, I want to split each input frame into 4 parts and then give each part to the inference for detection. Since I use nvinfer, so I think, I should change the nvdsinfer\_contex\_impl.cpp file.  
In this c++ file, I found a function named “NvDsInferStatus InferPreprocessor::transform()”, so we should change this function.  
**My question is:**  
If I split each frame into 4 parts in this code, then how should I send these parts to the detection model to perform detection on each one separately (in the function)? Do they need to be written in a specific buffer?  
(In fact, in this function after splitting each frame what is the next step?)

---

<div class="post-metadata">

**Author:** ![Amycao](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/amycao/32/11342_2.png) [@Amycao](https://forums.developer.nvidia.com/u/Amycao)\
**Post date:** [November 3, 2020, 6:28am UTC](https://forums.developer.nvidia.com/t/how-to-customize-nvinfer-part-of-deepstream-to-process-custom-data/158438/3 "2020-11-03T06:28:03Z")

</div>

Hi,  
Sorry for a late reply.  
transform does normalization and mean image subtraction and copy converted batch to the input binding buffer, I do not think you can split original frame here. even you can split the frame here, how about the infer result, since you have 3 more frames after split into 4 parts, but you just have one buffer to store frame information and object meta data.

---

<div class="post-metadata">

**Author:** ![MediaJ](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@MediaJ](https://forums.developer.nvidia.com/u/MediaJ)\
**Post date:** [November 5, 2020, 11:53am UTC](https://forums.developer.nvidia.com/t/how-to-customize-nvinfer-part-of-deepstream-to-process-custom-data/158438/4 "2020-11-05T11:53:34Z")

</div>

@Amycao, thanks for the reply, ok I will find another solution.

---

<div class="post-metadata">

**Author:** ![MediaJ](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@MediaJ](https://forums.developer.nvidia.com/u/MediaJ)\
**Post date:** [November 5, 2020, 1:47pm UTC](https://forums.developer.nvidia.com/t/how-to-customize-nvinfer-part-of-deepstream-to-process-custom-data/158438/5 "2020-11-05T13:47:42Z")

</div>

Ok I found another solution and I created a new topic for that solution, could you help me @Amycao, I would appreciate your help.

the topic is (in this topic I removed the crop part of frame):

# [How to set the order of tee and nvstreammux to duplicate a video file, before nvinfer in deepstream pipeline](https://forums.developer.nvidia.com/t/how-to-set-the-order-of-tee-and-nvstreammux-to-duplicate-a-video-file-before-nvinfer-in-deepstream-pipeline/158861)

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 12, 2021, 4:16pm UTC](https://forums.developer.nvidia.com/t/how-to-customize-nvinfer-part-of-deepstream-to-process-custom-data/158438/7 "2021-10-12T16:16:04Z")

</div>


