BumbleBee-BBStream / yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
GNU General Public License v3.0
0 stars 0 forks source link

Small_defect_v6.3_JinChuan detect defect of battery #16

Closed Samuel-wei closed 9 months ago

Samuel-wei commented 1 year ago

August 6, 2023 晋川数据训练--小料

Training Version: small_defect_JinChuan_V6.3

  1. --Base dataset--Making balance every camera frames

    camera-0123, total: 13160 1./home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/train_images(13160) 2./home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/train_xmls(13160)

Validation dataset

  1. /home/workspace/BatteryDataSet/Data_xml/14_defect_JinChuan_V6.3/val_images(4759)&val_xmls(4759)

Test-dev

  1. /home/workspace/BatteryDataSet/Data_xml/TestData/NG_14_20220907(448)&NG_14_20220907_xml(448)

$ docker exec -it yolov7_pytorch_devel python3 python3 BatteryDetect.py --weights /home/workspace/BatteryDetect/models/14_defect_JinChuan_V6.3/weights/best.pt --conf 0.3 --img-size 640 --device 0 --source /home/workspace/Batt eryDataSet/Data_xml/TestData/NG_14_20220907

Image

  1. /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6/val_14_FP_V6.1.1_N5 $ docker exec -it yolov7_pytorch_devel python3 BatteryDetect.py --weights /home/workspace/BatteryDetect/models/14_defect_JinChuan_V6.3/weights/best.pt --conf 0.3 --img-size 640 --device 0 --source /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6/val_14_FP_V6.1.1_N5

Image

  1. /home/workspace/BatteryDataSet/Data_xml/14_defect_JinChuan_V6/small_14_ok_V5.1.0_tp $ python3 BatteryDetect.py --weights /home/workspace/BatteryDetect/models/14_defect_JinChuan_V6.3/weights/best.pt --conf 0.3 --img-size 640 --device 0 --source /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6/small_14_ok_V5.1.0_tp

Image

Result

August 26, 2023,晋川数据训练--小料

  1. --Base dataset--Making balance every camera frames

    camera-0123, total: 13160 1./home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/train_images(13160) 2./home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/train_xmls(13160)

Validation dataset

  1. /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/val_images(4759)
  2. /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/val_xmls(4759)

Test-dev

  1. /home/workspace/BatteryDataSet/Data_xml/TestData/NG_14_20220907(448)
  2. /home/workspace/BatteryDataSet/Data_xml/TestData/NG_14_20220907_xml(448)

$ docker exec -it yolov7_pytorch_devel python3 BatteryDetect.py --weights /home/workspace/yolov7/runs/train/small_defect_JinChuan_V6.3/weights/best.pt --conf 0.1 --img-size 640 --device 0 --source /home/workspace/BatteryDataSet/Data_xml/TestData/NG_14_20220907

Image

Result

Image

Image

Samuel-wei commented 1 year ago
  1. How to influence the model effect by the validation dataset;
Samuel-wei commented 1 year ago
  1. For the defect data to balance, create a script to select the lower IOU defect picture to augument it;
Samuel-wei commented 1 year ago

Training Version: small_defect_JinChuan_V6.3.1

  1. --Base dataset--Making balance every camera frames 1./home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/train_images(13160) 2./home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/train_xmls(13160)

Perform: -- conf 0.1 Image

if_rotate = True #0.6-0.7 True if_flip = True #0.5-0.6 True if_contrast_and_brightness = False #0.4-0.5 True if_crop = False #0.3-0.4 True

Validation dataset

  1. /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/val_images(4759)
  2. /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/val_xmls(4759)

Test-dev

  1. /home/workspace/BatteryDataSet/Data_xml/TestData/NG_14_20220907(448)
  2. /home/workspace/BatteryDataSet/Data_xml/TestData/NG_14_20220907_xml(448)

Image

Result

Samuel-wei commented 1 year ago

Training Version: small_defect_JinChuan_V6.3.2

From the weights:

$ docker exec -it yolov7_pytorch_devel python3 train.py --epochs 100 --workers 4 --device 0 --batch-size 32 --data data/battery.yaml --img 640 640 --cfg cfg/training/battery-tiny.yaml --weights '/home/workspace/yolov7/runs/train/small_defect_JinChuan_V6.3/weights/best.pt' --name small_defect_JinChuan_V6.3.2 --hyp data/hyp.scratch.tiny.yaml

  1. --Base dataset--Making balance every camera frames 1./home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/train_images(13160) 2./home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/train_xmls(13160)

Perform: -- conf 0.1 Image

if_rotate = True #0.6-0.7 True if_flip = True #0.5-0.6 True if_contrast_and_brightness = False #0.4-0.5 True if_crop = False #0.3-0.4 True

Validation dataset

  1. /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/val_images(4759)
  2. /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/val_xmls(4759)

Test-dev

  1. /home/workspace/BatteryDataSet/Data_xml/TestData/NG_14_20220907(448) 2./home/workspace/BatteryDataSet/Data_xml/TestData/NG_14_20220907_xml(448)

$ docker exec -it yolov7_pytorch_devel python3 BatteryDetect.py --weights /home/workspace/yolov7/runs/train/small_defect_JinChuan_V6.3.2/weights/best.pt --conf 0.1 --img-size 640 --device 0 --source /home/workspace/BatteryDataSet/Data_xml/TestData/NG_14_20220907 Image

Result

Image

Image

Samuel-wei commented 1 year ago

Training Version: small_defect_JinChuan_V6.3.3

From the weights:

$ docker exec -it yolov7_pytorch_devel python3 train.py --epochs 100 --workers 4 --device 0 --batch-size 32 --data data/battery.yaml --img 640 640 --cfg cfg/training/battery-tiny.yaml --weights '/home/workspace/yolov7/runs/train/small_defect_JinChuan_V6.3/weights/best.pt' --name small_defect_JinChuan_V6.3.3 --hyp data/hyp.scratch.tiny.yaml

  1. --Base dataset--Making balance every camera frames 1./home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/train_images(13160) 2./home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/train_xmls(13160)

Add new dataset and augmentation: /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/0.1-0.2/(1563) Perform: -- conf 0.1 Image

if_rotate = True #0.6-0.7 True if_flip = True #0.5-0.6 True if_contrast_and_brightness = False #0.4-0.5 True if_crop = False #0.3-0.4 True

Validation dataset

  1. /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/val_images(4759)
  2. /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/val_xmls(4759)

Test-dev

  1. /home/workspace/BatteryDataSet/Data_xml/TestData/NG_14_20220907(448) 2./home/workspace/BatteryDataSet/Data_xml/TestData/NG_14_20220907_xml(448)

Image

Result

Image

Image

Samuel-wei commented 1 year ago

September 12, 2023,晋川数据训练--小料

Training Version: small_defect_JinChuan_V6.3.4

  1. --Base dataset--Making balance every camera frames

    camera-0123, total: 13160 1./home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/train_images(13160) 2./home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/train_xmls(13160)

Validation dataset

$ docker exec -it yolov7_pytorch_deve python3 BatteryDetect.py --weights /home/workspace/yolov7/runs/train/small_defect_JinChuan_v6.3.0/weights/best.pt --conf 0.1 --img-size 640 --device 0 --source /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/val_images/`

Image

Add new dataset from get the 0.1-0.5 to augmentation with rotate parameter: if_rotate = True

  1. /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/v6.3.4_val_img/(2733)
  2. /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/v6.3.4_val_img_xml(2733)

Training On HuaWei

$ docker exec -it yolov7_pytorch_devel python3 train.py --epochs 100 --workers 4 --device 0 --batch-size 32 --data data/battery.yaml --img 640 640 --cfg cfg/training/battery-tiny.yaml --weights '/home/workspace/yolov7/runs/train/small_defect_JinChuan_V6.3/weights/best.pt' --name small_defect_JinChuan_V6.3.3 --hyp data/hyp.scratch.tiny.yaml

Test-dev

  1. /home/workspace/BatteryDataSet/Data_xml/TestData/NG_14_20220907(448) 2./home/workspace/BatteryDataSet/Data_xml/TestData/NG_14_20220907_xml(448)

$ docker exec -it yolov7_pytorch_devel python3 BatteryDetect.py --weights /home/workspace/yolov7/runs/train/small_defect_JinChuan_V6.3.4/weights/best.pt --conf 0.1 --img-size 640 --device 0 --source /home/workspace/BatteryDataSet/Data_xml/TestData/NG_14_20220907

Image

Result

Image

Samuel-wei commented 1 year ago

September 19, 2023,晋川数据训练--Small detect

Training Version: small_defect_JinChuan_V6.3.5 -- YOLOv7

Camera-0123, total:

  1. /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6.3/train_images(13160)&train_xmls(13160)
  2. /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6/14_FP_V6.0.4(2510 xml,jpg)
  3. /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6/14_FP_V6.1.1_N1-N4(1700 xml,jpg)
  4. /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6/14_FP_V6.3.0_N1(664 xml,jpg)

Validation dataset

Camera-0123, total: 1477

  1. /home/workspace/BatteryDetect/xmldata/small_defect_JinChuan_V5/test_14_20220803_20220802(1900)
  2. /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6/14_FP_V6.1.1(522_xml,jpg)

Training On HuaWei

$ docker exec -it yolov7_pytorch_devel python3 train.py --epochs 100 --workers 4 --device 0 --batch-size 32 --data data/battery.yaml --img 640 640 --cfg cfg/training/battery-tiny.yaml --weights '/home/workspace/yolo_weights/yolov7-tiny.pt' --name small_defect_JinChuan_V6.3.5 --hyp data/hyp.scratch.tiny.yaml

Result

Image

Image

Test-dev

  1. /home/workspace/BatteryDataSet/Data_xml/TestData/NG_14_20220907(448) $ docker exec -it yolov7_pytorch_devel python3 BatteryDetect.py --weights /home/workspace/BatteryDetect/models/14_defect_JinChuan_V6.3.5/weights/best.pt --conf 0.3 --img-size 640 --device 0 --source /home/workspace/BatteryDataSet/Data_xml/TestData/NG_14_20220907
  1. /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6/val_14_FP_V6.1.1_N5 $ docker exec -it yolov7_pytorch_devel python3 BatteryDetect.py --weights /home/workspace/BatteryDetect/models/14_defect_JinChuan_V6.3.5/weights/best.pt --conf 0.3 --img-size 640 --device 0 --source /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6/val_14_FP_V6.1.1_N5

Image

  1. /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6/small_14_ok_V5.1.0_tp $ docker exec -it yolov7_pytorch_devel python3 BatteryDetect.py --weights /home/workspace/BatteryDetect/models/14_defect_JinChuan_V6.3.5/weights/best.pt --conf 0.3 --img-size 640 --device 0 --source /home/workspace/BatteryDataSet/Data_xml/small_defect_JinChuan_V6/small_14_ok_V5.1.0_tp

Image