Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the different between Darknet here and the official one? #529

Closed
XP-CHRC opened this issue Mar 29, 2018 · 9 comments
Closed

What's the different between Darknet here and the official one? #529

XP-CHRC opened this issue Mar 29, 2018 · 9 comments

Comments

@XP-CHRC
Copy link

XP-CHRC commented Mar 29, 2018

Hi,everyone, I run the same yolov2-tiny.cfg and yolov2-tiny.weights in the same device(jetson tx2), but the darknet download here is faster than the official one. So what's the difference between them?
Thanks.

@XP-CHRC XP-CHRC changed the title What's the different between yours Darknet and offical's? What's the different between Darknet here and the official one? Mar 29, 2018
@AlexeyAB
Copy link
Owner

AlexeyAB commented Mar 29, 2018

Hi,

Did you use ./darknet detector demo... command?

There are many changes such as:

  • added support for Windows
  • improved binary neural network performance 2x-4x times for Detection on CPU and GPU if you trained your own weights by using this XNOR-net model (bit-1 inference) : https://github.com/AlexeyAB/darknet/blob/master/cfg/yolov3-tiny_xnor.cfg
  • improved neural network performance ~7% by fusing 2 layers into 1: Convolutional + Batch-norm
  • improved neural network performance Detection 3x times, Training 2 x times on GPU Volta (Tesla V100, Titan V, ...) using Tensor Cores if CUDNN_HALF defined in the Makefile or darknet.sln
  • improved performance ~1.2x times on FullHD, ~2x times on 4K, for detection on the video (file/stream) using darknet detector demo...
  • improved performance 3.5 X times of data augmentation for training (using OpenCV SSE/AVX functions instead of hand-written functions) - removes bottleneck for training on multi-GPU or GPU Volta
  • improved performance of detection and training on Intel CPU with AVX (Yolo v3 ~85%, Yolo v2 ~10%)
  • fixed usage of [reorg]-layer
  • optimized memory allocation during network resizing when random=1
  • optimized initialization GPU for detection - we use batch=1 initially instead of re-init with batch=1
  • added correct calculation of mAP, F1, IoU, Precision-Recall using command darknet detector map...
  • added drawing of chart of average loss during training
  • added calculation of anchors for training
  • added example of Detection and Tracking objects: https://github.com/AlexeyAB/darknet/blob/master/src/yolo_console_dll.cpp
  • fixed code for use Web-cam on OpenCV 3.x
  • run-time tips and warnings if you use incorrect cfg-file or dataset
  • many other fixes of code...

And added manual How to train yolo.

@RushNuts
Copy link

How much fps on tx2?

@XP-CHRC
Copy link
Author

XP-CHRC commented Mar 29, 2018

@AlexeyAB yes, i used ./darknet detector demo... command, and i want to know what make the demo faster here than the official one? Did you implement some optimization tricks?
thanks for your reply,you are so 牛逼!

@XP-CHRC
Copy link
Author

XP-CHRC commented Mar 29, 2018

@RushNuts 416*416 About 15fps, less than 20, without any optimizations. and what's more the speed depend on the quality of the video , i don't know why?

@AlexeyAB
Copy link
Owner

@XP-CHRC

15 fps on TX2 using this fork?
And how much fps on TX2 using original fork for yolov2-tiny.cfg?

There is optimization in resizing video frame to the network size, I just use OpenCV implementation cvResize() instead of hand-written implementation - it was a bottleneck - perfomance depends on initial resolution of video:

darknet/src/demo.c

Lines 64 to 65 in d0039f6

//in = get_image_from_stream(cap);
in = get_image_from_stream_resize(cap, net.w, net.h, &in_img, use_webcam);

cvResize(src, new_img, CV_INTER_LINEAR);

@gangyahaidao
Copy link

this darknet is faster, it's true! Then i am confused, Why don't official projects adopt this project's advantages?
A Great Job, Thanks @AlexeyAB

@XP-CHRC
Copy link
Author

XP-CHRC commented Mar 30, 2018

@AlexeyAB Input size: 416*416, about 10fps on tx2 when use the original fork for yolov2-tiny.cfg.
thanks for your jobs and reply.

@RushNuts
Copy link

@XP-CHRC Oh, 15fps. Not bad. What's resolution your input video?

@XP-CHRC
Copy link
Author

XP-CHRC commented Mar 30, 2018

@RushNuts 416*416

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants