AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.66k stars 7.96k forks source link

Can somone throw some light how theoretically YOLO and optical flow are used together #2291

Open buzdarbalooch opened 5 years ago

buzdarbalooch commented 5 years ago

@AlexeyAB .if you can kindly give some explanation it would be so nice of you.

buzdarbalooch commented 5 years ago

@AlexeyAB . sir reply from you shall be really appreciable

AlexeyAB commented 5 years ago

@buzdarbalooch

For example you have video stream from camera 1920x1080 30fps

  1. This code captures frames 1920x1080 with speed 30fps - 33ms per frame https://github.com/AlexeyAB/darknet/blob/master/src/yolo_console_dll.cpp

  2. Yolo detects objects on resized frames to 416x416 with speed 10 fps (detect only for each 3rd frame - 100ms per frame)

  3. Once Yolo have detected objects, we know that these detected objects are from current_frame-2, because detection lasted a long time - 100ms per frame. So we should get 2 frames from our buffer with old frames (current_frame-2 and current_frame-1), and do Tracking (optical flow): current_frame-2->current_frame-1 then current_frame-1->current_frame - now we know where are objects on the current_frame. It is fast, because Tracking using optical flow can achive more than >500 fps - <2ms per frame.

  4. Then we Track (optical flow) objects on images 1920x1080 or each frame (all 30fps) until Yolo do new detection

After each Yolo-detection we can

buzdarbalooch commented 5 years ago

thank you soo much. Anothr important question.

I actually made some video approximately 4 mins, then annotated it with the objects present in the video . Now for that video it detects cr, hp_slots as you have seen before. My question is if i want to enlarge the dataset with similar videos. How can i do that. ? How can i enlarge the similar system which is working. Secondly, without adding videos can i just add random pics of cars to enlarge the system.

AlexeyAB commented 5 years ago

@buzdarbalooch

Do you want to increase dataset, and continue training with larger dataset?

Just grab frames from video: https://github.com/AlexeyAB/Yolo_mark ./yolo_mark x64/Release/data/img cap_video test.mp4 10

/darknet detector train cfg/obj.data yolov3_obj.cfg yolov3_obj_10000.weights

buzdarbalooch commented 5 years ago

I want to continue traning with larger dataset. if i have to take some new dataset which contains same classes of objects can't i just merge the two dataset, the one already trained and the new one.

so the train_old.txt + train_new.txt i just simple merge them in a single file. Q is how i can utlize the weights whch already exist, for the model i trained on the previous images. or i have to start the training from the scrath.

buzdarbalooch commented 5 years ago

But instead of YOLO_MARK , i can use other tools such as LabelImg

AlexeyAB commented 5 years ago

Q is how i can utlize the weights whch already exist, for the model i trained on the previous images. or i have to start the training from the scrath.

If you train for the same classes and the same number of classes then just train /darknet detector train cfg/obj.data yolov3_obj_new.cfg yolov3_obj_previous.weights -clear

iraadit commented 5 years ago

What is exactly the purpose of -clear?

AlexeyAB commented 5 years ago

@iraadit -clear just resets interation number in the weights-file