Giter VIP home page Giter VIP logo

object-detection's Introduction

Object Detection

Object detection on thermal images

Steps to follow:

  • ./build_docker_container.sh (To build an nvidia-docker)
  • ./run_docker_container.sh (To run the built nvidia-docker by name "darknet_thermal" and with mounted dataset.
  • Make sure that your gpu arch is included in Makefile
    • If it's not, then add your gpu arch and run make clean and make commands in darknet directory.
  • ./preprocess_flir_dataset.sh (Make sure that image directories are consistent with yours.)
  • Exit the container by using "Ctrl+P and Q". This leaves the container still running.
  • Start training in detached mode by using the following command:
    • nvidia-docker exec -d darknet_thermal bash -c "cd /home/object-detection/ ; ./preprocess_flir_dataset.sh ; ./start_training.sh"
    • In start_training.sh script gpu id is 3 by default. You might need to adjust this according to yours.

PyCoco Results for IoU=0.50, area=all, maxDets=100

Average Precision (AP) @[ IoU=0.50:0.50 | area= all | maxDets=100 ] = 0.714
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = -1.000
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = -1.000
Average Precision (AP) @[ IoU=0.50:0.50 | area= small | maxDets=100 ] = 0.576
Average Precision (AP) @[ IoU=0.50:0.50 | area=medium | maxDets=100 ] = 0.819
Average Precision (AP) @[ IoU=0.50:0.50 | area= large | maxDets=100 ] = 0.906
Average Recall (AR) @[ IoU=0.50:0.50 | area= all | maxDets= 1 ] = 0.348
Average Recall (AR) @[ IoU=0.50:0.50 | area= all | maxDets= 10 ] = 0.781
Average Recall (AR) @[ IoU=0.50:0.50 | area= all | maxDets=100 ] = 0.787
Average Recall (AR) @[ IoU=0.50:0.50 | area= small | maxDets=100 ] = 0.719
Average Recall (AR) @[ IoU=0.50:0.50 | area=medium | maxDets=100 ] = 0.834
Average Recall (AR) @[ IoU=0.50:0.50 | area= large | maxDets=100 ] = 0.918

Baseline result: mAP IoU(0.5) of 0.587

You can download the dataset from here

You can find the blog post published on Medium.

Pretrained weights: thermal

object-detection's People

Contributors

enesozi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

object-detection's Issues

thermal_train.txt

Hello,

thank you very much for the repo and the weights.

I want to use your model to inference an image.

Like you said i have to change "thermal.data" but i dont' have the txt-Files:
train = data/thermal_train.txt
valid = data/thermal_validation.txt

Could i have them ? Or is there another solution ? It seems like it worked for the other users. Am i missing something ?

Unable to run ./start_thermal.sh

@enesozi Please help me run the docker

../../../darknet: error while loading shared libraries: libcuda.so.1: cannot open shared object file: No such file or directory
Screenshot from 2020-03-09 17-19-38

compile error issued

Hi,

I am trying to depoly my computer.

When I command "make", I encountered compile fail.

I search a lot of related the problem.

I couldn't find the solution of it.

Please help me ~

The compile results the following :

nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -gencode arch=compute_61,code=[sm_61,compute_61] -Iinclude/ -I3rdparty/stb/include -DGPU -I/usr/local/cuda/include/ -DCUDNN --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -ffp-contract=fast -mavx -mavx2 -msse3 -msse4.1 -msse4.2 -msse4a -Ofast -fopenmp -DGPU -DCUDNN -I/usr/local/cudnn/include -fPIC" -c ./src/maxpool_layer_kernels.cu -o obj/maxpool_layer_kernels.o
nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -gencode arch=compute_61,code=[sm_61,compute_61] -Iinclude/ -I3rdparty/stb/include -DGPU -I/usr/local/cuda/include/ -DCUDNN --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -ffp-contract=fast -mavx -mavx2 -msse3 -msse4.1 -msse4.2 -msse4a -Ofast -fopenmp -DGPU -DCUDNN -I/usr/local/cudnn/include -fPIC" -c ./src/network_kernels.cu -o obj/network_kernels.o
nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -gencode arch=compute_61,code=[sm_61,compute_61] -Iinclude/ -I3rdparty/stb/include -DGPU -I/usr/local/cuda/include/ -DCUDNN --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -ffp-contract=fast -mavx -mavx2 -msse3 -msse4.1 -msse4.2 -msse4a -Ofast -fopenmp -DGPU -DCUDNN -I/usr/local/cudnn/include -fPIC" -c ./src/avgpool_layer_kernels.cu -o obj/avgpool_layer_kernels.o
g++ -Iinclude/ -I3rdparty/stb/include -DGPU -I/usr/local/cuda/include/ -DCUDNN -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -ffp-contract=fast -mavx -mavx2 -msse3 -msse4.1 -msse4.2 -msse4a -Ofast -fopenmp -DGPU -DCUDNN -I/usr/local/cudnn/include -fPIC obj/http_stream.o obj/gemm.o obj/utils.o obj/dark_cuda.o obj/convolutional_layer.o obj/list.o obj/image.o obj/activations.o obj/im2col.o obj/col2im.o obj/blas.o obj/crop_layer.o obj/dropout_layer.o obj/maxpool_layer.o obj/softmax_layer.o obj/data.o obj/matrix.o obj/network.o obj/connected_layer.o obj/cost_layer.o obj/parser.o obj/option_list.o obj/darknet.o obj/detection_layer.o obj/captcha.o obj/route_layer.o obj/writing.o obj/box.o obj/nightmare.o obj/normalization_layer.o obj/avgpool_layer.o obj/coco.o obj/dice.o obj/yolo.o obj/detector.o obj/layer.o obj/compare.o obj/classifier.o obj/local_layer.o obj/swag.o obj/shortcut_layer.o obj/activation_layer.o obj/rnn_layer.o obj/gru_layer.o obj/rnn.o obj/rnn_vid.o obj/crnn_layer.o obj/demo.o obj/tag.o obj/cifar.o obj/go.o obj/batchnorm_layer.o obj/art.o obj/region_layer.o obj/reorg_layer.o obj/reorg_old_layer.o obj/super.o obj/voxel.o obj/tree.o obj/yolo_layer.o obj/upsample_layer.o obj/lstm_layer.o obj/image_opencv.o obj/convolutional_kernels.o obj/activation_kernels.o obj/im2col_kernels.o obj/col2im_kernels.o obj/blas_kernels.o obj/crop_layer_kernels.o obj/dropout_layer_kernels.o obj/maxpool_layer_kernels.o obj/network_kernels.o obj/avgpool_layer_kernels.o -o darknet -lm -pthread -lgomp -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand -L/usr/local/cudnn/lib64 -lcudnn -lstdc++
obj/network.o: In function resize_network': network.c:(.text+0x1b87): undefined reference to resize_conv_lstm_layer'
network.c:(.text+0x1d27): undefined reference to resize_gaussian_yolo_layer' network.c:(.text+0x1da7): undefined reference to resize_scale_channels_layer'
network.c:(.text+0x1dbb): undefined reference to resize_sam_layer' obj/network.o: In function num_detections':
network.c:(.text+0x2457): undefined reference to gaussian_yolo_num_detections' obj/network.o: In function fill_network_boxes':
network.c:(.text+0x2d93): undefined reference to get_gaussian_yolo_detections' obj/network.o: In function free_network_recurrent_state':
network.c:(.text+0x514e): undefined reference to free_state_conv_lstm' obj/network.o: In function randomize_network_recurrent_state':
network.c:(.text+0x51fe): undefined reference to randomize_state_conv_lstm' obj/network.o: In function remember_network_recurrent_state':
network.c:(.text+0x52ae): undefined reference to remember_state_conv_lstm' obj/network.o: In function restore_network_recurrent_state':
network.c:(.text+0x532e): undefined reference to restore_state_conv_lstm' obj/parser.o: In function parse_conv_lstm':
parser.c:(.text+0x12e2): undefined reference to make_conv_lstm_layer' obj/parser.o: In function parse_gaussian_yolo':
parser.c:(.text+0x2a9b): undefined reference to make_gaussian_yolo_layer' obj/parser.o: In function parse_scale_channels':
parser.c:(.text+0x4f14): undefined reference to make_scale_channels_layer' obj/parser.o: In function parse_sam':
parser.c:(.text+0x503f): undefined reference to `make_sam_layer'
collect2: error: ld returned 1 exit status
Makefile:144: recipe for target 'darknet' failed
make: *** [darknet] Error 1

Is nvidia-docker supported on Jetson?

I ran ./build_docker_container.sh on my Jetson Xavier and received the error:

Step 5/9 : RUN apt-get update && apt-get install -y --no-install-recommends build-essential cmake git wget sudo python libcudnn7=$CUDNN_VERSION-1+cuda10.0 libcudnn7-dev=$CUDNN_VERSION-1+cuda10.0 && apt-mark hold libcudnn7 && rm -rf /var/lib/apt/lists/*
---> Running in 92c8d8acab95
standard_init_linux.go:211: exec user process caused "exec format error"
The command '/bin/sh -c apt-get update && apt-get install -y --no-install-recommends build-essential cmake git wget sudo python libcudnn7=$CUDNN_VERSION-1+cuda10.0 libcudnn7-dev=$CUDNN_VERSION-1+cuda10.0 && apt-mark hold libcudnn7 && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 1

Thermal Inference configurations

Hi @enesozi !
I am trying to recreate the thermal inference just like your video
https://youtu.be/xe_KRQ7qtQE

If I just want to do the inference.
Is it correct that I just need to change to use

  1. thermal.data
  2. thermal.names
  3. yolov3-thermal.cfg
  4. yolov3-spp-thermal .weights ?

Also, may I ask which python file do you use to create the inference result?
Since I should pass a single channel image to darknet. I am not quite should how should I modify it.

Please help! Thanks in advance

YOLO Weights

Hello Enes,

Thank you for your great medium post ! Could you provide the final weights you obtained for the YOLO classifier ?

Thank you !

repository does not exist

$ sudo ./run_docker_container.sh
Unable to find image 'thermal:darknet' locally
docker: Error response from daemon: pull access denied for thermal, repository does not exist or may require 'docker login'.

Ideas? Thank you.

Small, medium, large

Hi @enesozi

You mentioned you sampled the large objects from the train set. Could you shed some light, how did you do that? I am training model on the same dataset using yolov3-spp and just training the final layers as I am short of resources to train from scratch. Getting not so good results.

Inference on FLIR video

Hi @enesozi,

I was wondering if you have tried running inference on the frames of FLIR thermal video. I tried doing that using my trained weights and also yours, and for some reason, none of the weights are able to detect anything.
Wanted to know if someone had a success with your trained weights. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.