AMB82-mini YOLOv7 Pothole Detection

Model training: kaggle.com/rkuo2000/yolov7-pothole

  1. repro GitHub - WongKinYiu/yolov7: Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
  2. create data/pothole.yaml
train: ./Datasets/pothole/train/images
val:  ./Datasets/pothole/valid/images
test: ./Datasets/pothole/test/images

# Classes
nc: 1  # number of classes
names: ['pothole']  # class names
  1. YOLOv7-Tiny Fixed Resolution Training
!sed -i "s/nc: 80/nc: 1/" cfg/training/yolov7-tiny.yaml
!sed -i "s/IDetect/Detect/" cfg/training/yolov7-tiny.yaml

AI Model Conversion

  1. Download best.pt from kaggle.com/rkuo2000/yolov7-pothole
  2. Compress best.pt to best.zip
  3. Go to Amebapro2 AI convert model, fill up your E-mail
  4. Upload best.zip
  5. Upload one (.jpg) test picture (EX. pothole_test.jpg from Pothole dataset)
  6. Email will be sent to you for the link of network_binary.nb

Example:RTSP_YOLOv7_Pothole_Detection.ino

  1. save RTSP_ObjectDetectionLoop.ino as RTSP_YOLOv7_Pothole_Detection.ino (
  2. click the recieved Email link to download network_binary.nb
  3. create NN_MDL folder in SDcard, save network_binary.nb under NN_MDL folder, and rename it to yolov7_tiny.nb
  4. plugin SDcard back to AMB82-MINI
  5. modify Sketch RTSP_YOLOv7_Pothole_Detection.ino
  6. modify SSID and PASSWD
  7. modify ObjDet.modelSelect(OBJECT_DETECTION, CUSTOMIZED_YOLOV7TINY, NA_MODEL, NA_MODEL);
  8. modify ObjectClassList.h
ObjectDetectionItem itemList[1] = {
    {0, "Pothole",		1},
};
  1. burn code into board AMB82-MINI, and run it with VLC player streaming
    image
2 Likes