YOLTv4 builds upon YOLT and SIMRDWN, and updates these frameworks to use the most performant version of YOLO, YOLOv4

Related tags

Deep Learning yoltv4
Overview

YOLTv4

Alt text

YOLTv4 builds upon YOLT and SIMRDWN, and updates these frameworks to use the most performant version of YOLO, YOLOv4. YOLTv4 is designed to detect objects in aerial or satellite imagery in arbitrarily large images that far exceed the ~600×600 pixel size typically ingested by deep learning object detection frameworks.

This repository is built upon the impressive work of AlexeyAB's YOLOv4 implementation, which improves both speed and detection performance compared to YOLOv3 (which is implemented in SIMRDWN). We use YOLOv4 insead of "YOLOv5", since YOLOv4 is endorsed by the original creators of YOLO, whereas "YOLOv5" is not; furthermore YOLOv4 appears to have superior performance.

Below, we provide examples of how to use this repository with the open-source Rareplanes dataset.


Running YOLTv4


0. Installation

YOLTv4 is built to execute within a docker container on a GPU-enabled machine. The docker command creates an Ubuntu 16.04 image with CUDA 9.2, python 3.6, and conda.

  1. Clone this repository (e.g. to /yoltv4/).

  2. Download model weights to yoltv4/darknet/weights). See: https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.conv.137 https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.weights https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-csp.conv.142

  3. Install nvidia-docker.

  4. Build docker file.

     nvidia-docker build -t yoltv4_image /yoltv4/docker
    
  5. Spin up the docker container (see the docker docs for options).

     NV_GPU=0 nvidia-docker run -it -v /local_data:/local_data -v /yoltv4:/yoltv4 -ti --ipc=host --name yoltv4_gpu0 yoltv4_image
    
  6. Compile the Darknet C program.

    First Set GPU=1 CUDNN=1, CUDNN_HALF=1, OPENCV=1 in /yoltv4/darknet/Makefile, then make:

     cd /yoltv4/darknet
     make
    

1. Train

A. Prepare Data

  1. Make YOLO images and labels (see yoltv4/notebooks/train_test_pipeline.ipynb for further details).

  2. Create a txt file listing the training images.

  3. Create file obj.names file with each desired object name on its own line.

  4. Create file obj.data in the directory yoltv4/darknet/data containing necessary files. For example:

    /yoltv4/darknet/data/rareplanes_train.data

     classes = 30
     train =  /local_data/cosmiq/wdata/rareplanes/train/txt/train.txt
     valid =  /local_data/cosmiq/wdata/rareplanes/train/txt/valid.txt
     names =  /yoltv4/darknet/data/rareplanes.name
     backup = backup/
    
  5. Prepare config files.

    See instructions here, or tweak /yoltv4/darknet/cfg/yoltv4_rareplanes.cfg.

B. Execute Training

  1. Execute.

     cd /yoltv4/darknet
     time ./darknet detector train data/rareplanes_train.data  cfg/yoltv4_rareplanes.cfg weights/yolov4.conv.137  -dont_show -mjpeg_port 8090 -map
    
  2. Review progress (plotted at: /yoltv4/darknet/chart_yoltv4_rareplanes.png).


2. Test

A. Prepare Data

  1. Make sliced images (see yoltv4/notebooks/train_test_pipeline.ipynb for further details).

  2. Create a txt file listing the training images.

  3. Create file obj.data in the directory yoltv4/darknet/data containing necessary files. For example:

    /yoltv4/darknet/data/rareplanes_test.data classes = 30 train = valid = /local_data/cosmiq/wdata/rareplanes/test/txt/test.txt names = /yoltv4/darknet/data/rareplanes.name backup = backup/

B. Execute Testing

  1. Execute (proceeds at >80 frames per second on a Tesla P100):

     cd /yoltv4/darknet
     time ./darknet detector valid data/rareplanes_test.data cfg/yoltv4_rareplanes.cfg backup/ yoltv4_rareplanes_best.weights
    
  2. Post-process detections:

    A. Move detections into results directory

     mkdir /yoltv4/darknet/results/rareplanes_preds_v0
     mkdir  /yoltv4/darknet/results/rareplanes_preds_v0/orig_txt
     mv /yoltv4/darknet/results/comp4_det_test_*  /yoltv4/darknet/results/rareplanes_preds_v0/orig_txt/
    

    B. Stitch detections back together and make plots

     time python /yoltv4/yoltv4/post_process.py \
         --pred_dir=/yoltv4/darknet/results/rareplanes_preds_v0/orig_txt/ \
         --raw_im_dir=/local_data/cosmiq/wdata/rareplanes/test/images/ \
         --sliced_im_dir=/local_data/cosmiq/wdata/rareplanes/test/yoltv4/images_slice/ \
         --out_dir= /yoltv4/darknet/results/rareplanes_preds_v0 \
         --detection_thresh=0.25 \
         --slice_size=416} \
         --n_plots=8
    

Outputs will look something like the figures below:

Alt text

Alt text

Alt text

Comments
  • Yoltv4 on Jetson Nano

    Yoltv4 on Jetson Nano

    Hi, Is it possible to run Yoltv4 on Jetso Nano or Xavier? This docker file does not work as it is when run on Jetson Nano. Is there any support or documentation available to run Yoltv4 on Nano or Xavier? Any suggestion is much appreciated. Thanks & Regards -Siva

    opened by nsivaramakrishnan 1
  • Docker build - conda install hanging

    Docker build - conda install hanging

    Hello I came across this repo and was hoping to run your example to learn more about yolt and yolo implementations. However when the docker build gets to RUN conda install -n yoltv4 \ ... packages I get the following logs.

     ---> Running in e78c588b0aa8
    Collecting package metadata (current_repodata.json): ...working... done
    Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
    Solving environment: ...working... failed with repodata from current_repodata.json, will retry with next repodata source.
    Collecting package metadata (repodata.json): ...working... done
    Solving environment: ...working...
    

    UPDATE: USE CONDA-FORGE REPOS

    opened by markospacetech 1
  • Missing prep_data notebook

    Missing prep_data notebook

    Please include the missing notebook: yoltv4/notebooks/prep_data.ipynb

    It is needed to reproduce/complete steps:

    • 2.2. Train: A. Prepare Data
    • 2.3. Test: A. Prepare Data
    opened by elmonkey 1
  • Anomaly value - loss

    Anomaly value - loss

    When I train the model with rareplane dataset, it reported that "v3 (iou loss, Normalizer: (iou: 0.07, obj: 1.00, cls: 1.00) Region 139 Avg (IOU: 0.307299), count: 23, class_loss = 8190.737305, iou_loss = 33.274414, total_loss = 8224.011719 " Why does it has so large loss? And after several times, it changed to "v3 (iou loss, Normalizer: (iou: 0.07, obj: 1.00, cls: 1.00) Region 150 Avg (IOU: 0.000000), count: 18, class_loss = -nan, iou_loss = -nan, total_loss = -nan", all the loss values changed to -nan. I have tried to change many parameters, but it did not work either. Screenshot from 2021-07-20 17-39-13

    opened by XUYIRS 0
  • Question about classes

    Question about classes

    Hello

    I wonder why do you set the classes = 30. In the rareplanes datasets, it only has 'aeroplane' class, right? If I set the classes as 30, what should I set in the file ended with name (rareplanes.name).

    Best regards

    opened by XUYIRS 0
  • docker: Error response from daemon: pull access denied for yoltv4_image, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

    docker: Error response from daemon: pull access denied for yoltv4_image, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

    docker: Error response from daemon: pull access denied for yoltv4_image, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

    not exist ? some one who meet issuse?

    opened by xybl666 0
  • Unknown runtime specified nvidia.

    Unknown runtime specified nvidia.

    hi Avanetten: thank for you contribution meet issues after step :sudo nvidia-docker build -t yoltv4_image yoltv4/docker problem: Sending build context to Docker daemon 5.632kB Step 1/21 : FROM nvidia/cuda:11.3.1-devel-ubuntu16.04 Head "https://registry-1.docker.io/v2/nvidia/cuda/manifests/11.3.1-devel-ubuntu16.04": read tcp 172.27.186.190:47828->34.237.170.112:443: read: connection reset by peer

    can not next step

    Do you know reason and appreciate for that

    opened by xybl666 0
  • How to use rareplanes datas?

    How to use rareplanes datas?

    In train_test_pipeline.ipynb is using Rareplanes dataset. So which files were you download. and what is the file path looks like??

    I have tried the following, but path problem keep showing.

    first time deal with these kinda data. hope you can explain more detail

    opened by Sakra990604 0
  • Have you or can you host the pre-trained YOLTv4 model for direct inference use?

    Have you or can you host the pre-trained YOLTv4 model for direct inference use?

    Am having some training problems due to CPU limitations and lack of GPU on my device. It'd be great if you could upload a fully trained model somewhere for direct inference usage

    opened by dsonigladiator 0
  • prediction is empty. No results in this file obj_preds_v0_obj.txt

    prediction is empty. No results in this file obj_preds_v0_obj.txt

    I can't see in any prediction on custom trained model. Training seems to be successful. Best model is getting saved but when doing the prediction on test data. Empty text file(obj_preds_v0_obj.txt) is getting created in result folder.

    opened by nikhilkhandelwal0702 0
Owner
Adam Van Etten
Adam Van Etten
WHENet - ONNX, OpenVINO, TFLite, TensorRT, EdgeTPU, CoreML, TFJS, YOLOv4/YOLOv4-tiny-3L

HeadPoseEstimation-WHENet-yolov4-onnx-openvino ONNX, OpenVINO, TFLite, TensorRT, EdgeTPU, CoreML, TFJS, YOLOv4/YOLOv4-tiny-3L 1. Usage $ git clone htt

Katsuya Hyodo 49 Sep 21, 2022
LF-YOLO (Lighter and Faster YOLO) is used to detect defect of X-ray weld image.

This project is based on ultralytics/yolov3. LF-YOLO (Lighter and Faster YOLO) is used to detect defect of X-ray weld image. Download $ git clone http

null 26 Dec 13, 2022
Yolo ros - YOLO-ROS for HUAWEI ATLAS200

YOLO-ROS YOLO-ROS for NVIDIA YOLO-ROS for HUAWEI ATLAS200, please checkout for b

ChrisLiu 5 Oct 18, 2022
Yolo object detection - Yolo object detection with python

How to run download required files make build_image make download Docker versio

null 3 Jan 26, 2022
CompilerGym is a library of easy to use and performant reinforcement learning environments for compiler tasks

CompilerGym is a library of easy to use and performant reinforcement learning environments for compiler tasks

Facebook Research 721 Jan 3, 2023
Yoloxkeypointsegment - An anchor-free version of YOLO, with a simpler design but better performance

Introduction 关键点版本:已完成 全景分割版本:已完成 实例分割版本:已完成 YOLOX is an anchor-free version of

null 23 Oct 20, 2022
This repository builds a basic vision transformer from scratch so that one beginner can understand the theory of vision transformer.

vision-transformer-from-scratch This repository includes several kinds of vision transformers from scratch so that one beginner can understand the the

null 1 Dec 24, 2021
Builds a LoRa radio frequency fingerprint identification (RFFI) system based on deep learning techiniques

This project builds a LoRa radio frequency fingerprint identification (RFFI) system based on deep learning techiniques.

null 20 Dec 30, 2022
Code for the paper "VisualBERT: A Simple and Performant Baseline for Vision and Language"

This repository contains code for the following two papers: VisualBERT: A Simple and Performant Baseline for Vision and Language (arxiv) with a short

Natural Language Processing @UCLA 463 Dec 9, 2022
Neural Ensemble Search for Performant and Calibrated Predictions

Neural Ensemble Search Introduction This repo contains the code accompanying the paper: Neural Ensemble Search for Performant and Calibrated Predictio

AutoML-Freiburg-Hannover 26 Dec 12, 2022
Bagua is a flexible and performant distributed training algorithm development framework.

Bagua is a flexible and performant distributed training algorithm development framework.

null 786 Dec 17, 2022
Performant, differentiable reinforcement learning

deluca Performant, differentiable reinforcement learning Notes This is pre-alpha software and is undergoing a number of core changes. Updates to follo

Google 114 Dec 27, 2022
PyTorch ,ONNX and TensorRT implementation of YOLOv4

PyTorch ,ONNX and TensorRT implementation of YOLOv4

null 4.2k Jan 1, 2023
I tried to apply the CAM algorithm to YOLOv4 and it worked.

YOLOV4:You Only Look Once目标检测模型在pytorch当中的实现 2021年2月7日更新: 加入letterbox_image的选项,关闭letterbox_image后网络的map得到大幅度提升。 目录 性能情况 Performance 实现的内容 Achievement

null 55 Dec 5, 2022
People movement type classifier with YOLOv4 detection and SORT tracking.

Movement classification The goal of this project would be movement classification of people, in other words, walking (normal and fast) and running. Yo

null 4 Sep 21, 2021
Object tracking implemented with YOLOv4, DeepSort, and TensorFlow.

Object tracking implemented with YOLOv4, DeepSort, and TensorFlow. YOLOv4 is a state of the art algorithm that uses deep convolutional neural networks to perform object detections. We can take the output of YOLOv4 feed these object detections into Deep SORT (Simple Online and Realtime Tracking with a Deep Association Metric) in order to create a highly accurate object tracker.

The AI Guy 1.1k Dec 29, 2022
Implementing yolov4 target detection and tracking based on nao robot

Implementing yolov4 target detection and tracking based on nao robot

null 6 Apr 19, 2022
这是一个mobilenet-yolov4-lite的库,把yolov4主干网络修改成了mobilenet,修改了Panet的卷积组成,使参数量大幅度缩小。

YOLOV4:You Only Look Once目标检测模型-修改mobilenet系列主干网络-在Keras当中的实现 2021年2月8日更新: 加入letterbox_image的选项,关闭letterbox_image后网络的map一般可以得到提升。

Bubbliiiing 65 Dec 1, 2022