YOLOv7 for Mayan Structures Detection

Testing

python test_yolov7.py --data ./conf_yolov7/lidar.yaml --img 320 --batch 32 --conf 0.001 --iou 0.65 --device 0 --weights yolov7.pt --name yolov7_lidar_val

You will get the results:

 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.51206
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.69730
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.55521
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.35247
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.55937
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.66693
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.38453
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.63765
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.68772
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.53766
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.73549
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.83868

To measure accuracy, download COCO-annotations for Pycocotools to the ./coco/annotations/instances_val2017.json

Training

Single GPU training (Note that the argument "--name" cannot contain any capital characters)

# train p5 models
python train_yolov7.py --epochs 150 --workers 16 --device 0 --batch-size 32 --data ./conf_yolov7/lidar.yaml --img 320 320 --cfg ./conf_yolov7/yolov7_lidar.yaml --weights '' --name lidardet --hyp ./yolov7/data/hyp.scratch.p5.yaml

Re-parameterization

See reparameterization.ipynb

Inference

On image:

python inference_yolov7.py --weights ./runs/train/lidardet/weights/best.pt --conf 0.4 --img-size 320 --save-label