This project is based on YOLOand DETR ,using the Exdark data set for fine-tuning training. It is used to predict objects in traffic scenes (especially in low visibility). The repositories contains data set format processing files, running scripts and code to build gradio.
DETR
YOLOv8
We provide finetune DETR and yolov8n models, and plan to include more in future. mAP50 and mAP50-95 computing on part of val Exdark datasets.
name | backbone | epochs | mAP50(B) | mAP50-95(B) | Download | size |
---|---|---|---|---|---|---|
YOLOv8 | CSPLayer_2Conv | 158 | 0.718 | 0.46 | baidu | google | 5.96Mb |
DERT | ResNet50 | 40 | 0.706 | 0.394 | baidu | google | 474Mb |
In the original ExDark data set, there are a total of 12 categories, but our research is to identify driving road condition detection in outdoor situations, so we deleted the unnecessary data and only retained Bicycle, Bus, Car, and Motorbike. , People and Animal these 6 categories. Among them, Animal is merged from the two classes Cat and Dog in the original data set.
First, we read in the seven categories (Bicycle, Bus, Car, Motorbike, People, Cat, Dog) in the original data set, and after segmentation, there were 4465 pictures containing the target category. Secondly, further filtering was carried out to select only the labels of outdoor scenes, a total of 3468 images, and the cat and dog data sets were merged into the Animal data set.
We recommand you use conda to install environments.
conda create -n od python=3.9
# essential package in requirements.txt
cd od
conda install --yes --file requirements.txt
or use pip to install some important package.
pip install ultralytics
(optional) for using gradio, you also need to install gradio.
pip install gradio
if you want to train on yolov8,use Exdark2yolo.py,and chage the path in this file.
parser.add_argument('--annotations-dir', type=str,default="../data/Exdark_Annno/" , help="ExDark annotations directory.")
parser.add_argument('--images-dir', default='../data/Exdark/',type=str, help="ExDark images directory.")
parser.add_argument('--ratio', type=str, default='8:1:1', help="Ratio between train/test/val, default 8:1:1.")
parser.add_argument('--output-dir', type=str, default="../datasets/Exdark", help="Images and converted YOLO annotations output directory.")
elif convert yolo format to coco, use yolo2coco,and chage the path in this file.
coco_format_save_path='../datasets/Exdark_json/val'
yolo_format_classes_path='./classes.txt'
yolo_format_annotation_path='../datasets/Exdark/labels/val'
img_pathDir='../datasets/Exdark/images/val'
First, download our model or use your own model,place it in checkpoints folder,rename it to best_yolo.pt or best_detr.pth.
YOLOv8:use yolov8_predict.py,change the pic to your own.
DETR:use detr_predict.py,change the pic to your own.
LightValue:use lightValuePredict.py
before using, please ensure you have installed gradio.
cd scripts
python main.py
We actively welcome your pull requests! If you have any question, you send mail to 615792775@qq.com or contact we by github :)