DCF Tracker REFUSING to work while using low level library

**• x86_64 Ubuntu 18.04 **
**• Deepstream 5.0 **
**• 440.100 **
**• CUDA 10.2 **

Hey,

I’ve been trying for MONTHS to get the dcf tracker working with the low level library but it refuses to work. After I call the NVMOT_process, I get no tracked objects back.

I have created some sample code which show cases the problem. The sample code has the case of using the klt tracker and it successfully working. But when you compile using the “dcf” CMAKE flag, you can see that no tracked objects output. I’m 100% sure this is not a problem which the frame conversion. When using the working kcf tracker, if I give it a invalid / fully black frame, it will still give me tracked objects. For the DCF tracker, no matter what I do, I always get nothing.

If you look into the CMakeLists.txt file, you can switch between the kcf tracker and dcf tracker by changing the TRACKER_TYPE CMAKE variable.

Hello moezruo6,

Thanks for trying out DeepStream and NvDCF tracker. Just briefly looked at your main.cpp code.

From the following code, seems like you are feeding YUV image to NvDCF tracker. But, NvDCF tracker only supports NV12 and RGBA color space only. Please try RGBA first.

#ifdef DCF_TRACKER
            cv::cvtColor(image, image, cv::COLOR_BGR2YUV_IYUV);

Another thing that caught my eyes is that although you populate the cuda memory with the image data (like below), there’s no place to fill the metadata in _nvBufSurface->surfaceList

cudaMemcpy(_nvBufSurface->surfaceList->mappedAddr.addr[0], image.data,
                       _nvBufSurface->surfaceList->dataSize, cudaMemcpyHostToDevice);

Unfortunately, we currently don’t provide official guidelines for using NvDCF and KLT trackers outside of DeepStream.

@pshin I understand that it supports only NV12 and RGBA. I was writing an example that shows that whatever I put into the Tracker for DCF, I get NO results from it. I have changed the code to use RGBA and it still does not work. I have tried passing in frames of NV12 and RGBA to no avail. Here’s the updated code: https://drive.google.com/file/d/1K8wCu2iChB5F1ikryVq6Kjch6gTrIcjp/view?usp=sharing

For your second part:

Another thing that caught my eyes is that although you populate the cuda memory with the image data (like below), there’s no place to fill the metadata in _nvBufSurface->surfaceList.

What do you mean by this statement? _nvBufSurface is populated when I do NvBufSurfaceCreate. Here is what it looks like after the call. https://i.imgur.com/3OI0kEJ.png

We can also see that the model is successfully loaded into GPU. https://i.imgur.com/Pq18yLe.png

The same code works on the KCF Tracker as I mentioned above.

I can really use somebodys help at Nvidia to solve this problem. I have been stuck on this DCF problem since Deepstream 4.0 as shown from my post history. I find it kinda ridiculous that you offer up the low level library and have some information on it inside your DeepStream docs but then avoid providing any kind of support that does not use your gstreamer plugin. Is it really hard for somebody to run the test project using your debug libs and find the problem? It does not help that there’s not much logging.

1 Like

I am having a similar issue. I do not want to use gstreamer, but need the DCF tracker.

Please help Nvidia! :)

Hello moezruo6,

For the very first frame, it should be _nvFrame.reset = true; , afterwards set _nvFrame.reset = false;

I noticed _nvFrame.objectsIn.detectionDone = false; There is a difference in KLT and NvDCF in handling this flag. In KLT, it doesn’t check this flag, and if there’s bbox from detector, it will use it. But, NvDCF checks this flag. So, if you provide bbox to initialize the tracker, then you should set this _nvFrame.objectsIn.detectionDone = true; For example, if you run detector at every other frame, then this flag value should also alternate between true and false.
If you run detector at every frame (which is the case in your sample code), then this flag should always be true.

Please try and post your observation again.

1 Like

@pshin, After following your comments, they have fixed my issue! Thanks so much.

1 Like