Convolutional Neural Networks

Overview

Darknet Logo

Darknet

Darknet is an open source neural network framework written in C and CUDA. It is fast, easy to install, and supports CPU and GPU computation.

Discord invite link for for communication and questions: https://discord.gg/zSq8rtW

Scaled-YOLOv4:

YOLOv4:

For more information see the Darknet project website.

For questions or issues please use the Google Group.

scaled_yolov4 AP50:95 - FPS (Tesla V100) Paper: https://arxiv.org/abs/2011.08036


YOLOv4Tiny


YOLOv4


OpenCV_TRT

Citation

@misc{bochkovskiy2020yolov4,
      title={YOLOv4: Optimal Speed and Accuracy of Object Detection}, 
      author={Alexey Bochkovskiy and Chien-Yao Wang and Hong-Yuan Mark Liao},
      year={2020},
      eprint={2004.10934},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}
@InProceedings{Wang_2021_CVPR,
    author    = {Wang, Chien-Yao and Bochkovskiy, Alexey and Liao, Hong-Yuan Mark},
    title     = {{Scaled-YOLOv4}: Scaling Cross Stage Partial Network},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2021},
    pages     = {13029-13038}
}
Comments
  • Run YoloV3 detections on thousands of images and save outputs?

    Run YoloV3 detections on thousands of images and save outputs?

    I've only figured out how to run detections on one image at a time, typing a new image filename each time. Is there any build-in way to run on an entire folder of images and save images with predictions to another folder?

    opened by austinmw 119
  • Darknet Python IMAGE object

    Darknet Python IMAGE object

    Hi,

    I'm trying to forward the feed of a webcam to YOLO in python. My problem is that I capture the images from OpenCV but i don't know how to transform them to an IMAGE object in order to perform the .network_detect() Could you please throw some insight on this matter?

    Thank you!

    opened by FranciscoGomez90 56
  • rnn: ./src/cuda.c:36: check_error: Assertion `0' failed.

    rnn: ./src/cuda.c:36: check_error: Assertion `0' failed.

    I'm running cuda8.0 on Ubuntu16.04LTS.

    root@29c797bc416c:~/darknet# ./darknet rnn train cfg/rnn.train.cfg -file ./t8.shakespeare.txt 
    rnn
    layer     filters    size              input                output
        0 RNN Layer: 256 inputs, 1024 outputs
    		CUDA Error: out of memory
    darknet: ./src/cuda.c:36: check_error: Assertion `0' failed.
    Aborted (core dumped)
    root@29c797bc416c:~/darknet# nvidia-smi
    Fri Jul 21 14:11:16 2017       
    +-----------------------------------------------------------------------------+
    | NVIDIA-SMI 367.57                 Driver Version: 367.57                    |
    |-------------------------------+----------------------+----------------------+
    | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
    | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
    |===============================+======================+======================|
    |   0  GRID K520           Off  | 0000:00:03.0     Off |                  N/A |
    | N/A   62C    P0   104W / 125W |   3554MiB /  4036MiB |     92%      Default |
    +-------------------------------+----------------------+----------------------+
                                                                                   
    +-----------------------------------------------------------------------------+
    | Processes:                                                       GPU Memory |
    |  GPU       PID  Type  Process name                               Usage      |
    |=============================================================================|
    +-----------------------------------------------------------------------------+
    
    opened by loretoparisi 45
  • failing to compile with GPU=1

    failing to compile with GPU=1

    Started playing with your project after catching the ted talk, very cool project. I've gotten it to compile with GPU=0, however When setting GPU=1 I get the following error.

    /usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’:
    /usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
       return (char *) memcpy (__dest, __src, __n) + __n;
                                              ^
    compilation terminated due to -Wfatal-errors.
    Makefile:88: recipe for target 'obj/convolutional_kernels.o' failed
    make: *** [obj/convolutional_kernels.o] Error 1
    

    I'll keep tinkering and see if I can't figure it out just thought it might be worth reporting.

    opened by zacbayhan 32
  • ./src/image_opencv.cpp:5:10: fatal error: opencv2/opencv.hpp: No such file or directory

    ./src/image_opencv.cpp:5:10: fatal error: opencv2/opencv.hpp: No such file or directory

    rico@deadsecuritylab:~/Desktop/darknet$ make g++ -Iinclude/ -Isrc/ -DOPENCV pkg-config --cflags opencv -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -c ./src/image_opencv.cpp -o obj/image_opencv.o Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found ./src/image_opencv.cpp:5:10: fatal error: opencv2/opencv.hpp: No such file or directory 5 | #include "opencv2/opencv.hpp" | ^~~~~~~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:86: obj/image_opencv.o] Error 1

    opened by Liquid72 26
  • Unable to understand how to train classifier with our own dataset?

    Unable to understand how to train classifier with our own dataset?

    Hey, I'm trying to train a classifier model in Darknet with my own dataset, consists of 4 class data. Though i found a cifar classification example in darknet, but i am unable to find in what format i should provide my data (renaming is required i guess, with classname at end?). or just tell me how should i proceed farther to use my dataset for a classifier specifying the classes that i want. I have followed this https://pjreddie.com/darknet/train-cifar/ link but still not clear how the classifier finds the class information. Please help me in this regards. Thanks in advance.

    opened by LolikaPadmanbhan 26
  • Saving image using python wrapper

    Saving image using python wrapper

    I am fairly new in using YOLO. I was wondering which function could I call to save an image from the darknet.py file found in /python directory. I would like to specify a manual location to save the detected image(containing detected markings).

    I have looked at various function in .c files, but was unable to pinpoint the respective function. Although, I tried calling save_image(im) but I need to pass the detected image.

    Any suggestions would be of great help!

    opened by ishansan 26
  • Weights only save every 100 iterations until 900, then saves every 10,000

    Weights only save every 100 iterations until 900, then saves every 10,000

    Hello,

    I am training YOLO on the COCO dataset and I have noticed that the weights only save in increments of 100 until iteration 900. After iteration 900, the next set of saved weights is at iteration 10,000, then 20,000 after that.

    Is there a way to change how often weights are saved to $DARKNET_ROOT/backup? I would request there be a variable in cfg/yolo.cfg that allows the user to choose how often weights are saved to backup.

    opened by allendorf 24
  • what is bad.list used for?

    what is bad.list used for?

    I am trying to train yolo on my custom dataset. However, the final predictions.jpg file is always empty for me.

    • There is file in my root folder called bad.list, that contains thousands of entries such as:

    data/labels/32_0.png data/labels/33_0.png data/labels/34_0.png data/labels/35_0.png ...

    • At the time of prediction, I get similar errors:

    Cannot load image "data/labels/32_0.png" Cannot load image "data/labels/33_0.png" Cannot load image "data/labels/34_0.png" Cannot load image "data/labels/35_0.png" Cannot load image "data/labels/36_0.png" ...

    These png images are not part of my training dataset and do not exist in any configuration file. I'm guessing this is might be the reason why my predictions are empty with no bounding box around the desired object(?).

    Could anybody please throw some light on this.

    opened by reachsumit 22
  • Can darknet detector demo use multiple GPUs?

    Can darknet detector demo use multiple GPUs?

    Can darknet detector demo use multiple GPUs?

    -gpus doesn't seem to kick off a 2nd process on the 2nd GPU.

    $ ./darknet detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights Delhi.mkv -gpus 0,1
    

    ...

    +-----------------------------------------------------------------------------+
    | NVIDIA-SMI 390.46                 Driver Version: 390.46                    |
    |-------------------------------+----------------------+----------------------+
    | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
    | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
    |===============================+======================+======================|
    |   0  Tesla M60           Off  | 00003DB5:00:00.0 Off |                  Off |
    | N/A   54C    P0   135W / 150W |   1450MiB /  8129MiB |     89%      Default |
    +-------------------------------+----------------------+----------------------+
    |   1  Tesla M60           Off  | 000057C7:00:00.0 Off |                  Off |
    | N/A   40C    P8    14W / 150W |     11MiB /  8129MiB |      0%      Default |
    +-------------------------------+----------------------+----------------------+
    
    +-----------------------------------------------------------------------------+
    | Processes:                                                       GPU Memory |
    |  GPU       PID   Type   Process name                             Usage      |
    |=============================================================================|
    |    0     15257      C   ./darknet                                   1439MiB |
    +-----------------------------------------------------------------------------+
    

    Is multi-GPU support just for training?

    opened by snobu 19
  • Error on make: 'cuda_runtime.h: No such file or directory'

    Error on make: 'cuda_runtime.h: No such file or directory'

    Getting this error despite having CUDA 8 installed w/ CUDNN and OpenCV 3.2.0:

    gcc -Iinclude/ -Isrc/ -DOPENCV pkg-config --cflags opencv -DGPU -I/usr/local/cuda/include/ -DCUDNN -Wall -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -c ./src/gemm.c -o obj/gemm.o In file included from ./src/utils.h:5:0, from ./src/gemm.c:2: include/darknet.h:14:30: fatal error: cuda_runtime.h: No such file or directory compilation terminated. Makefile:87: recipe for target 'obj/gemm.o' failed make: *** [obj/gemm.o] Error 1

    Where is that file supposed to be? Thanks!

    opened by brandonjabr 19
  • are you on Linux? maybe permissions issue?

    are you on Linux? maybe permissions issue?

        are you on Linux? maybe permissions issue?
    

    Originally posted by @robisen1 in https://github.com/pjreddie/darknet/issues/2087#issuecomment-606192206

    opened by Rakesh20bci7051 0
  • Training YOLOV3 on VOC-Train The Model

    Training YOLOV3 on VOC-Train The Model

    Loaded: 0.000050 seconds Region 82 Avg IOU: nan, Class: nan, Obj: nan, No Obj: nan, .5R: 0.000000, .75R: 0.000000, count: 2 Region 94 Avg IOU: -nan, Class: -nan, Obj: -nan, No Obj: nan, .5R: -nan, .75R: -nan, count: 0 Region 106 Avg IOU: -nan, Class: -nan, Obj: -nan, No Obj: nan, .5R: -nan, .75R: -nan, count: 0 50198: -nan, -nan avg, 0.000010 rate, 0.144766 seconds, 50198 images Loaded: 0.000050 seconds Region 82 Avg IOU: -nan, Class: -nan, Obj: -nan, No Obj: nan, .5R: -nan, .75R: -nan, count: 0 Region 94 Avg IOU: nan, Class: nan, Obj: nan, No Obj: nan, .5R: 0.000000, .75R: 0.000000, count: 1 Region 106 Avg IOU: -nan, Class: -nan, Obj: -nan, No Obj: nan, .5R: -nan, .75R: -nan, count: 0 50199: -nan, -nan avg, 0.000010 rate, 0.143455 seconds, 50199 images Loaded: 0.000073 seconds Region 82 Avg IOU: nan, Class: nan, Obj: nan, No Obj: nan, .5R: 0.000000, .75R: 0.000000, count: 1 Region 94 Avg IOU: -nan, Class: -nan, Obj: -nan, No Obj: nan, .5R: -nan, .75R: -nan, count: 0 Region 106 Avg IOU: -nan, Class: -nan, Obj: -nan, No Obj: nan, .5R: -nan, .75R: -nan, count: 0 50200: -nan, -nan avg, 0.000010 rate, 0.141549 seconds, 50200 images Saving weights to backup/yolov3-voc.backup Saving weights to backup/yolov3-voc_final.weights

    opened by Jie-fafa 0
  • ELAN - Designing Network Design Strategies Through Gradient Path Analysis

    ELAN - Designing Network Design Strategies Through Gradient Path Analysis

    Designing Network Design Strategies Through Gradient Path Analysis: https://arxiv.org/abs/2211.04800

    ELAN network is +1.9% AP more accurate and faster than YOLOR Object Detector.

    FiDLUcYWQAE0XQZ


    While YOLOR was the best on COCO dataset and Waymo self-driving dataset in speed/accuracy even 1 year after release: https://waymo.com/open/challenges/2021/real-time-2d-prediction/

    YOLOR: https://arxiv.org/abs/2105.04206 YOLOR on Waymo: https://arxiv.org/abs/2106.08713

    image

    opened by AlexeyAB 0
  • A problem about the performance of yolov1 to v3 on voc dataset

    A problem about the performance of yolov1 to v3 on voc dataset

    Hello, Joseph Redmon. I recently trained v1, v2 and v3 separately on the voc2007+2012 training dataset using darknet. Later, map was detected on the 2007 testing dataset, but the result was beyond my expectation: on the premise of using the pre-training model provided by the website(https://pjreddie.com/), v1 reached nearly 85% map, but the mAP of v2 and v3 were 74% and 69% respectively, both of which were lower than v1. This made me very confused and curious. For v1, I use: ./darknet yolo train cfg/yolov1/yolo.train.cfg extraction.conv.weights For v2, I use: ./darknet detector train cfg/voc.data cfg/yolov2-voc.cfg darknet19_448.conv.23 For v3, I use: ./darknet detector train cfg/voc.data cfg/yolov3-voc.cfg darknet53.conv.74 For mAP test, I use: ./darknet detector map cfg/voc.data cfg/yolov1.cfg yolo_v1_final.weights ./darknet detector map cfg/voc.data cfg/yolov2-voc.cfg yolo_v2_final.weights ./darknet detector map cfg/voc.data cfg/yolov3-voc.cfg yolo_v3_final.weights Can you give me some suggestions? Regards

    opened by xyghbrc 0
  • What is correct way to draw Bounding Box?

    What is correct way to draw Bounding Box?

    Hello, Joseph Redmon.

    I'd love to hear from the original developer how to draw the correct bounding box for OCR object detection. I'm arguing with someone who says the correct way to recognize an object is to draw a perfectly tight bounding box that does not differ even by 1px from the object's outline. In my common sense, to solve problems such as overfitting, it is necessary to hit the Bounding Box with some margin around the object to some extent. We would like to hear the correct answer to this debate from you, the original AI engine developer.

    Attachments are an example, and the argument is that you should never set the margin of the bounding box as wide as the 8 or Waterlevel Scale in the picture. Is this the wrong way to lower the recognition rate for 8 or Waterlevel Scale?

    We would like to hear the correct answer to this debate from you, the original YOLO Darknet AI engine developer.

    Please give me some answers.

    Regards OCRDetect_To_Waterlevel_Scaller

    opened by JJNET 0
  • ./darknet: error while loading shared libraries: libopencv_core.so.2.4: cannot open shared object file: No such file or directory

    ./darknet: error while loading shared libraries: libopencv_core.so.2.4: cannot open shared object file: No such file or directory

    I have trained a custom YoloV4 model. However, upon inference, I'm getting this error on my server:

    ./darknet: error while loading shared libraries: libopencv_core.so.2.4: cannot open shared object file: No such file or directory

    I tried re-installing OpenCV and libopencv-dev, but the error persists.

    The inferencing code and the model run FINE on Colab, which is running OpenCV 4.6.0. Some other threads that mentioned this error suggested changing OpenCV to 2.4, however, this will not be possible on the organization's server. However, in the conda environment I'm using, I have tried multiple OpenCV versions but the error still shows up. Further, it runs fine on colab, so the issue can't be with OpenCV version.

    Kindly suggest how I can resolve this, Thanks.

    opened by varungupta31 0
Code for our ICASSP 2021 paper: SA-Net: Shuffle Attention for Deep Convolutional Neural Networks

SA-Net: Shuffle Attention for Deep Convolutional Neural Networks (paper) By Qing-Long Zhang and Yu-Bin Yang [State Key Laboratory for Novel Software T

Qing-Long Zhang 199 Jan 8, 2023
《Truly shift-invariant convolutional neural networks》(2021)

Truly shift-invariant convolutional neural networks [Paper] Authors: Anadi Chaman and Ivan Dokmanić Convolutional neural networks were always assumed

Anadi Chaman 46 Dec 19, 2022
《A-CNN: Annularly Convolutional Neural Networks on Point Clouds》(2019)

A-CNN: Annularly Convolutional Neural Networks on Point Clouds Created by Artem Komarichev, Zichun Zhong, Jing Hua from Department of Computer Science

Artёm Komarichev 44 Feb 24, 2022
Spontaneous Facial Micro Expression Recognition using 3D Spatio-Temporal Convolutional Neural Networks

Spontaneous Facial Micro Expression Recognition using 3D Spatio-Temporal Convolutional Neural Networks Abstract Facial expression recognition in video

Bogireddy Sai Prasanna Teja Reddy 103 Dec 29, 2022
This project is a loose implementation of paper "Algorithmic Financial Trading with Deep Convolutional Neural Networks: Time Series to Image Conversion Approach"

Stock Market Buy/Sell/Hold prediction Using convolutional Neural Network This repo is an attempt to implement the research paper titled "Algorithmic F

Asutosh Nayak 136 Dec 28, 2022
Fine-tune pretrained Convolutional Neural Networks with PyTorch

Fine-tune pretrained Convolutional Neural Networks with PyTorch. Features Gives access to the most popular CNN architectures pretrained on ImageNet. A

Alex Parinov 694 Nov 23, 2022
Pytorch implementation of AngularGrad: A New Optimization Technique for Angular Convergence of Convolutional Neural Networks

AngularGrad Optimizer This repository contains the oficial implementation for AngularGrad: A New Optimization Technique for Angular Convergence of Con

mario 124 Sep 16, 2022
PyTorch implementation of "ContextNet: Improving Convolutional Neural Networks for Automatic Speech Recognition with Global Context" (INTERSPEECH 2020)

ContextNet ContextNet has CNN-RNN-transducer architecture and features a fully convolutional encoder that incorporates global context information into

Sangchun Ha 24 Nov 24, 2022
A PyTorch implementation of " EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks."

EfficientNet A PyTorch implementation of EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks. [arxiv] [Official TF Repo] Implemen

AhnDW 298 Dec 10, 2022
Learning and Building Convolutional Neural Networks using PyTorch

Image Classification Using Deep Learning Learning and Building Convolutional Neural Networks using PyTorch. Models, selected are based on number of ci

Mayur 126 Dec 22, 2022
An implementation of paper `Real-time Convolutional Neural Networks for Emotion and Gender Classification` with PaddlePaddle.

简介 通过PaddlePaddle框架复现了论文 Real-time Convolutional Neural Networks for Emotion and Gender Classification 中提出的两个模型,分别是SimpleCNN和MiniXception。利用 imdb_crop

null 8 Mar 11, 2022
PyTorch Implementation of [1611.06440] Pruning Convolutional Neural Networks for Resource Efficient Inference

PyTorch implementation of [1611.06440 Pruning Convolutional Neural Networks for Resource Efficient Inference] This demonstrates pruning a VGG16 based

Jacob Gildenblat 836 Dec 26, 2022
CMT: Convolutional Neural Networks Meet Vision Transformers

CMT: Convolutional Neural Networks Meet Vision Transformers [arxiv] 1. Introduction This repo is the CMT model which impelement with pytorch, no refer

FlyEgle 83 Dec 30, 2022
[ICCV 2021] Amplitude-Phase Recombination: Rethinking Robustness of Convolutional Neural Networks in Frequency Domain

Amplitude-Phase Recombination (ICCV'21) Official PyTorch implementation of "Amplitude-Phase Recombination: Rethinking Robustness of Convolutional Neur

Guangyao Chen 53 Oct 5, 2022
A PyTorch implementation for V-Net: Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation

A PyTorch implementation of V-Net Vnet is a PyTorch implementation of the paper V-Net: Fully Convolutional Neural Networks for Volumetric Medical Imag

Matthew Macy 606 Dec 21, 2022
A PyTorch implementation of Multi-digit Number Recognition from Street View Imagery using Deep Convolutional Neural Networks

SVHNClassifier-PyTorch A PyTorch implementation of Multi-digit Number Recognition from Street View Imagery using Deep Convolutional Neural Networks If

Potter Hsu 182 Jan 3, 2023
Search and filter videos based on objects that appear in them using convolutional neural networks

Thingscoop: Utility for searching and filtering videos based on their content Description Thingscoop is a command-line utility for analyzing videos se

Anastasis Germanidis 354 Dec 4, 2022
PyTorch implementation of convolutional neural networks-based text-to-speech synthesis models

Deepvoice3_pytorch PyTorch implementation of convolutional networks-based text-to-speech synthesis models: arXiv:1710.07654: Deep Voice 3: Scaling Tex

Ryuichi Yamamoto 1.8k Jan 8, 2023
Physics-informed convolutional-recurrent neural networks for solving spatiotemporal PDEs

PhyCRNet Physics-informed convolutional-recurrent neural networks for solving spatiotemporal PDEs Paper link: [ArXiv] By: Pu Ren, Chengping Rao, Yang

Pu Ren 11 Aug 23, 2022