Darknet: help needed!

Created on 7 Jan 2019  路  13Comments  路  Source: AlexeyAB/darknet

Where can I get the deep features from an image so that I can give these features directly to tracking algorithm to track objects in a video (as yolov3 runs on real-time)
please help I really tired understanding the code but the deep features part is still left unclear for me

ps: we have GPU for real-time object detection

question want enhancement

Most helpful comment

@AlexeyAB I use SORT algorithm for tracking
basically what I am trying to do is
combine YOLO with SORT algorithm(https://arxiv.org/abs/1602.00763) for real-time detection and tracking.
DEEP SORT (https://arxiv.org/pdf/1703.07402.pdf) was a better option but I want to replace the appearance Descriptor of the deep sort and instead use YOLOs descriptor to track people.
it's my birthday tomorrow, I'm more excited about this reply than my birthday!

All 13 comments

You can un-comment these lines to see windows with output features-map for Each channel for Each layer: https://github.com/AlexeyAB/darknet/blob/fd0df9297c86a272f0bf0841291bc4565e90a7cd/src/network_kernels.cu#L71-L88

So change this code to send this arrays to your Tracking algorithm.
What tracking algo do you use?

I have the similar problem,
supposing we've trained one classification model on many algined face images,
how to get the feature vector for embedding when feeding a new algined face image into network?
then calculate the distance or similarity between two feature vectors .

@AlexeyAB I use SORT algorithm for tracking
basically what I am trying to do is
combine YOLO with SORT algorithm(https://arxiv.org/abs/1602.00763) for real-time detection and tracking.
DEEP SORT (https://arxiv.org/pdf/1703.07402.pdf) was a better option but I want to replace the appearance Descriptor of the deep sort and instead use YOLOs descriptor to track people.
it's my birthday tomorrow, I'm more excited about this reply than my birthday!

@AlexeyAB can you please help me out find a way through this?

@AlexeyAB feature vector from which layer to be used for tracking?

@AlexeyAB After uncommenting the lines mentioned
i executed make
1) there were no changes
vvk@vvk-Lenovo-ideapad-310-15IKB:darknet-master$ make
chmod +x *.sh
vvk@vvk-Lenovo-ideapad-310-15IKB:darknet-master$
2) unable to see windows with output features-map for Each channel for Each layer.
only predicted image is being displayed

@VellalaVineethKumar

After uncommenting the lines mentioned
i executed make
there were no changes

  • Can you show screenshot of your code?
  • Did you compile Darknet with OPENCV=1 in the Makefile?
  • Try to do
make clean
make

@AlexeyAB
1)
screenshot from 2019-01-23 20-46-15

2)
my Make file
GPU=0
CUDNN=0
CUDNN_HALF=0
OPENCV=1
AVX=1
OPENMP=1
LIBSO=0
no errors after executing make
3) Yes i tried doing make clean and then run make again
No errors encountered
but when i run the command
./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg

i get the image with bounding boxes and nothing else

@VellalaVineethKumar

These changes will be applied only when you compile with GPU=1.
Do you have nVidia GPU?

If not, then you should add here between these lines: https://github.com/AlexeyAB/darknet/blob/29aa716bd92fbb05b96ea26ab920d7975a00d7ff/src/network.c#L209-L210

something like this:

        if (l.out_w >= 0 && l.out_h >= 1 && l.c >= 3) {
            int j;
            for (j = 0; j < l.out_c; ++j) {
                image img = make_image(l.out_w, l.out_h, 3);
                memcpy(img.data, l.output + l.out_w*l.out_h*j, l.out_w*l.out_h * 1 * sizeof(float));
                memcpy(img.data + l.out_w*l.out_h * 1, l.output + l.out_w*l.out_h*j, l.out_w*l.out_h * 1 * sizeof(float));
                memcpy(img.data + l.out_w*l.out_h * 2, l.output + l.out_w*l.out_h*j, l.out_w*l.out_h * 1 * sizeof(float));
                char buff[256];
                sprintf(buff, "layer-%d slice-%d", i, j);
                show_image(img, buff);
                save_image(img, buff);
            }
            cvWaitKey(0); // wait press-key in console
            cvDestroyAllWindows();
        }

@AlexeyAB Yea! it worked for me thank you

@VellalaVineethKumar What language are you using to implement SORT/DEEP_SORT?
Python like https://github.com/abewley/sort https://github.com/nwojke/deep_sort OR C/C++ ?
I'm new for this, and I don't know whether it's ok to use Python to implement SORT/DEEP_SORT then call functions from darknet DLL for detecting work, thank you very very very much.

@WhoIAmm
Hi,
i use python implementation of SORT and DEEP Sort.
if you want call tracking script from darknet then use this repository
https://github.com/Qidian213/deep_sort_yolov3

@VellalaVineethKumar ok, I'll try, thank you a lot.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jasleen137 picture jasleen137  路  3Comments

rezaabdullah picture rezaabdullah  路  3Comments

zihaozhang9 picture zihaozhang9  路  3Comments

Mididou picture Mididou  路  3Comments

yongcong1415 picture yongcong1415  路  3Comments