This project is based on ultralytics/yolov3.
LF-YOLO (Lighter and Faster YOLO) is used to detect defect of X-ray weld image. The related paper is available here.
Download
$ git clone https://github.com/lmomoy/LF-YOLO
Train
We provide multiple versions of LF-YOLO with different widths.
$ python train.py --data coco.yaml --cfg LF-YOLO.yaml --weights '' --batch-size 1
LF-YOLO-1.25.yaml 1
LF-YOLO-0.75.yaml 1
LF-YOLO-0.5.yaml 1
Results
We test LF-YOLO on our weld defect image dataset. Other methods are trained and tested based on MMDetection.
Model | size (pixels) | mAP50test |
params (M) | FLOPS (B) |
---|---|---|---|---|
Cascasde-RCNN (ResNet50) | (1333, 800) | 90.0 | 68.9 | 243.2 |
Cascasde-RCNN (ResNet101) | (1333, 800) | 90.7 | 87.9 | 323.1 |
Faster-RCNN (ResNet50) | (1333, 800) | 90.1 | 41.1 | 215.4 |
Faster-RCNN (ResNet101) | (1333, 800) | 92.2 | 60.1 | 295.3 |
Dynamic-RCNN (ResNet50) | (1333, 800) | 90.3 | 41.1 | 215.4 |
RetinaNet (ResNet50) | (1333, 800) | 80.0 | 36.2 | 205.2 |
VFNet (ResNet50) | (1333, 800) | 87.0 | 32.5 | 197.8 |
VFNet (ResNet101) | (1333, 800) | 87.2 | 51.5 | 277.7 |
Reppoints (ResNet101) | (1333, 800) | 82.7 | 36.6 | 199.0 |
SSD300 (VGGNet) | 300 | 88.1 | 24.0 | 30.6 |
YOLOv3 (Darknet52) | 416 | 91.0 | 62.0 | 33.1 |
SSD (MobileNet v2) | 300 | 82.3 | 3.1 | 0.7 |
YOLOv3 (MobileNet v2) | 416 | 90.2 | 3.7 | 1.6 |
LF-YOLO-0.5 | 640 | 90.7 | 1.8 | 1.1 |
LF-YOLO | 640 | 92.9 | 7.4 | 17.1 |
We test our model on public dataset MS COCO, and it also achieves competitive results.
Model | size (pixels) | mAP50test |
params (M) | FLOPS (B) |
---|---|---|---|---|
YOLOv3-tiny | 640 | 34.8 | 8.8 | 13.2 |
YOLOv3 | 320 | 51.5 | 39.0 | 61.9 |
SSD | 300 | 41.2 | 35.2 | 34.3 |
SSD | 512 | 46.5 | 99.5 | 34.3 |
Faster R-CNN (VGG16) | shorter size: 800 | 43.9 | - | 278.0 |
R-FCN (ResNet50) | shorter size: 800 | 49.0 | - | 133.0 |
R-FCN (ResNet101) | shorter size: 800 | 52.9 | - | 206.0 |
LF-YOLO | 640 | 47.8 | 7.4 | 17.1 |
Requirements
Python 3.8 or later with all requirements.txt dependencies installed, including torch>=1.7
. To install run:
$ pip install -r requirements.txt
Inference
$ python detect.py --source data/images --weights LF-YOLO.pt --conf 0.25