yjh0410 hace 1 año
padre
commit
1a3b1d7a21
Se han modificado 2 ficheros con 3 adiciones y 10 borrados
  1. 3 3
      README.md
  2. 0 7
      yolo/benchmark.py

+ 3 - 3
README.md

@@ -23,8 +23,8 @@
 | YOLOv1-R18  | 1xb16 |  640  |       73.8        | [ckpt](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/yolov1_r18_voc.pth) | [log](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/YOLOv1-R18-VOC.txt) |
 | YOLOv2-R18  | 1xb16 |  640  |       75.1        | [ckpt](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/yolov2_r18_voc.pth) | [log](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/YOLOv2-R18-VOC.txt) |
 | YOLOv3-S    | 1xb16 |  640  |       77.1        | [ckpt](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/yolov3_s_voc.pth) | [log](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/YOLOv3-S-VOC.txt) |
-| YOLOv5-S    | 1xb16 |  640  |       81.2        | [ckpt]() | [log]() |
-| YOLOv5-AF-S | 1xb16 |  640  |               | [ckpt]() | [log]() |
+| YOLOv5-S    | 1xb16 |  640  |       81.2        | [ckpt](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/yolov5_s_voc.pth) | [log](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/YOLOv5-S-VOC.txt) |
+| YOLOv5-AF-S | 1xb16 |  640  |       83.4        | [ckpt]() | [log]() |
 | YOLOv8-S    | 1xb16 |  640  |               | [ckpt]() | [log]() |
 | GELAN-S     | 1xb16 |  640  |               | [ckpt]() | [log]() |
 
@@ -40,7 +40,7 @@
 | YOLOv8-S    | 1xb16 |  640  |            70            |         42.5          |       59.3        |   28.4            |   11.3            | [ckpt](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/yolov8_s_coco.pth) | [log](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/YOLOv8-S-COCO.txt) |
 | GELAN-S     | 1xb16 |  640  |            32            |         42.6          |       58.8        |   27.1 (26.4)     |   7.1 (7.2)            | [ckpt](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/gelan_s_coco.pth) | [log](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/GELAN-S-COCO.txt) |
 
-需要说明的是,对于GELAN-S,未进行重参数化时,模型参数量为7.1 M,理论计算量为27.1 GFLOPs;经过重参数化处理后,模型参数量为7.2 M,理论计算量为26.4 GFLOPs。测试的GELAN-S的FPS很低,因为它的regression head部分用到了group=4的分组卷积,由于PyTorch框架本身没有对这个操作做优化,因此,虽然分组卷积的理论计算量会更低,但在不做加快优化的情况下,推理速度会慢于group=1的普通卷积,类似的现象在depthwise卷积中也能看到。因此,这里测试的GELAN-S的速度不具备参考性
+需要说明的是,对于GELAN-S,未进行重参数化时,模型参数量为7.1 M,理论计算量为27.1 GFLOPs;经过重参数化处理后,模型参数量为7.2 M,理论计算量为26.4 GFLOPs。然而,GELAN-S的FPS很低,起初,以为是因为它的regression head部分用到了group=4的分组卷积,由于PyTorch框架本身没有对这个操作做优化,因此,虽然分组卷积的理论计算量会更低,但在不做加快优化的情况下,推理速度会慢于group=1的普通卷积,类似的现象在depthwise卷积中也能看到。但是,即便将group=4修改为group=1,依旧不超过35 FPS,远远低于YOLOv8-S的速度
 
 ### RT-DETR系列
 下表汇报了本项目的RT-DETR系列在COCO数据集上的性能指标。所有模型都采用4张3090显卡训练的,在训练中,每张3090显卡上的batch size被设置为4,并使用多卡同步BN来计算BN层的统计量。需要说明的是,官方的RT-DETR所汇报的FPS指标,是经过各种加速处理后所测得的,因而会很高,而这里我们没有做加速处理,也没有编译CUDA版本的Deformable Attention算子,纯纯的PyTorch框架实现的,且使用的是4060显卡,而非诸如3090和V100等高算力显卡,因此,FPS指标会显著低于论文中所汇报的指标。

+ 0 - 7
yolo/benchmark.py

@@ -1,9 +1,5 @@
 import argparse
-import cv2
-import os
 import time
-import numpy as np
-from copy import deepcopy
 import torch
 
 # load transform
@@ -11,9 +7,6 @@ from dataset.build import build_dataset, build_transform
 
 # load some utils
 from utils.misc import load_weight, compute_flops
-from utils.box_ops import rescale_bboxes
-from utils.vis_tools import visualize
-
 from config import build_config
 from models import build_model