yjh0410 2 жил өмнө
parent
commit
b1520f3a44
3 өөрчлөгдсөн 6 нэмэгдсэн , 4 устгасан
  1. 3 3
      README.md
  2. 1 0
      models/yolox/yolox.py
  3. 2 1
      train.sh

+ 3 - 3
README.md

@@ -95,9 +95,9 @@ python train.py --cuda -d coco --root path/to/COCO -v yolov1 -bs 16 --max_epoch
 |--------|-------|------|-------|------------------------|-------------------------|--------|
 |--------|-------|------|-------|------------------------|-------------------------|--------|
 | YOLOv1 |  640  |  √   |  150  |                        |                         |  |
 | YOLOv1 |  640  |  √   |  150  |                        |                         |  |
 | YOLOv2 |  640  |  √   |  150  |                        |                         |  |
 | YOLOv2 |  640  |  √   |  150  |                        |                         |  |
-| YOLOv3 |  640  |  √   |  300  |                        |                         |  |
-| YOLOv4 |  640  |  √   |  300  |                        |                         |  |
-| YOLOX  |  640  |  √   |  300  |                        |                         |  |
+| YOLOv3 |  640  |  √   |  250  |                        |                         |  |
+| YOLOv4 |  640  |  √   |  250  |                        |                         |  |
+| YOLOX  |  640  |  √   |  250  |                        |                         |  |
 
 
 *All models are trained with ImageNet pretrained weight (IP). All FLOPs are measured with a 640x640 image size on COCO val2017. The FPS is measured with batch size 1 on 3090 GPU from the model inference to the NMS operation.*
 *All models are trained with ImageNet pretrained weight (IP). All FLOPs are measured with a 640x640 image size on COCO val2017. The FPS is measured with batch size 1 on 3090 GPU from the model inference to the NMS operation.*
 
 

+ 1 - 0
models/yolox/yolox.py

@@ -100,6 +100,7 @@ class YOLOX(nn.Module):
         anchor_y, anchor_x = torch.meshgrid([torch.arange(fmp_h), torch.arange(fmp_w)])
         anchor_y, anchor_x = torch.meshgrid([torch.arange(fmp_h), torch.arange(fmp_w)])
         # [H, W, 2] -> [HW, 2]
         # [H, W, 2] -> [HW, 2]
         anchor_xy = torch.stack([anchor_x, anchor_y], dim=-1).float().view(-1, 2)
         anchor_xy = torch.stack([anchor_x, anchor_y], dim=-1).float().view(-1, 2)
+        anchor_xy += 0.5  # add center offset
         anchor_xy *= self.stride[level]
         anchor_xy *= self.stride[level]
         anchors = anchor_xy.to(self.device)
         anchors = anchor_xy.to(self.device)
 
 

+ 2 - 1
train.sh

@@ -1,4 +1,4 @@
-# Train FreeYOLO
+# Train YOLO on VOC
 python train.py \
 python train.py \
         --cuda \
         --cuda \
         -d coco \
         -d coco \
@@ -15,3 +15,4 @@ python train.py \
         # --resume weights/coco/yolo_free_vx_pico/yolo_free_vx_pico_epoch_41_20.46.pth \
         # --resume weights/coco/yolo_free_vx_pico/yolo_free_vx_pico_epoch_41_20.46.pth \
         # --pretrained weights/coco/yolo_free_medium/yolo_free_medium_39.46.pth \
         # --pretrained weights/coco/yolo_free_medium/yolo_free_medium_39.46.pth \
         # --eval_first
         # --eval_first
+