{"id":17294775,"url":"https://github.com/machinecyc/compareyolov3m2det","last_synced_at":"2026-01-06T12:35:40.231Z","repository":{"id":122134629,"uuid":"191128120","full_name":"machineCYC/CompareYOLOv3M2Det","owner":"machineCYC","description":null,"archived":false,"fork":false,"pushed_at":"2019-07-23T10:52:11.000Z","size":2719,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T01:51:22.427Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/machineCYC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-10T08:29:30.000Z","updated_at":"2019-07-23T10:52:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"7b8c7b26-9579-4b59-82c9-cacb3f8cac0a","html_url":"https://github.com/machineCYC/CompareYOLOv3M2Det","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machineCYC%2FCompareYOLOv3M2Det","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machineCYC%2FCompareYOLOv3M2Det/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machineCYC%2FCompareYOLOv3M2Det/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machineCYC%2FCompareYOLOv3M2Det/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/machineCYC","download_url":"https://codeload.github.com/machineCYC/CompareYOLOv3M2Det/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245727635,"owners_count":20662552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T11:07:59.072Z","updated_at":"2026-01-06T12:35:40.194Z","avatar_url":"https://github.com/machineCYC.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compare YOLOv3 M2Det\n\n## Environment\n\n| os | nvidia-driver | cuda | cudnn | GPU |\n| --- | --- | --- | --- |--- |\n| ubuntu 18.04 (64) | 390.48 | 9.0 | 7.0 | GeForce 1060(6G) |\n\n## M2Det\n\n-\n\n## YOLO\n\n- YOLOv1\n    - 將物件偵測的問題轉換成回歸問題，直接預測 bounding box 和類別的機率\n    - 針對整張照片所能提供的資訊進行預測，與 sliding windows 和 region proposal 不太一樣。所以將背景預測成物體的機率就將對低 (與 Fast-R-CNN 相比)，但也導致 recall 下降。\n    - 結構上是單一結構，因此可以 end-to-end 的訓練\n    - loss function 則是將 localization error 和 classfication error 整合在一起，並透過不同權重來提升模型訓練時的穩定度\n    - 針對較小的物件表現也相對不穩定，主要是因為小的物件 localization error 相對也較小\n\n- YOLO2\n    - 主要是針對 YOLOv1 較弱的部分進行加強 (localization 和 recall 相對 region propsal 比較差)\n    - 新增 Batch Normailzation，取代 dropout，加速模型訓練和提升 mAP 2%\n    - 訓練方式的調整，YOLOv1 預訓練時用 224*224，detection 使用 448*448。YOLOv2 則是從頭先訓練 224*224 一部分 epoch，在調整成 448*448，減緩圖片因為解析度轉換的 gap，因此提升 4% mAP\n    - 移除最後的全連接層，新增 anchor，但也因為這樣 mAP 略為下降，但 recall 提高\n    - 透過 kmaen 來決定 anchor 的比例，相對於用人為經驗來的好\n    - 新增 passthrough layer (類似 ResNet)，將 26*26 的 fature map 和 13*13 的 fature map 做連接，提升較小 object 的偵測能力 (因為小物件可能在 pooling 的過程中就被稀釋了)\n    - 在最後 fine tune detection 時，引入 Multi-Scale Training，也就是輸入圖像是動態的\n\n- YOLOv3\n    - 類別預測 softmax 更改成 sigmoid，可以面對 label 是有 overlap (person、woman)\n    - 在三個不同 scale size 上做偵測，可以針對小的物件提高預測的能力\n    - pooling 的部分全改成捲基層\n\n## Summary\n\n下列比較是基於 YOLOv3 和 M2Det paper 所公開的 pretrained model 來比較\n\n- 這邊所使用的 M2Det 是 vgg512 版本\n- YOLOv3 則是 320、416、608 版本\n- 實測上 yolov3 速度相對於 m2det 來的慢, 目前推測是 m2det 運算的方式有較多可以透過 GPU 加速 (在 run code 過程中有注意到 GPU 使用量)\n- 不論是 yolov3 還是 m2det 對於間隔倒的鐵柵欄都會勿判成腳踏車 (如下列圖示), 其中 yolov3(下下圖60%左右) 的 confidence 右更勝於 m2det(下圖30％左右)\n- 至於目前大家比較在意小物件的偵測狀況,個人認為由這隻影片觀察兩者是似乎差不多的\n\n![](img/m2det.png)\n\n![](img/yolov3.png)\n\n\n| Model | fps | excute time | total frame |\n| --- | --- | --- | --- |\n| YOLOv3-320 | 3.30 | 1813.016 | 5986 |\n| YOLOv3-416 | 3.34 | 1790.327 | 5986 |\n| YOLOv3-608 | 3.3 | 1813.77 | 5986 |\n| M2Det | 7.38 | 810.64 | 5986 |\n\nM2Det: python 3367, GPU 3990 MiB\n\n## Reference\n\n- [測試影片連結](https://www.youtube.com/watch?v=yzFcXUO0HTA)\n\n- [darknet](https://github.com/pjreddie/darknet)\n\n- [YOLOv3 Source Code](https://github.com/iArunava/YOLOv3-Object-Detection-with-OpenCV)\n\n- [M2Det Source Code](https://github.com/qijiezhao/M2Det)\n\n- [YOLOv1 paper](https://www.cv-foundation.org/openaccess/content_cvpr_2016/papers/Redmon_You_Only_Look_CVPR_2016_paper.pdf)\n\n- [YOLOv2 paper](http://openaccess.thecvf.com/content_cvpr_2017/papers/Redmon_YOLO9000_Better_Faster_CVPR_2017_paper.pdf)\n\n- [YOLOv3 paper](https://pjreddie.com/media/files/papers/YOLOv3.pdf)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachinecyc%2Fcompareyolov3m2det","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmachinecyc%2Fcompareyolov3m2det","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachinecyc%2Fcompareyolov3m2det/lists"}