I want to use Yolov4 object detector to detect LED matrices like the one in the attached picture. The goal of my project is to perform automated RoI of these types of LED matrices in vehicular scenarios, mainly.
Unfortunately, these type of objects are not very popular and I could not find a way to produce a good dataset for training. I've tried to train the Yolov4 algorithm with different cfg parameters but two things always happen:
Do you have any tips on how can I improve my dataset? This kind of object is not very popular. Also I'm attaching the code that I used to train the detector executed on Google Colab.
Note: I am using tiny-yolo-v4 for training due to its s
from google.colab import drive
drive.mount('/content/gdrive')
!ln -s /content/gdrive/My\ Drive/ /mydrive
%cd /mydrive/yolov4
!git clone https://github.com/AlexeyAB/darknet
%cd darknet/
!sed -i 's/OPENCV=0/OPENCV=1/' Makefile
!sed -i 's/GPU=0/GPU=1/' Makefile
!sed -i 's/CUDNN=0/CUDNN=1/' Makefile
!sed -i 's/CUDNN_HALF=0/CUDNN_HALF=1/' Makefile
!sed -i 's/LIBSO=0/LIBSO=1/' Makefile
!make
# run process.py file, used to create train.txt and test.txt from annotated images
!python process.py
!ls data/
# Here we use transfer learning. Instead of training a model from scratch, we use pre-trained YOLOv4 weights which have been trained up to 137 convolutional layers. Run the following command to download the YOLOv4 pre-trained weights file.
#!wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.conv.137
!wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.conv.29
!chmod +x ./darknet
#!./darknet detector train data/matheus.data cfg/yolov4-custom.cfg yolov4.conv.137 -dont_show -map
!./darknet detector train data/matheus.data cfg/yolov4-custom.cfg yolov4-tiny.conv.29 -dont_show -map
@theAlphaDubstep pointed important factors to increase your model performance. I would also recommend using augmentation to increase the number of instances in your dateset. there are several python libraries and online tools available for this, you can also use tensor-flow for performing data augmentation.
https://www.tensorflow.org/tutorials/images/data_augmentation https://github.com/albumentations-team/albumentations