#cv# #视觉# #检测#
task1:
基于赛事:2024“大运河杯”数据开发应用创新大赛——城市治理(目标:能够自动检测和分类城市管理中的违规行为)
1.下载基线模型相关数据(基于YOLOv8n模型):
apt install git-lfs
git lfs install
git clone https://www.modelscope.cn/datasets/Datawhale/AI_Camp5_baseline_CV.git
2.根据AI_Camp5_baseline_CV中的task1.ipynb运行基线模型:
3.将结果运行后的result.zip上传竞赛官网,得出第一次的分数。
task2:
- task2
- 1.再次加深json的读取和写入方式,以及检测框的画法。
- 2.巩固了一下相关知识
- 3.JSON数据集转换为YOLO数据集的代码重新理解。
- 根据直播和baseline精读教程,尝试进行精度提高。s模型(达到0.1688)
- 改动如下:数据集量增加,选用s模型深度更大,训练轮数增加为50轮。
- for anno_path, video_path in zip(train_annos[:20], train_videos[:20]):
- for anno_path, video_path in zip(train_annos[-3:], train_videos[-3:]):
- !wget -q http://mirror.coggle.club/yolo/yolov8s-v8.2.0.pt -O yolov8s.pt
- !wget -q http://mirror.coggle.club/yolo/Arial.Unicode.ttf -O ~/.config/Ultralytics/Arial.Unicode.ttf
- results = model.train(data="yolo-dataset/yolo.yaml", epochs=50, imgsz=1080, batch=16)
- 重新尝试改进提高精度(依旧是n模型)--成功提分达到0.1624
- 改动如下:增加数据量,增加训练轮数
- for anno_path, video_path in zip(train_annos[:15], train_videos[:15]):
- for anno_path, video_path in zip(train_annos[-3:], train_videos[-3:]):
- results = model.train(data="yolo-dataset/yolo.yaml", epochs=20, imgsz=1080, batch=16, optimizer="SGD)
- n模型进一步尝试:轮数设置50轮(提分至0.2664379316520224)train9
- for anno_path, video_path in zip(train_annos[:20], train_videos[:20]):
- for anno_path, video_path in zip(train_annos[-3:], train_videos[-3:]):
- results = model.train(data="yolo-dataset/yolo.yaml", epochs=50, imgsz=1080, batch=16, optimizer="SGD)
- s模型进一步尝试:轮数设置3轮(提分至0.125)train10
- for anno_path, video_path in zip(train_annos[:30], train_videos[:30]):
- for anno_path, video_path in zip(train_annos[-3:], train_videos[-3:]):
- results = model.train(data="yolo-dataset/yolo.yaml", epochs=3, imgsz=1080, batch=16, optimizer="SGD)
task3:
- n模型进一步尝试上分:启动nms和数据增强,轮数设置100轮(提分至0.2204150974425324)train11
- for anno_path, video_path in zip(train_annos[:30], train_videos[:30]):
- for anno_path, video_path in zip(train_annos[-3:], train_videos[-3:]):
- results = model.train(data="yolo-dataset/yolo.yaml", epochs=100, imgsz=1080, batch=16, optimizer="SGD, augment=True, agnostic_nms=True)