Skip to content

danielgray3/thermal-object-detection-system

Repository files navigation

thermal-object-detection-system

Thermal Object Detector using YOLO.v4 and Custom .weights

Getting Started

USING CONDA:

Tensorflow CPU

conda env create -f conda-cpu.yml conda activate yolov4-cpu

Tensorflow GPU

conda env create -f conda-gpu.yml conda activate yolov4-gpu

Downloading Pre-Trained Weights: YOLOv4 comes pre-trained and able to detect 80 classes. For easy demo purposes we will use the pre-trained weights. Download pre-trained March_23.weights file: https://drive.google.com/file/d/1nvda4Etock3uI0kghtYIZN709GNE90s6/view?usp=sharing

Copy and paste March_23.weights from your downloads folder into the 'data' folder of this repository.

Copy and paste your custom .weights file into the 'data' folder and copy and paste your custom .names into the 'data/classes/' folder.

The only change within the code you need to make in order for your custom model to work is on line 14 of 'core/config.py' file. Update the code to point at your custom .names file as seen below. (my custom .names file is called custom.names but yours might be named differently)

YOLOv4 Using Tensorflow:

Convert darknet weights to tensorflow

yolov4

python save_model.py --weights ./data/yolov4.weights --output ./checkpoints/yolov4-416 --input_size 416 --model yolov4

yolov4-tiny

python save_model.py --weights ./data/yolov4-tiny.weights --output ./checkpoints/yolov4-tiny-416 --input_size 416 --model yolov4 --tiny

custom yolov4

python save_model.py --weights ./data/custom.weights --output ./checkpoints/custom-416 --input_size 416 --model yolov4

Run yolov4 tensorflow model

python detect.py --weights ./checkpoints/yolov4-416 --size 416 --model yolov4 --images ./data/images/kite.jpg

Run yolov4-tiny tensorflow model

python detect.py --weights ./checkpoints/yolov4-tiny-416 --size 416 --model yolov4 --images ./data/images/kite.jpg --tiny

Run custom yolov4 tensorflow model

python detect.py --weights ./checkpoints/custom-416 --size 416 --model yolov4 --images ./data/images/car.jpg

Run yolov4 on video

python detect_video.py --weights ./checkpoints/yolov4-416 --size 416 --model yolov4 --video ./data/video/video.mp4 --output ./detections/results.avi

Run custom yolov4 model on video

python detect_video.py --weights ./checkpoints/custom-416 --size 416 --model yolov4 --video ./data/video/cars.mp4 --output ./detections/results.avi

Run yolov4 on webcam

python detect_video.py --weights ./checkpoints/yolov4-416 --size 416 --model yolov4 --video 0 --output ./detections/results.avi

About

Thermal Object Detector using YOLO.v4 and Custom .weights

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published