Video2X: High-quality video upscaling and frame interpolation framework
Source code editor
Important
Versions 4 and 5 have reached end-of-life (EOL) status. Due to limited development resources, any issues related to versions lower than 6 will no longer be resolved.
Version 6.0.0
Download the Windows installer
In a nutshell: version 6.0.0 is a complete rewrite of the Video2X project in C/C++, with a faster and more efficient architecture, cross-platform support, greatly improved output quality, and new features for easy setup on Windows GUI and installer.
Version 6.0.0 is a complete rewrite of the project, implemented in C/C++ and includes the following features:
1. Faster architecture: By leveraging multi-threading and GPU acceleration, Video2X is now much faster than before.
2. Cross-platform support: Video2X now runs on Windows, Linux and macOS.
3. Improved output quality: Video2X now offers higher upscaling quality, especially for high-resolution videos.
4. New GUI: Video2X now features a user-friendly GUI that simplifies the setup and usage process.
5. New Installer: Video2X now offers an easy-to-use installer that helps you install the software quickly and easily on Windows.
Support for RealCUGAN and frame interpolation using RIFE is coming soon.
Download Windows version
You can download the latest Windows version from the releases page. For basic GUI usage, see the GUI wiki page. If you can't download directly from GitHub, try using a mirror. The GUI currently supports the following languages:
1. English
2. Simplified Chinese
3. Traditional Chinese
4. Japanese
5. Korean
6. French
7. German
8. Italian
9. Spanish
10. Portuguese
11. Russian
Install on Linux
You can install Video2X on Arch Linux using the video2x-git package, or download the precompiled binaries from the releases page. If you want to build from source, see the PKGBUILD file for an overview of the required packages and commands. If you don't want to compile your program from source, consider using the container image below.
container image
Video2X container images are available on the GitHub container registry for easy deployment on Linux and macOS. If you have Docker/Podman installed, you can start video amplification with just one command. For more information on how to use Video2X's Docker image, see the documentation.
Google Colab (obsolete: 5.0.0-beta7)
If you don't have your own powerful GPU, you can use Video2X for free on Google Colab. You can borrow a powerful GPU (NVIDIA T4, L4, or A100) for free on Google's servers for up to 12 hours per session. Please use free resources fairly and do not create continuous sessions and run Zoom 24/7. This may result in you being banned. If you want to use a better GPU and get longer runtimes, get Colab Pro/Pro+. Instructions for use are embedded in the Colab notebook.
Telegram discussion group
Join our Telegram discussion group to ask any questions you have about Video2X, chat directly with the developers, or discuss super-resolution technology and the future of Video2X.
document
Documentation for Video2X is hosted on the Wiki page of this repository. It includes comprehensive instructions on how to use the GUI, CLI, container images, libraries, and more. Wikis are open to editing by the community, so you, yes you, can also correct errors or add new content to the documentation.
introduce
Video2X is a machine learning-based video upscaling and frame interpolation framework built around three main components:
1. Models: Video2X uses a variety of advanced deep learning models to perform upscaling and frame interpolation.
2. Engine: The Video2X engine is responsible for processing video data, performing model inference, and generating output videos.
3. Interface: Video2X provides various interfaces such as GUI, CLI, and container images to enable you to use the framework easily.
Video demonstration
Zoom in: Spirited Away movie trailer
Standard test snippet
The following snippet can be used to test whether your setup is working properly. This is also a standard snippet for running performance benchmarks.
The original clip is from the anime "The Pet Girl of Sakurasou".
The copyright of this clip belongs to Amino Pulse Co., Ltd.
license
This project is released under the GNU AGPL version 3 license.
Copyright (C) 2018-2024 K4YT3X and contributors.
This project includes or depends on the following projects:
1. opencv: https://github.com/opencv/opencv
2. waifu2x-caffe: https://github.com/nagadomi/waifu2x-caffe
3. Real-ESRGAN: https://github.com/xinntao/Real-ESRGAN
4. BasicSR: https://github.com/xinntao/BasicSR
5. GFPGAN: https://github.com/TencentARC/GFPGAN
6. RIFE: https://github.com/hzwer/arXiv2021-RIFE
7. Anime4K: https://github.com/bloc97/Anime4K
You can find more licensing information in the NOTICE file.
special thanks
Special thanks to the following individuals for their significant contributions to this project, in alphabetical order:
1. K4YT3X: Project Creator
2. Contributors: Thanks to everyone who contributed to this project.
For example:
Apache-2.0 License
Table of contents
Darknet object detection framework and YOLO
1. Paper
2. General information
3. Darknet version
4. MSCOCO pre-training weights
5. Build
1. Google Colab
2. Linux CMake method
3. Windows CMake method
6. Use Darknet
1. CLI
2. Training
7. Other Tools and Links
8. Roadmap
1. Short-term goals
2. Mid-term goals
3. Long-term goals
Darknet object detection framework and YOLO
Darknet is an open source neural network framework written in C, C++ and CUDA.
YOLO (You Only Look Once) is a state-of-the-art real-time object detection system running in the Darknet framework.
Read how Hank.ai helps the Darknet/YOLO community
Announcing Darknet V3 “Jazz”
Check out the Darknet/YOLO website
Please read the Darknet/YOLO FAQ
Join the Darknet/YOLO Discord server
paper
1. YOLOv7 paper
2. Scaled-YOLOv4 paper
3. YOLOv4 paper
4. YOLOv3 paper
General information
The Darknet/YOLO framework continues to be faster and more accurate than other frameworks and YOLO versions.
The framework is completely free and open source. You can integrate Darknet/YOLO into existing projects and products (including commercial products) without licensing or fees.
Darknet V3 ("Jazz"), released in October 2024, can accurately run LEGO dataset video at up to 1000 FPS when using an NVIDIA RTX 3090 GPU, meaning each video frame takes 1 millisecond or less Internally read, resized and processed by Darknet/YOLO.
If you need help or want to discuss Darknet/YOLO, please join the Darknet/YOLO Discord server: https://discord.gg/zSq8rtW
The CPU version of Darknet/YOLO can run on simple devices such as Raspberry Pi, cloud and colab servers, desktops, laptops and high-end training equipment. The GPU version of Darknet/YOLO requires NVIDIA's CUDA-compatible GPU.
Darknet/YOLO is known to run on Linux, Windows, and Mac. See build instructions below.
Darknet version
The original Darknet tools written by Joseph Redmon in 2013-2017 did not have version numbers. We think this is version 0.x.
The next popular Darknet library maintained by Alexey Bochkovskiy from 2017-2021 also does not have a version number. We think this is version 1.x.
The Darknet library sponsored by Hank.ai and maintained by Stéphane Charette starting in 2023 is the first library to have a version command. From 2023 to the end of 2024, it returns to version 2.x "OAK".
The goal is to get familiar with the code base while breaking as little existing functionality as possible.
1. Rewritten the build steps so we can now build on Windows and Linux using CMake.
2. Convert the code base to use a C++ compiler.
3. Enhanced chart.png during training.
4. Bug fixes and performance-related optimizations, mainly related to reducing the time required to train the network.
The last branch of the code base is version 2.1 in the v2 branch.
The next phase of development begins in mid-2024 and will be released in October 2024. The version command now returns 3.x "JAZZ".
If you need to run one of these commands, you can always checkout the previous v2 branch. Please let us know so we can investigate adding back any missing commands.
1. Removed many old and unmaintained commands.
2. Made many performance optimizations, both during training and inference.
3. Modified the old C API; applications using the original Darknet API will need to make minor modifications: https://darknetcv.ai/api/api.html
4. New Darknet V3 C and C++ API: https://darknetcv.ai/api/api.html
5. New applications and sample code in src-examples: https://darknetcv.ai/api/files.html
MSCOCO pre-trained weights
For convenience, several popular versions of YOLO are pre-trained on the MSCOCO dataset. The dataset contains 80 categories and can be seen in the text file cfg/coco.names.
There are several other simpler datasets and pre-trained weights available for testing Darknet/YOLO, such as LEGO Gears and Rolodex. For more information, see the Darknet/YOLO FAQ.
MSCOCO pre-trained weights can be downloaded from several different locations and can also be downloaded from this repo:
1. YOLOv2, November 2016
1. YOLOv2-tiny
2.YOLOv2-full
2. YOLOv3, May 2018
1. YOLOv3-tiny
2.YOLOv3-full
3. YOLOv4, May 2020
1.YOLOv4-tiny
2. YOLOv4-full
4. YOLOv7, August 2022
1. YOLOv7-tiny
2. YOLOv7-full
MSCOCO pretrained weights are for demonstration purposes only. The corresponding .cfg and .names files for MSCOCO are located in the cfg directory. Example command:
`bash
wget --no-clobber https://github.com/hank-ai/darknet/releases/download/v2.0/yolov4-tiny.weights
darknet02displayannotatedimages coco.names yolov4-tiny.cfg yolov4-tiny.weights image1.jpg
darknet03display_videos coco.names yolov4-tiny.cfg yolov4-tiny.weights video1.avi
DarkHelp coco.names yolov4-tiny.cfg yolov4-tiny.weights image1.jpg
DarkHelp coco.names yolov4-tiny.cfg yolov4-tiny.weights video1.avi
`
Note that one should train their own network. MSCOCO is usually used to confirm that everything is working properly.
build
The various build methods available in the past (before 2023) have been merged into a unified solution. Darknet requires C++17 or higher, OpenCV, and using CMake to generate the necessary project files.
You don't need to know C++ to build, install, or run Darknet/YOLO, just like you don't need to be a mechanic to drive a car.
Google Colab
Google Colab instructions are the same as Linux instructions. There are several Jupyter notebooks available that show how to perform certain tasks, such as training a new network.
Check out the notebook in the colab subdirectory, or follow the Linux instructions below.
Linux CMake method
Darknet build tutorial for Linux
Optional: If you have a modern NVIDIA GPU, you can install CUDA or CUDA+cuDNN at this time. If installed, Darknet will use your GPU to accelerate image (and video) processing.
You must delete the CMakeCache.txt file from the Darknet build directory to force CMake to re-find all necessary files.
Remember to rebuild Darknet.
Darknet can be run without it, but if you want to train a custom network, you will need CUDA or CUDA+cuDNN.
Visit https://developer.nvidia.com/cuda-downloads to download and install CUDA.
Visit https://developer.nvidia.com/rdp/cudnn-download or https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#cudnn-package-manager-installation-overview to download and Install cuDNN.
After installing CUDA, make sure you can run nvcc and nvidia-smi. You may need to modify the PATH variable.
If you later installed CUDA or CUDA+cuDNN, or if you upgraded to a newer version of NVIDIA software:
These instructions assume (but do not require!) that the system is running Ubuntu 22.04. If you are using another distribution, adjust as needed.
`bash
sudo apt-get install build-essential git libopencv-dev cmake
mkdir ~/srccd ~/src
git clone https://github.com/hank-ai/darknet
cd darknet
mkdir build
cd build
cmake -DCMAKEBUILDTYPE=Release ..
make -j4 package
sudo dpkg -i darknet-VERSION.deb
`
If you are using an older version of CMake, you will need to upgrade CMake to run the cmake command above. Upgrading CMake on Ubuntu can be done with the following command:
`bash
sudo apt-get purge cmake
sudo snap install cmake --classic
`
If you are using bash as your command shell, you will need to restart your shell at this time. If you are using fish it should pick up the new path immediately.
Advanced users:
If you want to build an RPM installation file instead of a DEB file, see the relevant lines in CM_package.cmake. Before running make -j4 package you need to edit these two lines:
`bash
SET (CPACKGENERATOR "DEB")# SET (CPACKGENERATOR "RPM")
`
For distributions such as Centos and OpenSUSE, you need to switch these two lines in CM_package.cmake to:
`bash
SET (CPACK_GENERATOR "DEB")
SET (CPACK_GENERATOR "RPM")
`
To install a package, use your distribution's regular package manager after it has finished building. For example, on a Debian-based system such as Ubuntu:
`bash
sudo dpkg -i darknet-2.0.1-Linux.deb
`
Installing the .deb package will copy the following files:
1. /usr/bin/darknet is the usual Darknet executable file. Run darknet version from the CLI to confirm that it is installed correctly.
2. /usr/include/darknet.h is the Darknet API for C, C++ and Python developers.
3. /usr/include/darknet_version.h contains version information for developers.
4. /usr/lib/libdarknet.so is a library for C, C++ and Python developers to link against.
5. /opt/darknet/cfg/... is where all .cfg templates are stored.
You are done now! Darknet is built and installed into /usr/bin/. Run the following command to test: darknet version.
If you don't have /usr/bin/darknet, you didn't install it, you just built it! Make sure to install the .deb or .rpm file as described above.
Windows CMake methods
These instructions assume you have a clean installation of Windows 11 22H2.
Open a regular cmd.exe command prompt window and run the following command:
`bash
winget install Git.Git
winget install Kitware.CMake
winget install nsis.nsis
winget install Microsoft.VisualStudio.2022.Community
`
At this point, we need to modify the Visual Studio installation to include support for C++ applications:
1. Click the Windows Start menu and run Visual Studio Installer.
2. Click Edit.
3. Choose desktop development using C++.
4. Click Edit in the lower right corner, then click Yes.
Once everything is downloaded and installed, click on the Windows Start menu again and select Developer Command Prompt for Visual Studio 2022. Do not use PowerShell to perform these steps, you will run into problems!
Advanced users:
Instead of running the developer command prompt, you can log in to the device using a normal command prompt or ssh and manually run "Program FilesMicrosoft Visual Studio2022CommunityCommon7ToolsVsDevCmd.bat".
Once you have the developer command prompt running as described above (not PowerShell!), run the following command to install Microsoft VCPKG, which will then be used to build OpenCV:
`bash
cdc:
mkdir c:srccd c:src
git clone https://github.com/microsoft/vcpkg
cd vcpkg
bootstrap-vcpkg.bat
.vcpkg.exe integrate install
.vcpkg.exe integrate powershell.vcpkg.exe install opencv[contrib,dnn,freetype,jpeg,openmp,png,webp,world]:x64-windows
`
Please be patient with this last step as it may take a long time to run. It requires downloading and building a lot of stuff.
Advanced users:
Note that when building OpenCV, you may need to add many other optional modules. Run .vcpkg.exe search opencv to see the complete list.
Optional: If you have a modern NVIDIA GPU, you can install CUDA or CUDA+cuDNN at this time. If installed, Darknet will use your GPU to accelerate image (and video) processing.
You must delete the CMakeCache.txt file from the Darknet build directory to force CMake to re-find all required files.
Remember to rebuild Darknet.
Darknet can be run without it, but if you want to train a custom network, you will need CUDA or CUDA+cuDNN.
Visit https://developer.nvidia.com/cuda-downloads to download and install CUDA.
Visit https://developer.nvidia.com/rdp/cudnn-download or https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#download-windows to download and install cuDNN.
After installing CUDA, make sure you can run nvcc.exe and nvidia-smi.exe. You may need to modify the PATH variable.
After downloading cuDNN, unzip and copy the bin, include, and lib directories to C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/[version]/. You may need to overwrite some files.
If you later installed CUDA or CUDA+cuDNN, or if you upgraded to a newer version of NVIDIA software:
CUDA must be installed after Visual Studio. If you upgrade Visual Studio, remember to reinstall CUDA.
Once all previous steps have been completed successfully, you need to clone Darknet and build it. In this step we also need to tell CMake where vcpkg is located so that it can find OpenCV and other dependencies:
`bash
cd c:src
git clone https://github.com/hank-ai/darknet.git
cd darknet
mkdir build
cd build
cmake -DCMAKEBUILDTYPE=Release -DCMAKETOOLCHAINFILE=C:/src/vcpkg/scripts/buildsystems/vcpkg.cmake ..
msbuild.exe /property:Platform=x64;Configuration=Release /target:Build -maxCpuCount -verbosity:normal -detailedSummary darknet.sln
msbuild.exe /property:Platform=x64;Configuration=Release PACKAGE.vcxproj
`
If you receive an error about a missing CUDA or cuDNN DLL (for example, cublas64_12.dll), manually copy the CUDA .dll file to the same output directory as Darknet.exe. For example:
`bash
copy "C:Program FilesNVIDIA GPU Computing ToolkitCUDAv12.2bin*.dll" src-cliRelease
`
(This is an example! Please check to make sure you are running the version, and run the appropriate command for the version you have installed.)
After copying the files, re-run the last msbuild.exe command to generate the NSIS installation package:
`bash
msbuild.exe /property:Platform=x64;Configuration=Release PACKAGE.vcxproj
`
Advanced users:
Note that the output of the cmake command is the normal Visual Studio solution file Darknet.sln. If you are a software developer who frequently uses the Visual Studio GUI instead of msbuild.exe to build projects, you can ignore the command line and load the Darknet project in Visual Studio.
You should now have this file ready to run: C:srcDarknetbuildsrc-cliReleasedarknet.exe. Run the following command to test: C:srcDarknetbuildsrc-cliReleasedarknet.exe version.
To properly install Darknet, libraries, include files, and necessary DLLs, run the NSIS installation wizard built in the previous step. Check the file darknet-VERSION.exe in the build directory. For example:
`bash
darknet-2.0.31-win64.exe
`
Installing the NSIS installation package will:
1. Create a directory named Darknet, for example C:Program FilesDarknet.
2. Install the CLI application, darknet.exe, and other sample applications.
3. Install the required third-party .dll files, such as those from OpenCV.
4. Install the necessary Darknet .dll, .lib, and .h files to use darknet.dll from another application.
5. Install the template .cfg file.
You are done now! After the installation wizard is completed, Darknet will be installed in C:Program FilesDarknet. Run the following command to test: C:Program FilesDarknetbindarknet.exe version.
If you don't have C:/Program Files/darknet/bin/darknet.exe, you didn't install it, you just built it! Make sure to complete each panel of the NSIS Installation Wizard as described in the previous step.
Using Darknet
CLI
The following is not a complete list of all commands supported by Darknet.
In addition to the Darknet CLI, also note the DarkHelp project CLI, which provides an alternative CLI to Darknet/YOLO. DarkHelp CLI also has some enhancements not found in Darknet. You can use Darknet CLI and DarkHelp CLI together, they are not mutually exclusive.
For most of the commands shown below, you need a .weights file with corresponding .names and .cfg files. You can train your own network (highly recommended!) or download neural networks that others have trained and are freely available on the Internet. Examples of pre-training datasets include:
1. LEGO Gears (find objects in images)
2. Rolodex (find text in image)
3. MSCOCO (standard 80 category target detection)
Commands to run include:
List some possible commands and options that can be run:
`bash
darknet help
`
Check version:
`bash
darknet version
`
Use images to make predictions:
`bash
V2
darknet detector test cars.data cars.cfg cars_best.weights image1.jpg
V3
darknet02displayannotatedimages cars.cfg image1.jpg
DarkHelp
DarkHelp cars.cfg cars.cfg cars_best.weights image1.jpg
`
Output coordinates:
`bash
V2
darknet detector test animals.data animals.cfg animalsbest.weights -extoutput dog.jpg
V3
darknet01inference_images animals dog.jpg
DarkHelp
DarkHelp --json animals.cfg animals.names animals_best.weights dog.jpg
`
Processing video:
`bash
V2
darknet detector demo animals.data animals.cfg animalsbest.weights -extoutput test.mp4
V3
darknet03display_videos animals.cfg test.mp4
DarkHelp
DarkHelp animals.cfg animals.names animals_best.weights test.mp4
`
Reading from webcam:
`bash
V2
darknet detector demo animals.data animals.cfg animals_best.weights -c 0
V3
darknet08display_webcam animals
`
Save results to video:
`bash
V2
darknet detector demo animals.data animals.cfg animalsbest.weights test.mp4 -outfilename res.avi
V3
darknet05processvideosmultithreaded animals.cfg animals.names animals_best.weights test.mp4
DarkHelp
DarkHelp animals.cfg animals.names animals_best.weights test.mp4
`
JSON:
`bash
V2
darknet detector demo animals.data animals.cfg animalsbest.weights test50.mp4 -jsonport 8070 -mjpegport 8090 -extoutput
V3
darknet06imagestojson animals image1.jpg
DarkHelp
DarkHelp --json animals.names animals.cfg animals_best.weights image1.jpg
`
Run on a specific GPU:
`bash
V2
darknet detector demo animals.data animals.cfg animals_best.weights -i 1 test.mp4
`
To check the accuracy of the neural network:
`bash
darknet detector map driving.data driving.cfg driving_best.weights ...
Id Name AvgPrecision TP FN FP TN Accuracy ErrorRate Precision Recall Specificity FalsePosRate
-- ---- ------------ ------ ------ ------ ------ -------- --------- --------- ------ ---------- ----------
0 vehicle 91.2495 32648 3903 5826 65129 0.9095 0.0905 0.8486 0.8932 0.9179 0.0821
1 motorcycle 80.4499 2936 513 569 5393 0.8850 0.1150 0.8377 0.8513 0.9046 0.0954
2 bicycle 89.0912 570 124 104 3548 0.9475 0.0525 0.8457 0.8213 0.9715 0.0285
3 person 76.7937 7072 1727 2574 27523 0.8894 0.1106 0.7332 0.8037 0.9145 0.0855
4 many vehicles 64.3089 1068 509 733 11288 0.9087 0.0913 0.5930 0.6772 0.9390 0.0610
5 green light 86.8118 1969 239 510 4116 0.8904 0.1096 0.7943 0.8918 0.8898 0.1102
6 yellow light 82.0390 126 38 30 1239 0.9525 0.0475 0.8077 0.7683 0.9764 0.0236
7 red light 94.1033 3449 217 451 4643 0.9237 0.0763 0.8844 0.9408 0.9115 0.0885
`
To check accuracy mAP@IoU=75:
`bash
darknet detector map animals.data animals.cfg animalsbest.weights -iouthresh 0.75
`
Recalculating anchor points is best done in DarkMark as it will run 100 times in a row and select the best anchor point from all calculated anchor points. However, if you want to run an older version in Darknet:
`bash
darknet detector calcanchors animals.data -numof_clusters 6 -width 320 -height 256
`
Train a new network:
`bash
darknet detector -map -dont_show train animals.data animals.cfg
`
(See also training section below)
train
Quick links to relevant sections of the Darknet/YOLO FAQ:
1. How do I set up my files and directories?
2. Which profile should I use?
3. What commands should I use when training my own network?
The easiest way to create all necessary Darknet files, annotations and training using DarkMark. This is definitely the recommended way to train new neural networks.
If you want to manually set up the various files to train a custom network:
1. Create a new folder to store the files. For this example, you will create a neural network for detecting animals, so the following directory will be created: ~/nn/animals/.
2. Copy one of the Darknet configuration files you want to use as a template. For example, see cfg/yolov4-tiny.cfg. Place it in the folder you created. In this example, we now have ~/nn/animals/animals.cfg.
3. Create an animals.names text file in the same folder where you placed the configuration file. In this example, we now have ~/nn/animals/animals.names.
4. Use your text editor to edit the animals.names file. List the categories you want to use. You need exactly one entry per line, and no blank lines or comments. In this example, the .names file will contain exactly 4 lines:
`
dog
cat
bird
horse
`
5. Create an animals.data text file in the same folder. In this example, the .data file will contain:
`
classes=4
train=/home/username/nn/animals/animals_train.txt
valid=/home/username/nn/animals/animals_valid.txt
names=/home/username/nn/animals/animals.names
backup=/home/username/nn/animals
`
6. Create a folder to store your images and annotations. For example, this could be ~/nn/animals/dataset. Each image requires a corresponding .txt file that describes the annotations for that image. The format of .txt comment files is very specific. You cannot create these files manually because each annotation needs to contain the precise coordinates of the annotation. See DarkMark or other similar software to annotate your images. The YOLO annotation format is described in the Darknet/YOLO FAQ.
7. Create "train" and "valid" text files named in the .data file. These two text files need to list all the images that Darknet must use for training and validation (when calculating mAP%) respectively. Exactly one image per row. Paths and filenames can be relative or absolute.
8. Use a text editor to modify your .cfg file.
9. Make sure batch=64.
10. Pay attention to subdivisions. Depending on the network size and the amount of memory available on the GPU, you may need to increase subdivisions. The best value to use is 1, so start with 1. If 1 doesn't work for you, see the Darknet/YOLO FAQ.
11. Note that maxbatches=.... A good value to start with is 2000 times the number of categories. In this example we have 4 animals, so 4 * 2000 = 8000. This means we will use maxbatches=8000.
12. Note steps=.... This should be set to 80% and 90% of maxbatches. In this example, since maxbatches is set to 8000, we will use steps=6400,7200.
13. Note that width=... and height=.... These are network dimensions. The Darknet/YOLO FAQ explains how to calculate the optimal size to use.
14. Search the [convolutional] section for all classes=... lines before the [yolo] section and modify them with the number of classes from the .names file. In this example we will use classes=4.
15. Search all filters=... lines in the [convolutional] section before each [yolo] section. The value to use is (number of categories + 5) 3. This means that in this example, (4 + 5) 3 = 27. Therefore, we use filters=27 on the appropriate lines.
Start training! Run the following command:
`bash
cd ~/nn/animals/
darknet detector -map -dont_show train animals.data animals.cfg
`
Please wait. The best weights will be saved as animals_best.weights. You can observe the progress of training by viewing the chart.png file. See the Darknet/YOLO FAQ for additional parameters you may want to use when training a new network.
If you want to see more details during training, add the --verbose parameter. For example:
`bash
darknet detector -map -dont_show --verbose train animals.data animals.cfg
`
Other tools and links
To manage your Darknet/YOLO project, annotate images, validate your annotations, and generate the necessary files needed to train with Darknet, see DarkMark.
For a powerful alternative CLI to Darknet, to use image tiling, object tracking in your videos, or for a powerful C++ API that can be easily used in commercial applications, see DarkHelp.
See if the Darknet/YOLO FAQ can help answer your question.
Check out the many tutorials and example videos on Stéphane's YouTube channel
If you have any support questions or would like to chat with other Darknet/YOLO users, please join the Darknet/YOLO Discord server.
roadmap
Last updated: 2024-10-30:
Completed
1. Replace qsort() used during training with std::sort()