Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yolov5m-four #6

Closed
SpongeBab opened this issue Jul 20, 2021 · 1 comment
Closed

yolov5m-four #6

SpongeBab opened this issue Jul 20, 2021 · 1 comment
Labels
enhancement New feature or request Stale

Comments

@SpongeBab
Copy link
Owner

SpongeBab commented Jul 20, 2021

🚀 Feature

yolov5-m-four

# Parameters
nc: 80  # number of classes
depth_multiple: 0.67  # model depth multiple
width_multiple: 0.75  # layer channel multiple
anchors: 3
#  - [10,13, 16,30, 33,23]  # P3/8
#  - [30,61, 62,45, 59,119]  # P4/16
#  - [116,90, 156,198, 373,326]  # P5/32

# YOLOv5 backbone
backbone:
  # [from, number, module, args]
  [ [ -1, 1, Focus, [ 64, 3 ] ],  # 0-P1/2
    [ -1, 1, Conv, [ 128, 3, 2 ] ],  # 1-P2/4
    [ -1, 3, C3, [ 128 ] ],
    [ -1, 1, Conv, [ 256, 3, 2 ] ],  # 3-P3/8
    [ -1, 9, C3, [ 256 ] ],
    [ -1, 1, Conv, [ 512, 3, 2 ] ],  # 5-P4/16
    [ -1, 9, C3, [ 512 ] ],
    [ -1, 1, Conv, [ 1024, 3, 2 ] ],  # 7-P5/32
    [ -1, 1, SPP, [ 1024, [ 5, 9, 13 ] ] ],
    [ -1, 3, C3, [ 1024, False ] ],  # 9
  ]

# YOLOv5 head
head:
  [ [ -1, 1, Conv, [ 512, 1, 1 ] ],
    [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
    [ [ -1, 6 ], 1, Concat, [ 1 ] ],  # cat backbone P4
    [ -1, 3, C3, [ 512, False ] ],  # 13

    [ -1, 1, Conv, [ 256, 1, 1 ] ],
    [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
    [ [ -1, 4 ], 1, Concat, [ 1 ] ],  # cat backbone P3
    [ -1, 3, C3, [ 256, False ] ],  # 17 (P3/8-small)

    [ -1, 1, Conv, [ 128, 1, 1 ] ],
    [ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
    [ [ -1, 2 ], 1, Concat, [ 1 ] ],  # cat backbone P2
    [ -1, 1, C3, [ 128, False ] ],  # 21 (P2/4-xsmall)

    [ -1, 1, Conv, [ 128, 3, 2 ] ],
    [ [ -1, 18 ], 1, Concat, [ 1 ] ],  # cat head P3
    [ -1, 3, C3, [ 256, False ] ],  # 24 (P3/8-small)

    [ -1, 1, Conv, [ 256, 3, 2 ] ],
    [ [ -1, 14 ], 1, Concat, [ 1 ] ],  # cat head P4
    [ -1, 3, C3, [ 512, False ] ],  # 20 (P4/16-medium)

    [ -1, 1, Conv, [ 512, 3, 2 ] ],
    [ [ -1, 10 ], 1, Concat, [ 1 ] ],  # cat head P5
    [ -1, 3, C3, [ 1024, False ] ],  # 23 (P5/32-large)

    [ [ 21, 24, 27, 30 ], 1, Detect, [ nc, anchors ] ],  # Detect(P2, P3, P4, P5)
  ]

result:
yolov5m:

val: Scanning '..\Dataset\desk_3_400\valid.cache' images and labels... 50 found, 0 missing, 0 empty, 0 corrupted: 100%|██████████| 50/50 [00:00<?, ?it/s]
               Class     Images     Labels          P          R     mAP@.5 mAP@.5:.95: 100%|██████████| 25/25 [00:04<00:00,  6.17it/s]
                 all         50       1532      0.994      0.964      0.988      0.764
Speed: 0.4ms pre-process, 20.2ms inference, 2.7ms NMS per image at shape (2, 3, 640, 640)
Results saved to runs\test\desk-400-m-640-300-bs3-bs2

mAp: 0.764, latency: 23.3ms

yolov5m-four:

val: Scanning '..\Dataset\desk_3_400\valid.cache' images and labels... 50 found, 0 missing, 0 empty, 0 corrupted: 100%|██████████| 50/50 [00:00<?, ?it/s]
               Class     Images     Labels          P          R     mAP@.5 mAP@.5:.95: 100%|██████████| 25/25 [00:04<00:00,  5.25it/s]
                 all         50       1532      0.989      0.945      0.982      0.745
Speed: 0.4ms pre-process, 27.6ms inference, 3.2ms NMS per image at shape (2, 3, 640, 640)
Results saved to runs\test\desk-400-m-four-640-300-bs2-bs2

mAP: 0.745, latency: 31.2ms

yolov5m: mAp: 0.764, latency: 23.3ms
yolov5m-four: mAP: 0.745, latency: 31.2ms

I think the reason for the lower mAP is batch-size.

@SpongeBab SpongeBab added the enhancement New feature or request label Jul 20, 2021
@SpongeBab SpongeBab changed the title yolov5-m-four yolov5m-four Jul 20, 2021
@github-actions
Copy link

github-actions bot commented Nov 3, 2021

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

Access additional Ultralytics ⚡ resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐!

@github-actions github-actions bot added the Stale label Nov 3, 2021
@github-actions github-actions bot closed this as completed Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stale
Projects
None yet
Development

No branches or pull requests

1 participant