Convolutional Neural Networks

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

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?

  • 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!

  • 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.

    [email protected]:~/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)
    [email protected]:~/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      |
    |=============================================================================|
    +-----------------------------------------------------------------------------+
    
  • 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.

  • ./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

    [email protected]:~/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

  • 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.

  • 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!

  • 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.

  • 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.

  • 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?

  • 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!

  • 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

  • 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

  • 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

  • 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

  • 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

  • ./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.

An optimized neural network operator library for chips base on Xuantie CPU.

简介 CSI-NN2 是 T-HEAD 提供的一组针对无剑 SoC 平台的神经网络库 API。抽象了各种常用的网络层的接口,并且提供一系列已优化的二进制库。 CSI-NN2 的特性: 开源 c 代码版本的参考实现。 提供玄铁 CPU 的汇编优化实现。

Jan 5, 2023
C++ NN 🧠 A simple Neural Network library written in C++

C++ NN ?? A simple Neural Network library written in C++ Installation ??

Dec 13, 2022
Convolutional Neural Networks
Convolutional Neural Networks

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. D

Jan 9, 2023
Implementing Deep Convolutional Neural Network in C without External Libraries for YUV video Super-Resolution
Implementing Deep Convolutional Neural Network in C without External Libraries for YUV video Super-Resolution

DeepC: Implementing Deep Convolutional Neural Network in C without External Libraries for YUV video Super-Resolution This code uses FSRCNN algorithm t

Dec 27, 2022
Real time monaural source separation base on fully convolutional neural network operates on Time-frequency domain.
Real time monaural source separation base on fully convolutional neural network operates on Time-frequency domain.

Real time monaural source separation base on fully convolutional neural network operates on Time-frequency domain.

Jan 9, 2023
Tensors and Dynamic neural networks in Python with strong GPU acceleration
Tensors and Dynamic neural networks in Python with strong GPU acceleration

PyTorch is a Python package that provides two high-level features: Tensor computation (like NumPy) with strong GPU acceleration Deep neural networks b

Jan 4, 2023
A lightweight C library for artificial neural networks

Getting Started # acquire source code and compile git clone https://github.com/attractivechaos/kann cd kann; make # learn unsigned addition (30000 sam

Dec 19, 2022
Low dependency(C++11 STL only), good portability, header-only, deep neural networks for embedded
Low dependency(C++11 STL only), good portability, header-only, deep neural networks for embedded

LKYDeepNN LKYDeepNN 可訓練的深度類神經網路 (Deep Neural Network) 函式庫。 輕量,核心部份只依賴 C++11 標準函式庫,低相依性、好移植,方便在嵌入式系統上使用。 Class diagram 附有訓練視覺化 demo 程式 訓練視覺化程式以 OpenCV

Nov 7, 2022
Tiny CUDA Neural Networks
 Tiny CUDA Neural Networks

This is a small, self-contained framework for training and querying neural networks. Most notably, it contains a lightning fast "fully fused" multi-layer perceptron as well as support for various advanced input encodings, losses, and optimizers.

Jan 7, 2023
Raspberry Pi guitar pedal using neural networks to emulate real amps and pedals.
Raspberry Pi guitar pedal using neural networks to emulate real amps and pedals.

NeuralPi NeuralPi is a guitar pedal using neural networks to emulate real amps and pedals on a Raspberry Pi 4. The NeuralPi software is a VST3 plugin

Jan 5, 2023
An Efficient Implementation of Analytic Mesh Algorithm for 3D Iso-surface Extraction from Neural Networks
An Efficient Implementation of Analytic Mesh Algorithm for 3D Iso-surface Extraction from Neural Networks

AnalyticMesh Analytic Marching is an exact meshing solution from neural networks. Compared to standard methods, it completely avoids geometric and top

Dec 21, 2022
An Efficient Implementation of Analytic Mesh Algorithm for 3D Iso-surface Extraction from Neural Networks
An Efficient Implementation of Analytic Mesh Algorithm for 3D Iso-surface Extraction from Neural Networks

AnalyticMesh Analytic Marching is an exact meshing solution from neural networks. Compared to standard methods, it completely avoids geometric and top

Dec 21, 2022
A header-only C++ library for deep neural networks

MiniDNN MiniDNN is a C++ library that implements a number of popular deep neural network (DNN) models. It has a mini codebase but is fully functional

Dec 22, 2022
InsNet Runs Instance-dependent Neural Networks with Padding-free Dynamic Batching.

InsNet documentation InsNet (documentation) is a powerful neural network library aiming at building instance-dependent computation graphs. It is desig

Jan 3, 2023
A framework for generic hybrid two-party computation and private inference with neural networks

MOTION2NX -- A Framework for Generic Hybrid Two-Party Computation and Private Inference with Neural Networks This software is an extension of the MOTI

Nov 29, 2022
TS-9 guitar pedal clone using neural networks.
TS-9 guitar pedal clone using neural networks.

TS-M1N3 TS-M1N3 is a guitar plugin clone of the TS-9 Tubescreamer overdrive pedal. Machine learning was used to train a model of both the drive and to

Nov 23, 2022
A library for creating Artificial Neural Networks, for use in Machine Learning and Deep Learning algorithms.
A library for creating Artificial Neural Networks, for use in Machine Learning and Deep Learning algorithms.

iNeural A library for creating Artificial Neural Networks, for use in Machine Learning and Deep Learning algorithms. What is a Neural Network? Work on

Apr 5, 2022
A Tool for Verifying Neural Networks using SMT-Based Model Checking

Project Title QNNVerifier Description A Tool for Verifying Neural Networks using SMT-Based Model Checking. Using Frama-C and ESBMC as the backends. Yo

Dec 11, 2021
CoDi is a cellular automaton model for spiking neural networks

CoDi CoDi is a cellular automaton (CA) model for spiking neural networks (SNNs). CoDi is an acronym for Collect and Distribute, referring to the signa

May 5, 2022
Dec 20, 2022