├── models ├── __init__.py ├── hub │ ├── yolov5-fpn.yaml │ ├── yolov5-panet.yaml │ └── yolov3-spp.yaml ├── yolov5l.yaml ├── yolov5m.yaml ├── yolov5s.yaml ├── yolov5x.yaml ├── export.py ├── common.py ├── experimental.py └── yolo.py ├── tutorial.ipynb ├── utils ├── __init__.py ├── google_app_engine │ ├── additional_requirements.txt │ ├── app.yaml │ └── Dockerfile ├── evolve.sh ├── activations.py ├── google_utils.py └── torch_utils.py ├── best └── archive │ ├── version │ ├── data │ ├── 94002730776240 │ ├── 94002730864720 │ ├── 94002730879664 │ ├── 94002731026912 │ ├── 94002731104368 │ ├── 94002731145984 │ ├── 94002731238848 │ ├── 94002732665808 │ ├── 94002732766656 │ ├── 94002733366256 │ ├── 94002733377408 │ ├── 94002733390368 │ ├── 94002733710944 │ ├── 94002733772608 │ ├── 94002733797728 │ ├── 94002733868160 │ ├── 94002734031104 │ ├── 94002734384464 │ ├── 94002769348576 │ ├── 94002769526960 │ ├── 94002770182496 │ ├── 94002770289344 │ ├── 94002771350288 │ ├── 94002771399856 │ ├── 94002771475792 │ ├── 94002771906320 │ ├── 94002776070736 │ ├── 94002777459184 │ ├── 94002779964064 │ ├── 94002779991216 │ ├── 94002780201888 │ ├── 94002780403392 │ ├── 94002784101920 │ ├── 94002785366736 │ ├── 94002787489520 │ ├── 94002787975904 │ ├── 94002788058176 │ ├── 94002788442080 │ ├── 94002788475680 │ ├── 94002788572560 │ ├── 94002789857552 │ ├── 94002789864208 │ ├── 94002790980672 │ ├── 94002791050896 │ ├── 94002791313632 │ ├── 94002791673456 │ ├── 94002791752848 │ ├── 94002791844128 │ ├── 94002792102032 │ ├── 94002792110112 │ ├── 94002793803376 │ ├── 94002793805824 │ ├── 94002794907072 │ ├── 94002796759968 │ ├── 94002796762432 │ ├── 94002796777888 │ ├── 94002796797120 │ ├── 94002796871616 │ ├── 94002796883360 │ ├── 93999994411472 │ ├── 93999994457120 │ ├── 94000004213584 │ ├── 94000004239008 │ ├── 94002730778848 │ ├── 94002730799312 │ ├── 94002730812304 │ ├── 94002730817088 │ ├── 94002730819552 │ ├── 94002730858144 │ ├── 94002730871792 │ ├── 94002730913888 │ ├── 94002730974080 │ ├── 94002730982624 │ ├── 94002730986144 │ ├── 94002730993360 │ ├── 94002731010720 │ ├── 94002731022496 │ ├── 94002731023680 │ ├── 94002731043056 │ ├── 94002731064496 │ ├── 94002731146080 │ ├── 94002731167952 │ ├── 94002731171312 │ ├── 94002731195136 │ ├── 94002731199648 │ ├── 94002731199984 │ ├── 94002731215184 │ ├── 94002731224848 │ ├── 94002731229632 │ ├── 94002731235648 │ ├── 94002731236768 │ ├── 94002731302992 │ ├── 94002731336480 │ ├── 94002731342512 │ ├── 94002731348496 │ ├── 94002732573040 │ ├── 94002732588960 │ ├── 94002732589792 │ ├── 94002732612560 │ ├── 94002732612736 │ ├── 94002732640176 │ ├── 94002732646736 │ ├── 94002732667168 │ ├── 94002732684496 │ ├── 94002732685344 │ ├── 94002732706624 │ ├── 94002732720208 │ ├── 94002732728592 │ ├── 94002732762160 │ ├── 94002732773312 │ ├── 94002732774032 │ ├── 94002732799392 │ ├── 94002732860880 │ ├── 94002732863408 │ ├── 94002732870656 │ ├── 94002733159792 │ ├── 94002733186608 │ ├── 94002733195584 │ ├── 94002733204592 │ ├── 94002733287216 │ ├── 94002733294864 │ ├── 94002733297248 │ ├── 94002733325664 │ ├── 94002733358352 │ ├── 94002733369824 │ ├── 94002733412528 │ ├── 94002733464160 │ ├── 94002733468944 │ ├── 94002733494992 │ ├── 94002733530288 │ ├── 94002733561456 │ ├── 94002733579680 │ ├── 94002733584592 │ ├── 94002733616128 │ ├── 94002733731456 │ ├── 94002733739072 │ ├── 94002733740528 │ ├── 94002733803104 │ ├── 94002733830016 │ ├── 94002733862800 │ ├── 94002733879024 │ ├── 94002733901184 │ ├── 94002733936800 │ ├── 94002733953856 │ ├── 94002733977232 │ ├── 94002734001232 │ ├── 94002734070464 │ ├── 94002734071248 │ ├── 94002734377568 │ ├── 94002734427488 │ ├── 94002734533040 │ ├── 94002734555584 │ ├── 94002734555936 │ ├── 94002734558336 │ ├── 94002755836784 │ ├── 94002764231200 │ ├── 94002764253296 │ ├── 94002764415392 │ ├── 94002764420400 │ ├── 94002768690112 │ ├── 94002768690256 │ ├── 94002768913584 │ ├── 94002769348752 │ ├── 94002769351312 │ ├── 94002769403120 │ ├── 94002769486368 │ ├── 94002769505120 │ ├── 94002769517376 │ ├── 94002769521200 │ ├── 94002769535248 │ ├── 94002770134992 │ ├── 94002770137968 │ ├── 94002770138064 │ ├── 94002770147904 │ ├── 94002770151040 │ ├── 94002770152288 │ ├── 94002770163232 │ ├── 94002770240752 │ ├── 94002770255456 │ ├── 94002770298656 │ ├── 94002770316448 │ ├── 94002770415248 │ ├── 94002770423904 │ ├── 94002770424144 │ ├── 94002770441632 │ ├── 94002771252128 │ ├── 94002771283424 │ ├── 94002771295040 │ ├── 94002771321296 │ ├── 94002771346608 │ ├── 94002771347472 │ ├── 94002771377616 │ ├── 94002771400032 │ ├── 94002771403824 │ ├── 94002771414496 │ ├── 94002771417168 │ ├── 94002771439152 │ ├── 94002771478080 │ ├── 94002771484496 │ ├── 94002771487984 │ ├── 94002771570448 │ ├── 94002771884528 │ ├── 94002771909792 │ ├── 94002774880528 │ ├── 94002774880928 │ ├── 94002777253904 │ ├── 94002777309920 │ ├── 94002777310688 │ ├── 94002777361392 │ ├── 94002777422176 │ ├── 94002777511168 │ ├── 94002777520208 │ ├── 94002779905616 │ ├── 94002779932928 │ ├── 94002779946176 │ ├── 94002779950304 │ ├── 94002779955744 │ ├── 94002779964800 │ ├── 94002779983104 │ ├── 94002779986768 │ ├── 94002779986864 │ ├── 94002779988528 │ ├── 94002779992000 │ ├── 94002779994352 │ ├── 94002780278208 │ ├── 94002780594720 │ ├── 94002781125280 │ ├── 94002784099664 │ ├── 94002784854624 │ ├── 94002784879408 │ ├── 94002784979472 │ ├── 94002785033776 │ ├── 94002785204656 │ ├── 94002785262672 │ ├── 94002785366592 │ ├── 94002785461200 │ ├── 94002786510512 │ ├── 94002787489360 │ ├── 94002787512416 │ ├── 94002787513776 │ ├── 94002787536016 │ ├── 94002787614288 │ ├── 94002787772768 │ ├── 94002787773072 │ ├── 94002787832624 │ ├── 94002787838896 │ ├── 94002787955536 │ ├── 94002787979296 │ ├── 94002787979440 │ ├── 94002788050480 │ ├── 94002788054768 │ ├── 94002788056336 │ ├── 94002788059360 │ ├── 94002788070816 │ ├── 94002788070960 │ ├── 94002788099104 │ ├── 94002788099824 │ ├── 94002788122560 │ ├── 94002788134800 │ ├── 94002788182656 │ ├── 94002788255088 │ ├── 94002788308512 │ ├── 94002788350080 │ ├── 94002788440448 │ ├── 94002788441936 │ ├── 94002788494432 │ ├── 94002788531216 │ ├── 94002788617248 │ ├── 94002789718608 │ ├── 94002789749392 │ ├── 94002789814416 │ ├── 94002789821728 │ ├── 94002789840304 │ ├── 94002789867744 │ ├── 94002789886048 │ ├── 94002789894784 │ ├── 94002789896880 │ ├── 94002789943488 │ ├── 94002790111408 │ ├── 94002790120480 │ ├── 94002790120576 │ ├── 94002790137472 │ ├── 94002790199104 │ ├── 94002790238720 │ ├── 94002790238896 │ ├── 94002790499904 │ ├── 94002790532752 │ ├── 94002790539040 │ ├── 94002790589792 │ ├── 94002790609568 │ ├── 94002790651792 │ ├── 94002790687920 │ ├── 94002790721248 │ ├── 94002790728240 │ ├── 94002790746208 │ ├── 94002790872912 │ ├── 94002790874832 │ ├── 94002790924544 │ ├── 94002790977664 │ ├── 94002790996304 │ ├── 94002791015152 │ ├── 94002791015248 │ ├── 94002791031216 │ ├── 94002791031312 │ ├── 94002791047680 │ ├── 94002791306784 │ ├── 94002791306960 │ ├── 94002791370448 │ ├── 94002791373328 │ ├── 94002791388160 │ ├── 94002791394608 │ ├── 94002791401280 │ ├── 94002791413712 │ ├── 94002791454688 │ ├── 94002791465968 │ ├── 94002791498640 │ ├── 94002791503136 │ ├── 94002791536848 │ ├── 94002791563472 │ ├── 94002791610752 │ ├── 94002791612976 │ ├── 94002791616624 │ ├── 94002791625232 │ ├── 94002791711440 │ ├── 94002791724736 │ ├── 94002791725024 │ ├── 94002791730368 │ ├── 94002791752400 │ ├── 94002791918576 │ ├── 94002792147936 │ ├── 94002792179872 │ ├── 94002792190080 │ ├── 94002792195088 │ ├── 94002792199008 │ ├── 94002792244448 │ ├── 94002792247008 │ ├── 94002792371968 │ ├── 94002792491296 │ ├── 94002792511168 │ ├── 94002792551984 │ ├── 94002792572256 │ ├── 94002792888416 │ ├── 94002793153360 │ ├── 94002793296272 │ ├── 94002793296832 │ ├── 94002793396880 │ ├── 94002793397056 │ ├── 94002793437760 │ ├── 94002793443504 │ ├── 94002793617168 │ ├── 94002793619024 │ ├── 94002793631920 │ ├── 94002793718672 │ ├── 94002793759168 │ ├── 94002793761504 │ ├── 94002793776368 │ ├── 94002793818224 │ ├── 94002793861088 │ ├── 94002793940752 │ ├── 94002794012592 │ ├── 94002794876400 │ ├── 94002794876544 │ ├── 94002794883408 │ ├── 94002794892704 │ ├── 94002794895776 │ ├── 94002794916352 │ ├── 94002794989072 │ ├── 94002795228528 │ ├── 94002796082976 │ ├── 94002796113056 │ ├── 94002796638480 │ ├── 94002796674688 │ ├── 94002796688256 │ ├── 94002796773232 │ └── 94002796905984 │ └── data.pkl ├── templates ├── _config.yml ├── index.html └── login.html ├── README.md ├── weights └── download_weights.sh ├── cameratest.py ├── requirements.txt ├── msg_box.py ├── gb.py ├── Dockerfile ├── .gitignore ├── account.py ├── static └── css │ ├── login_style.css │ └── signup_style.css ├── yolo_test.py ├── hubconf.py ├── yoloDetect.py ├── yolo.py └── test.py /models/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tutorial.ipynb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utils/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /best/archive/version: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /best/archive/data/94002730776240: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002730864720: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002730879664: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002731026912: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002731104368: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002731145984: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002731238848: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002732665808: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002732766656: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002733366256: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002733377408: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002733390368: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002733710944: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002733772608: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002733797728: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002733868160: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002734031104: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002734384464: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002769348576: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002769526960: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002770182496: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002770289344: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002771350288: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002771399856: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002771475792: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002771906320: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002776070736: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002777459184: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002779964064: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002779991216: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002780201888: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002780403392: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002784101920: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002785366736: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002787489520: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002787975904: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002788058176: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002788442080: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002788475680: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002788572560: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002789857552: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002789864208: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002790980672: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002791050896: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002791313632: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002791673456: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002791752848: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002791844128: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002792102032: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002792110112: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002793803376: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002793805824: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002794907072: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002796759968: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002796762432: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002796777888: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002796797120: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002796871616: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /best/archive/data/94002796883360: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /templates/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 简述 2 | 本项目为基于YOLOv5的GUI程序,可选择要使用的权重文件。 3 | -------------------------------------------------------------------------------- /best/archive/data.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data.pkl -------------------------------------------------------------------------------- /best/archive/data/93999994411472: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/93999994411472 -------------------------------------------------------------------------------- /best/archive/data/93999994457120: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/93999994457120 -------------------------------------------------------------------------------- /best/archive/data/94000004213584: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94000004213584 -------------------------------------------------------------------------------- /best/archive/data/94000004239008: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94000004239008 -------------------------------------------------------------------------------- /best/archive/data/94002730778848: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002730778848 -------------------------------------------------------------------------------- /best/archive/data/94002730799312: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002730799312 -------------------------------------------------------------------------------- /best/archive/data/94002730812304: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002730812304 -------------------------------------------------------------------------------- /best/archive/data/94002730817088: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002730817088 -------------------------------------------------------------------------------- /best/archive/data/94002730819552: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002730819552 -------------------------------------------------------------------------------- /best/archive/data/94002730858144: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002730858144 -------------------------------------------------------------------------------- /best/archive/data/94002730871792: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002730871792 -------------------------------------------------------------------------------- /best/archive/data/94002730913888: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002730913888 -------------------------------------------------------------------------------- /best/archive/data/94002730974080: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002730974080 -------------------------------------------------------------------------------- /best/archive/data/94002730982624: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002730982624 -------------------------------------------------------------------------------- /best/archive/data/94002730986144: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002730986144 -------------------------------------------------------------------------------- /best/archive/data/94002730993360: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002730993360 -------------------------------------------------------------------------------- /best/archive/data/94002731010720: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731010720 -------------------------------------------------------------------------------- /best/archive/data/94002731022496: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731022496 -------------------------------------------------------------------------------- /best/archive/data/94002731023680: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731023680 -------------------------------------------------------------------------------- /best/archive/data/94002731043056: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731043056 -------------------------------------------------------------------------------- /best/archive/data/94002731064496: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731064496 -------------------------------------------------------------------------------- /best/archive/data/94002731146080: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731146080 -------------------------------------------------------------------------------- /best/archive/data/94002731167952: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731167952 -------------------------------------------------------------------------------- /best/archive/data/94002731171312: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731171312 -------------------------------------------------------------------------------- /best/archive/data/94002731195136: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731195136 -------------------------------------------------------------------------------- /best/archive/data/94002731199648: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731199648 -------------------------------------------------------------------------------- /best/archive/data/94002731199984: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731199984 -------------------------------------------------------------------------------- /best/archive/data/94002731215184: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731215184 -------------------------------------------------------------------------------- /best/archive/data/94002731224848: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731224848 -------------------------------------------------------------------------------- /best/archive/data/94002731229632: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731229632 -------------------------------------------------------------------------------- /best/archive/data/94002731235648: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731235648 -------------------------------------------------------------------------------- /best/archive/data/94002731236768: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731236768 -------------------------------------------------------------------------------- /best/archive/data/94002731302992: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731302992 -------------------------------------------------------------------------------- /best/archive/data/94002731336480: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731336480 -------------------------------------------------------------------------------- /best/archive/data/94002731342512: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731342512 -------------------------------------------------------------------------------- /best/archive/data/94002731348496: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002731348496 -------------------------------------------------------------------------------- /best/archive/data/94002732573040: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732573040 -------------------------------------------------------------------------------- /best/archive/data/94002732588960: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732588960 -------------------------------------------------------------------------------- /best/archive/data/94002732589792: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732589792 -------------------------------------------------------------------------------- /best/archive/data/94002732612560: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732612560 -------------------------------------------------------------------------------- /best/archive/data/94002732612736: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732612736 -------------------------------------------------------------------------------- /best/archive/data/94002732640176: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732640176 -------------------------------------------------------------------------------- /best/archive/data/94002732646736: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732646736 -------------------------------------------------------------------------------- /best/archive/data/94002732667168: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732667168 -------------------------------------------------------------------------------- /best/archive/data/94002732684496: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732684496 -------------------------------------------------------------------------------- /best/archive/data/94002732685344: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732685344 -------------------------------------------------------------------------------- /best/archive/data/94002732706624: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732706624 -------------------------------------------------------------------------------- /best/archive/data/94002732720208: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732720208 -------------------------------------------------------------------------------- /best/archive/data/94002732728592: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732728592 -------------------------------------------------------------------------------- /best/archive/data/94002732762160: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732762160 -------------------------------------------------------------------------------- /best/archive/data/94002732773312: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732773312 -------------------------------------------------------------------------------- /best/archive/data/94002732774032: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732774032 -------------------------------------------------------------------------------- /best/archive/data/94002732799392: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732799392 -------------------------------------------------------------------------------- /best/archive/data/94002732860880: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732860880 -------------------------------------------------------------------------------- /best/archive/data/94002732863408: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732863408 -------------------------------------------------------------------------------- /best/archive/data/94002732870656: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002732870656 -------------------------------------------------------------------------------- /best/archive/data/94002733159792: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733159792 -------------------------------------------------------------------------------- /best/archive/data/94002733186608: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733186608 -------------------------------------------------------------------------------- /best/archive/data/94002733195584: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733195584 -------------------------------------------------------------------------------- /best/archive/data/94002733204592: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733204592 -------------------------------------------------------------------------------- /best/archive/data/94002733287216: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733287216 -------------------------------------------------------------------------------- /best/archive/data/94002733294864: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733294864 -------------------------------------------------------------------------------- /best/archive/data/94002733297248: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733297248 -------------------------------------------------------------------------------- /best/archive/data/94002733325664: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733325664 -------------------------------------------------------------------------------- /best/archive/data/94002733358352: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733358352 -------------------------------------------------------------------------------- /best/archive/data/94002733369824: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733369824 -------------------------------------------------------------------------------- /best/archive/data/94002733412528: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733412528 -------------------------------------------------------------------------------- /best/archive/data/94002733464160: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733464160 -------------------------------------------------------------------------------- /best/archive/data/94002733468944: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733468944 -------------------------------------------------------------------------------- /best/archive/data/94002733494992: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733494992 -------------------------------------------------------------------------------- /best/archive/data/94002733530288: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733530288 -------------------------------------------------------------------------------- /best/archive/data/94002733561456: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733561456 -------------------------------------------------------------------------------- /best/archive/data/94002733579680: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733579680 -------------------------------------------------------------------------------- /best/archive/data/94002733584592: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733584592 -------------------------------------------------------------------------------- /best/archive/data/94002733616128: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733616128 -------------------------------------------------------------------------------- /best/archive/data/94002733731456: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733731456 -------------------------------------------------------------------------------- /best/archive/data/94002733739072: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733739072 -------------------------------------------------------------------------------- /best/archive/data/94002733740528: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733740528 -------------------------------------------------------------------------------- /best/archive/data/94002733803104: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733803104 -------------------------------------------------------------------------------- /best/archive/data/94002733830016: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733830016 -------------------------------------------------------------------------------- /best/archive/data/94002733862800: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733862800 -------------------------------------------------------------------------------- /best/archive/data/94002733879024: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733879024 -------------------------------------------------------------------------------- /best/archive/data/94002733901184: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733901184 -------------------------------------------------------------------------------- /best/archive/data/94002733936800: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733936800 -------------------------------------------------------------------------------- /best/archive/data/94002733953856: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733953856 -------------------------------------------------------------------------------- /best/archive/data/94002733977232: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002733977232 -------------------------------------------------------------------------------- /best/archive/data/94002734001232: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002734001232 -------------------------------------------------------------------------------- /best/archive/data/94002734070464: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002734070464 -------------------------------------------------------------------------------- /best/archive/data/94002734071248: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002734071248 -------------------------------------------------------------------------------- /best/archive/data/94002734377568: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002734377568 -------------------------------------------------------------------------------- /best/archive/data/94002734427488: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002734427488 -------------------------------------------------------------------------------- /best/archive/data/94002734533040: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002734533040 -------------------------------------------------------------------------------- /best/archive/data/94002734555584: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002734555584 -------------------------------------------------------------------------------- /best/archive/data/94002734555936: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002734555936 -------------------------------------------------------------------------------- /best/archive/data/94002734558336: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002734558336 -------------------------------------------------------------------------------- /best/archive/data/94002755836784: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002755836784 -------------------------------------------------------------------------------- /best/archive/data/94002764231200: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002764231200 -------------------------------------------------------------------------------- /best/archive/data/94002764253296: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002764253296 -------------------------------------------------------------------------------- /best/archive/data/94002764415392: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002764415392 -------------------------------------------------------------------------------- /best/archive/data/94002764420400: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002764420400 -------------------------------------------------------------------------------- /best/archive/data/94002768690112: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002768690112 -------------------------------------------------------------------------------- /best/archive/data/94002768690256: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002768690256 -------------------------------------------------------------------------------- /best/archive/data/94002768913584: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002768913584 -------------------------------------------------------------------------------- /best/archive/data/94002769348752: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002769348752 -------------------------------------------------------------------------------- /best/archive/data/94002769351312: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002769351312 -------------------------------------------------------------------------------- /best/archive/data/94002769403120: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002769403120 -------------------------------------------------------------------------------- /best/archive/data/94002769486368: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002769486368 -------------------------------------------------------------------------------- /best/archive/data/94002769505120: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002769505120 -------------------------------------------------------------------------------- /best/archive/data/94002769517376: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002769517376 -------------------------------------------------------------------------------- /best/archive/data/94002769521200: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002769521200 -------------------------------------------------------------------------------- /best/archive/data/94002769535248: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002769535248 -------------------------------------------------------------------------------- /best/archive/data/94002770134992: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002770134992 -------------------------------------------------------------------------------- /best/archive/data/94002770137968: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002770137968 -------------------------------------------------------------------------------- /best/archive/data/94002770138064: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002770138064 -------------------------------------------------------------------------------- /best/archive/data/94002770147904: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002770147904 -------------------------------------------------------------------------------- /best/archive/data/94002770151040: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002770151040 -------------------------------------------------------------------------------- /best/archive/data/94002770152288: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002770152288 -------------------------------------------------------------------------------- /best/archive/data/94002770163232: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002770163232 -------------------------------------------------------------------------------- /best/archive/data/94002770240752: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002770240752 -------------------------------------------------------------------------------- /best/archive/data/94002770255456: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002770255456 -------------------------------------------------------------------------------- /best/archive/data/94002770298656: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002770298656 -------------------------------------------------------------------------------- /best/archive/data/94002770316448: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002770316448 -------------------------------------------------------------------------------- /best/archive/data/94002770415248: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002770415248 -------------------------------------------------------------------------------- /best/archive/data/94002770423904: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002770423904 -------------------------------------------------------------------------------- /best/archive/data/94002770424144: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002770424144 -------------------------------------------------------------------------------- /best/archive/data/94002770441632: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002770441632 -------------------------------------------------------------------------------- /best/archive/data/94002771252128: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002771252128 -------------------------------------------------------------------------------- /best/archive/data/94002771283424: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002771283424 -------------------------------------------------------------------------------- /best/archive/data/94002771295040: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002771295040 -------------------------------------------------------------------------------- /best/archive/data/94002771321296: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002771321296 -------------------------------------------------------------------------------- /best/archive/data/94002771346608: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002771346608 -------------------------------------------------------------------------------- /best/archive/data/94002771347472: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002771347472 -------------------------------------------------------------------------------- /best/archive/data/94002771377616: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002771377616 -------------------------------------------------------------------------------- /best/archive/data/94002771400032: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002771400032 -------------------------------------------------------------------------------- /best/archive/data/94002771403824: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002771403824 -------------------------------------------------------------------------------- /best/archive/data/94002771414496: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002771414496 -------------------------------------------------------------------------------- /best/archive/data/94002771417168: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002771417168 -------------------------------------------------------------------------------- /best/archive/data/94002771439152: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002771439152 -------------------------------------------------------------------------------- /best/archive/data/94002771478080: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002771478080 -------------------------------------------------------------------------------- /best/archive/data/94002771484496: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002771484496 -------------------------------------------------------------------------------- /best/archive/data/94002771487984: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002771487984 -------------------------------------------------------------------------------- /best/archive/data/94002771570448: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002771570448 -------------------------------------------------------------------------------- /best/archive/data/94002771884528: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002771884528 -------------------------------------------------------------------------------- /best/archive/data/94002771909792: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002771909792 -------------------------------------------------------------------------------- /best/archive/data/94002774880528: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002774880528 -------------------------------------------------------------------------------- /best/archive/data/94002774880928: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002774880928 -------------------------------------------------------------------------------- /best/archive/data/94002777253904: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002777253904 -------------------------------------------------------------------------------- /best/archive/data/94002777309920: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002777309920 -------------------------------------------------------------------------------- /best/archive/data/94002777310688: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002777310688 -------------------------------------------------------------------------------- /best/archive/data/94002777361392: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002777361392 -------------------------------------------------------------------------------- /best/archive/data/94002777422176: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002777422176 -------------------------------------------------------------------------------- /best/archive/data/94002777511168: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002777511168 -------------------------------------------------------------------------------- /best/archive/data/94002777520208: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002777520208 -------------------------------------------------------------------------------- /best/archive/data/94002779905616: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002779905616 -------------------------------------------------------------------------------- /best/archive/data/94002779932928: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002779932928 -------------------------------------------------------------------------------- /best/archive/data/94002779946176: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002779946176 -------------------------------------------------------------------------------- /best/archive/data/94002779950304: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002779950304 -------------------------------------------------------------------------------- /best/archive/data/94002779955744: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002779955744 -------------------------------------------------------------------------------- /best/archive/data/94002779964800: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002779964800 -------------------------------------------------------------------------------- /best/archive/data/94002779983104: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002779983104 -------------------------------------------------------------------------------- /best/archive/data/94002779986768: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002779986768 -------------------------------------------------------------------------------- /best/archive/data/94002779986864: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002779986864 -------------------------------------------------------------------------------- /best/archive/data/94002779988528: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002779988528 -------------------------------------------------------------------------------- /best/archive/data/94002779992000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002779992000 -------------------------------------------------------------------------------- /best/archive/data/94002779994352: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002779994352 -------------------------------------------------------------------------------- /best/archive/data/94002780278208: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002780278208 -------------------------------------------------------------------------------- /best/archive/data/94002780594720: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002780594720 -------------------------------------------------------------------------------- /best/archive/data/94002781125280: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002781125280 -------------------------------------------------------------------------------- /best/archive/data/94002784099664: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002784099664 -------------------------------------------------------------------------------- /best/archive/data/94002784854624: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002784854624 -------------------------------------------------------------------------------- /best/archive/data/94002784879408: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002784879408 -------------------------------------------------------------------------------- /best/archive/data/94002784979472: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002784979472 -------------------------------------------------------------------------------- /best/archive/data/94002785033776: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002785033776 -------------------------------------------------------------------------------- /best/archive/data/94002785204656: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002785204656 -------------------------------------------------------------------------------- /best/archive/data/94002785262672: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002785262672 -------------------------------------------------------------------------------- /best/archive/data/94002785366592: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002785366592 -------------------------------------------------------------------------------- /best/archive/data/94002785461200: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002785461200 -------------------------------------------------------------------------------- /best/archive/data/94002786510512: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002786510512 -------------------------------------------------------------------------------- /best/archive/data/94002787489360: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002787489360 -------------------------------------------------------------------------------- /best/archive/data/94002787512416: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002787512416 -------------------------------------------------------------------------------- /best/archive/data/94002787513776: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002787513776 -------------------------------------------------------------------------------- /best/archive/data/94002787536016: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002787536016 -------------------------------------------------------------------------------- /best/archive/data/94002787614288: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002787614288 -------------------------------------------------------------------------------- /best/archive/data/94002787772768: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002787772768 -------------------------------------------------------------------------------- /best/archive/data/94002787773072: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002787773072 -------------------------------------------------------------------------------- /best/archive/data/94002787832624: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002787832624 -------------------------------------------------------------------------------- /best/archive/data/94002787838896: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002787838896 -------------------------------------------------------------------------------- /best/archive/data/94002787955536: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002787955536 -------------------------------------------------------------------------------- /best/archive/data/94002787979296: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002787979296 -------------------------------------------------------------------------------- /best/archive/data/94002787979440: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002787979440 -------------------------------------------------------------------------------- /best/archive/data/94002788050480: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788050480 -------------------------------------------------------------------------------- /best/archive/data/94002788054768: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788054768 -------------------------------------------------------------------------------- /best/archive/data/94002788056336: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788056336 -------------------------------------------------------------------------------- /best/archive/data/94002788059360: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788059360 -------------------------------------------------------------------------------- /best/archive/data/94002788070816: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788070816 -------------------------------------------------------------------------------- /best/archive/data/94002788070960: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788070960 -------------------------------------------------------------------------------- /best/archive/data/94002788099104: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788099104 -------------------------------------------------------------------------------- /best/archive/data/94002788099824: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788099824 -------------------------------------------------------------------------------- /best/archive/data/94002788122560: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788122560 -------------------------------------------------------------------------------- /best/archive/data/94002788134800: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788134800 -------------------------------------------------------------------------------- /best/archive/data/94002788182656: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788182656 -------------------------------------------------------------------------------- /best/archive/data/94002788255088: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788255088 -------------------------------------------------------------------------------- /best/archive/data/94002788308512: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788308512 -------------------------------------------------------------------------------- /best/archive/data/94002788350080: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788350080 -------------------------------------------------------------------------------- /best/archive/data/94002788440448: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788440448 -------------------------------------------------------------------------------- /best/archive/data/94002788441936: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788441936 -------------------------------------------------------------------------------- /best/archive/data/94002788494432: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788494432 -------------------------------------------------------------------------------- /best/archive/data/94002788531216: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788531216 -------------------------------------------------------------------------------- /best/archive/data/94002788617248: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002788617248 -------------------------------------------------------------------------------- /best/archive/data/94002789718608: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002789718608 -------------------------------------------------------------------------------- /best/archive/data/94002789749392: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002789749392 -------------------------------------------------------------------------------- /best/archive/data/94002789814416: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002789814416 -------------------------------------------------------------------------------- /best/archive/data/94002789821728: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002789821728 -------------------------------------------------------------------------------- /best/archive/data/94002789840304: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002789840304 -------------------------------------------------------------------------------- /best/archive/data/94002789867744: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002789867744 -------------------------------------------------------------------------------- /best/archive/data/94002789886048: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002789886048 -------------------------------------------------------------------------------- /best/archive/data/94002789894784: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002789894784 -------------------------------------------------------------------------------- /best/archive/data/94002789896880: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002789896880 -------------------------------------------------------------------------------- /best/archive/data/94002789943488: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002789943488 -------------------------------------------------------------------------------- /best/archive/data/94002790111408: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790111408 -------------------------------------------------------------------------------- /best/archive/data/94002790120480: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790120480 -------------------------------------------------------------------------------- /best/archive/data/94002790120576: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790120576 -------------------------------------------------------------------------------- /best/archive/data/94002790137472: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790137472 -------------------------------------------------------------------------------- /best/archive/data/94002790199104: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790199104 -------------------------------------------------------------------------------- /best/archive/data/94002790238720: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790238720 -------------------------------------------------------------------------------- /best/archive/data/94002790238896: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790238896 -------------------------------------------------------------------------------- /best/archive/data/94002790499904: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790499904 -------------------------------------------------------------------------------- /best/archive/data/94002790532752: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790532752 -------------------------------------------------------------------------------- /best/archive/data/94002790539040: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790539040 -------------------------------------------------------------------------------- /best/archive/data/94002790589792: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790589792 -------------------------------------------------------------------------------- /best/archive/data/94002790609568: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790609568 -------------------------------------------------------------------------------- /best/archive/data/94002790651792: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790651792 -------------------------------------------------------------------------------- /best/archive/data/94002790687920: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790687920 -------------------------------------------------------------------------------- /best/archive/data/94002790721248: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790721248 -------------------------------------------------------------------------------- /best/archive/data/94002790728240: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790728240 -------------------------------------------------------------------------------- /best/archive/data/94002790746208: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790746208 -------------------------------------------------------------------------------- /best/archive/data/94002790872912: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790872912 -------------------------------------------------------------------------------- /best/archive/data/94002790874832: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790874832 -------------------------------------------------------------------------------- /best/archive/data/94002790924544: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790924544 -------------------------------------------------------------------------------- /best/archive/data/94002790977664: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790977664 -------------------------------------------------------------------------------- /best/archive/data/94002790996304: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002790996304 -------------------------------------------------------------------------------- /best/archive/data/94002791015152: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791015152 -------------------------------------------------------------------------------- /best/archive/data/94002791015248: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791015248 -------------------------------------------------------------------------------- /best/archive/data/94002791031216: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791031216 -------------------------------------------------------------------------------- /best/archive/data/94002791031312: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791031312 -------------------------------------------------------------------------------- /best/archive/data/94002791047680: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791047680 -------------------------------------------------------------------------------- /best/archive/data/94002791306784: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791306784 -------------------------------------------------------------------------------- /best/archive/data/94002791306960: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791306960 -------------------------------------------------------------------------------- /best/archive/data/94002791370448: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791370448 -------------------------------------------------------------------------------- /best/archive/data/94002791373328: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791373328 -------------------------------------------------------------------------------- /best/archive/data/94002791388160: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791388160 -------------------------------------------------------------------------------- /best/archive/data/94002791394608: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791394608 -------------------------------------------------------------------------------- /best/archive/data/94002791401280: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791401280 -------------------------------------------------------------------------------- /best/archive/data/94002791413712: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791413712 -------------------------------------------------------------------------------- /best/archive/data/94002791454688: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791454688 -------------------------------------------------------------------------------- /best/archive/data/94002791465968: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791465968 -------------------------------------------------------------------------------- /best/archive/data/94002791498640: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791498640 -------------------------------------------------------------------------------- /best/archive/data/94002791503136: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791503136 -------------------------------------------------------------------------------- /best/archive/data/94002791536848: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791536848 -------------------------------------------------------------------------------- /best/archive/data/94002791563472: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791563472 -------------------------------------------------------------------------------- /best/archive/data/94002791610752: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791610752 -------------------------------------------------------------------------------- /best/archive/data/94002791612976: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791612976 -------------------------------------------------------------------------------- /best/archive/data/94002791616624: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791616624 -------------------------------------------------------------------------------- /best/archive/data/94002791625232: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791625232 -------------------------------------------------------------------------------- /best/archive/data/94002791711440: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791711440 -------------------------------------------------------------------------------- /best/archive/data/94002791724736: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791724736 -------------------------------------------------------------------------------- /best/archive/data/94002791725024: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791725024 -------------------------------------------------------------------------------- /best/archive/data/94002791730368: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791730368 -------------------------------------------------------------------------------- /best/archive/data/94002791752400: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791752400 -------------------------------------------------------------------------------- /best/archive/data/94002791918576: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002791918576 -------------------------------------------------------------------------------- /best/archive/data/94002792147936: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002792147936 -------------------------------------------------------------------------------- /best/archive/data/94002792179872: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002792179872 -------------------------------------------------------------------------------- /best/archive/data/94002792190080: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002792190080 -------------------------------------------------------------------------------- /best/archive/data/94002792195088: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002792195088 -------------------------------------------------------------------------------- /best/archive/data/94002792199008: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002792199008 -------------------------------------------------------------------------------- /best/archive/data/94002792244448: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002792244448 -------------------------------------------------------------------------------- /best/archive/data/94002792247008: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002792247008 -------------------------------------------------------------------------------- /best/archive/data/94002792371968: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002792371968 -------------------------------------------------------------------------------- /best/archive/data/94002792491296: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002792491296 -------------------------------------------------------------------------------- /best/archive/data/94002792511168: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002792511168 -------------------------------------------------------------------------------- /best/archive/data/94002792551984: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002792551984 -------------------------------------------------------------------------------- /best/archive/data/94002792572256: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002792572256 -------------------------------------------------------------------------------- /best/archive/data/94002792888416: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002792888416 -------------------------------------------------------------------------------- /best/archive/data/94002793153360: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002793153360 -------------------------------------------------------------------------------- /best/archive/data/94002793296272: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002793296272 -------------------------------------------------------------------------------- /best/archive/data/94002793296832: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002793296832 -------------------------------------------------------------------------------- /best/archive/data/94002793396880: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002793396880 -------------------------------------------------------------------------------- /best/archive/data/94002793397056: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002793397056 -------------------------------------------------------------------------------- /best/archive/data/94002793437760: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002793437760 -------------------------------------------------------------------------------- /best/archive/data/94002793443504: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002793443504 -------------------------------------------------------------------------------- /best/archive/data/94002793617168: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002793617168 -------------------------------------------------------------------------------- /best/archive/data/94002793619024: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002793619024 -------------------------------------------------------------------------------- /best/archive/data/94002793631920: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002793631920 -------------------------------------------------------------------------------- /best/archive/data/94002793718672: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002793718672 -------------------------------------------------------------------------------- /best/archive/data/94002793759168: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002793759168 -------------------------------------------------------------------------------- /best/archive/data/94002793761504: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002793761504 -------------------------------------------------------------------------------- /best/archive/data/94002793776368: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002793776368 -------------------------------------------------------------------------------- /best/archive/data/94002793818224: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002793818224 -------------------------------------------------------------------------------- /best/archive/data/94002793861088: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002793861088 -------------------------------------------------------------------------------- /best/archive/data/94002793940752: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002793940752 -------------------------------------------------------------------------------- /best/archive/data/94002794012592: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002794012592 -------------------------------------------------------------------------------- /best/archive/data/94002794876400: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002794876400 -------------------------------------------------------------------------------- /best/archive/data/94002794876544: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002794876544 -------------------------------------------------------------------------------- /best/archive/data/94002794883408: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002794883408 -------------------------------------------------------------------------------- /best/archive/data/94002794892704: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002794892704 -------------------------------------------------------------------------------- /best/archive/data/94002794895776: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002794895776 -------------------------------------------------------------------------------- /best/archive/data/94002794916352: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002794916352 -------------------------------------------------------------------------------- /best/archive/data/94002794989072: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002794989072 -------------------------------------------------------------------------------- /best/archive/data/94002795228528: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002795228528 -------------------------------------------------------------------------------- /best/archive/data/94002796082976: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002796082976 -------------------------------------------------------------------------------- /best/archive/data/94002796113056: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002796113056 -------------------------------------------------------------------------------- /best/archive/data/94002796638480: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002796638480 -------------------------------------------------------------------------------- /best/archive/data/94002796674688: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002796674688 -------------------------------------------------------------------------------- /best/archive/data/94002796688256: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002796688256 -------------------------------------------------------------------------------- /best/archive/data/94002796773232: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002796773232 -------------------------------------------------------------------------------- /best/archive/data/94002796905984: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaorun2345/yolov5_helmet_pyqt5/HEAD/best/archive/data/94002796905984 -------------------------------------------------------------------------------- /utils/google_app_engine/additional_requirements.txt: -------------------------------------------------------------------------------- 1 | # add these requirements in your app on top of the existing ones 2 | pip==18.1 3 | Flask==1.0.2 4 | gunicorn==19.9.0 5 | -------------------------------------------------------------------------------- /utils/google_app_engine/app.yaml: -------------------------------------------------------------------------------- 1 | runtime: custom 2 | env: flex 3 | 4 | service: yolov5app 5 | 6 | liveness_check: 7 | initial_delay_sec: 600 8 | 9 | manual_scaling: 10 | instances: 1 11 | resources: 12 | cpu: 1 13 | memory_gb: 4 14 | disk_size_gb: 20 -------------------------------------------------------------------------------- /weights/download_weights.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Download common models 3 | 4 | python -c " 5 | from utils.google_utils import *; 6 | attempt_download('weights/yolov5s.pt'); 7 | attempt_download('weights/yolov5m.pt'); 8 | attempt_download('weights/yolov5l.pt'); 9 | attempt_download('weights/yolov5x.pt') 10 | " 11 | -------------------------------------------------------------------------------- /cameratest.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | def get_img_from_camera_net(): 3 | cap = cv2.VideoCapture("rtsp://admin:mkls1123@192.168.0.64/")#获取网络摄像机 4 | 5 | i = 1 6 | ret = True 7 | while ret: 8 | ret, frame = cap.read() 9 | cv2.imshow("capture", frame) 10 | print (str(i)) 11 | cv2.imshow(frame) 12 | if cv2.waitKey(1) & 0xFF == ord('q'): 13 | break 14 | i += 1 15 | cap.release() 16 | cv2.destroyAllWindows() 17 | 18 | # 测试 19 | if __name__ == '__main__': 20 | 21 | get_img_from_camera_net() 22 | -------------------------------------------------------------------------------- /utils/evolve.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Hyperparameter evolution commands (avoids CUDA memory leakage issues) 3 | # Replaces train.py python generations 'for' loop with a bash 'for' loop 4 | 5 | # Start on 4-GPU machine 6 | #for i in 0 1 2 3; do 7 | # t=ultralytics/yolov5:evolve && sudo docker pull $t && sudo docker run -d --ipc=host --gpus all -v "$(pwd)"/VOC:/usr/src/VOC $t bash utils/evolve.sh $i 8 | # sleep 60 # avoid simultaneous evolve.txt read/write 9 | #done 10 | 11 | # Hyperparameter evolution commands 12 | while true; do 13 | # python train.py --batch 64 --weights yolov5m.pt --data voc.yaml --img 512 --epochs 50 --evolve --bucket ult/evolve/voc --device $1 14 | python train.py --batch 40 --weights yolov5m.pt --data coco.yaml --img 640 --epochs 30 --evolve --bucket ult/evolve/coco --device $1 15 | done 16 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # pip install -r requirements.txt 2 | Cython 3 | matplotlib>=3.2.2 4 | numpy>=1.18.5 5 | opencv-python>=4.1.2 6 | pillow~=7.2.0 7 | # pycocotools>=2.0 8 | PyYAML>=5.3 9 | scipy>=1.4.1 10 | tensorboard>=2.2 11 | torch>=1.6.0 12 | torchvision>=0.7.0 13 | tqdm>=4.41.0 14 | 15 | # Conda commands (in place of pip) --------------------------------------------- 16 | # conda update -yn base -c defaults conda 17 | # conda install -yc anaconda numpy opencv matplotlib tqdm pillow ipython 18 | # conda install -yc conda-forge scikit-image pycocotools tensorboard 19 | # conda install -yc spyder-ide spyder-line-profiler 20 | # conda install -yc pytorch pytorch torchvision 21 | # conda install -yc conda-forge protobuf numpy && pip install onnx==1.6.0 # https://github.com/onnx/onnx#linux-and-macos 22 | 23 | PySide2~=5.15.1 24 | -------------------------------------------------------------------------------- /msg_box.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from PySide2.QtGui import QIcon, QPixmap 3 | from PySide2.QtWidgets import QMessageBox 4 | 5 | 6 | class MsgSuccess(QMessageBox): 7 | """提示(操作成功)对话框,使用的时候设置提示信息即可""" 8 | 9 | def __init__(self): 10 | super(MsgSuccess, self).__init__() 11 | self.setWindowTitle('注意') 12 | # self.setWindowIcon(QIcon('img/logo.png')) 13 | pix = QPixmap('img/success.svg').scaled(48, 48) 14 | self.setIconPixmap(pix) 15 | self.setStyleSheet('font: 16px Microsoft YaHei') 16 | 17 | 18 | class MsgWarning(QMessageBox): 19 | """注意对话框,使用的时候设置提示信息即可""" 20 | 21 | def __init__(self): 22 | super(MsgWarning, self).__init__() 23 | self.setWindowTitle('注意') 24 | # self.setWindowIcon(QIcon('img/logo.png')) 25 | pix = QPixmap('img/warn.svg').scaled(48, 48) 26 | self.setIconPixmap(pix) 27 | self.setStyleSheet('font: 16px Microsoft YaHei') 28 | -------------------------------------------------------------------------------- /utils/google_app_engine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gcr.io/google-appengine/python 2 | 3 | # Create a virtualenv for dependencies. This isolates these packages from 4 | # system-level packages. 5 | # Use -p python3 or -p python3.7 to select python version. Default is version 2. 6 | RUN virtualenv /env -p python3 7 | 8 | # Setting these environment variables are the same as running 9 | # source /env/bin/activate. 10 | ENV VIRTUAL_ENV /env 11 | ENV PATH /env/bin:$PATH 12 | 13 | RUN apt-get update && apt-get install -y python-opencv 14 | 15 | # Copy the application's requirements.txt and run pip to install all 16 | # dependencies into the virtualenv. 17 | ADD requirements.txt /app/requirements.txt 18 | RUN pip install -r /app/requirements.txt 19 | 20 | # Add the application source code. 21 | ADD . /app 22 | 23 | # Run a WSGI server to serve the application. gunicorn must be declared as 24 | # a dependency in requirements.txt. 25 | CMD gunicorn -b :$PORT main:app 26 | -------------------------------------------------------------------------------- /templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 | 15 | AI视觉 16 | 17 | 18 | 22 | 置信度:
23 | 文件名:
24 | 系统信息: 25 | 头盔检测: 26 | 27 | 28 | 29 |

AI视觉监控平台

30 | 31 | -------------------------------------------------------------------------------- /models/hub/yolov5-fpn.yaml: -------------------------------------------------------------------------------- 1 | # parameters 2 | nc: 80 # number of classes 3 | depth_multiple: 1.0 # model depth multiple 4 | width_multiple: 1.0 # layer channel multiple 5 | 6 | # anchors 7 | anchors: 8 | - [10,13, 16,30, 33,23] # P3/8 9 | - [30,61, 62,45, 59,119] # P4/16 10 | - [116,90, 156,198, 373,326] # P5/32 11 | 12 | # YOLOv5 backbone 13 | backbone: 14 | # [from, number, module, args] 15 | [[-1, 1, Focus, [64, 3]], # 0-P1/2 16 | [-1, 1, Conv, [128, 3, 2]], # 1-P2/4 17 | [-1, 3, Bottleneck, [128]], 18 | [-1, 1, Conv, [256, 3, 2]], # 3-P3/8 19 | [-1, 9, BottleneckCSP, [256]], 20 | [-1, 1, Conv, [512, 3, 2]], # 5-P4/16 21 | [-1, 9, BottleneckCSP, [512]], 22 | [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32 23 | [-1, 1, SPP, [1024, [5, 9, 13]]], 24 | [-1, 6, BottleneckCSP, [1024]], # 9 25 | ] 26 | 27 | # YOLOv5 FPN head 28 | head: 29 | [[-1, 3, BottleneckCSP, [1024, False]], # 10 (P5/32-large) 30 | 31 | [-1, 1, nn.Upsample, [None, 2, 'nearest']], 32 | [[-1, 6], 1, Concat, [1]], # cat backbone P4 33 | [-1, 1, Conv, [512, 1, 1]], 34 | [-1, 3, BottleneckCSP, [512, False]], # 14 (P4/16-medium) 35 | 36 | [-1, 1, nn.Upsample, [None, 2, 'nearest']], 37 | [[-1, 4], 1, Concat, [1]], # cat backbone P3 38 | [-1, 1, Conv, [256, 1, 1]], 39 | [-1, 3, BottleneckCSP, [256, False]], # 18 (P3/8-small) 40 | 41 | [[18, 14, 10], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5) 42 | ] 43 | -------------------------------------------------------------------------------- /gb.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | import json 3 | import os 4 | 5 | import msg_box 6 | 7 | 8 | class Global: 9 | def __init__(self): 10 | # 保存的配置 11 | # @video: 视频文件 12 | # @weights: 权重文件 13 | # @img_size: 图像大小,32的倍数(320|416|480|640) 14 | # @conf_thresh: 置信度阈值(0.1-0.9) 15 | # @iou_thresh: IOU阈值(0.1-0.9) 16 | self.config = dict() 17 | 18 | def init_config(self): 19 | if not os.path.exists('config'): 20 | os.mkdir('config') # make new config folder 21 | return 22 | try: 23 | with open('config/config.json', 'r') as file_settings: 24 | GLOBAL.config = json.loads(file_settings.read()) 25 | except FileNotFoundError as err_file: 26 | print('配置文件不存在: ' + str(err_file)) 27 | 28 | def record_config(self, _dict): 29 | """将设置参数写入到本地文件保存,传入字典""" 30 | # 更新配置 31 | for k, v in _dict.items(): 32 | self.config[k] = v 33 | if not os.path.exists('config'): 34 | os.mkdir('config') # 创建config文件夹 35 | try: 36 | # 写入文件 37 | with open('config/config.json', 'w') as file_config: 38 | file_config.write(json.dumps(self.config, indent=4)) 39 | except FileNotFoundError as err_file: 40 | print(err_file) 41 | msg = msg_box.MsgWarning() 42 | msg.setText('参数保存失败!') 43 | msg.exec() 44 | 45 | 46 | GLOBAL = Global() # 全局变量调用该对象 47 | -------------------------------------------------------------------------------- /models/yolov5l.yaml: -------------------------------------------------------------------------------- 1 | # parameters 2 | nc: 80 # number of classes 3 | depth_multiple: 1.0 # model depth multiple 4 | width_multiple: 1.0 # layer channel multiple 5 | 6 | # anchors 7 | anchors: 8 | - [10,13, 16,30, 33,23] # P3/8 9 | - [30,61, 62,45, 59,119] # P4/16 10 | - [116,90, 156,198, 373,326] # P5/32 11 | 12 | # YOLOv5 backbone 13 | backbone: 14 | # [from, number, module, args] 15 | [[-1, 1, Focus, [64, 3]], # 0-P1/2 16 | [-1, 1, Conv, [128, 3, 2]], # 1-P2/4 17 | [-1, 3, BottleneckCSP, [128]], 18 | [-1, 1, Conv, [256, 3, 2]], # 3-P3/8 19 | [-1, 9, BottleneckCSP, [256]], 20 | [-1, 1, Conv, [512, 3, 2]], # 5-P4/16 21 | [-1, 9, BottleneckCSP, [512]], 22 | [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32 23 | [-1, 1, SPP, [1024, [5, 9, 13]]], 24 | [-1, 3, BottleneckCSP, [1024, False]], # 9 25 | ] 26 | 27 | # YOLOv5 head 28 | head: 29 | [[-1, 1, Conv, [512, 1, 1]], 30 | [-1, 1, nn.Upsample, [None, 2, 'nearest']], 31 | [[-1, 6], 1, Concat, [1]], # cat backbone P4 32 | [-1, 3, BottleneckCSP, [512, False]], # 13 33 | 34 | [-1, 1, Conv, [256, 1, 1]], 35 | [-1, 1, nn.Upsample, [None, 2, 'nearest']], 36 | [[-1, 4], 1, Concat, [1]], # cat backbone P3 37 | [-1, 3, BottleneckCSP, [256, False]], # 17 (P3/8-small) 38 | 39 | [-1, 1, Conv, [256, 3, 2]], 40 | [[-1, 14], 1, Concat, [1]], # cat head P4 41 | [-1, 3, BottleneckCSP, [512, False]], # 20 (P4/16-medium) 42 | 43 | [-1, 1, Conv, [512, 3, 2]], 44 | [[-1, 10], 1, Concat, [1]], # cat head P5 45 | [-1, 3, BottleneckCSP, [1024, False]], # 23 (P5/32-large) 46 | 47 | [[17, 20, 23], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5) 48 | ] 49 | -------------------------------------------------------------------------------- /models/yolov5m.yaml: -------------------------------------------------------------------------------- 1 | # parameters 2 | nc: 80 # number of classes 3 | depth_multiple: 0.67 # model depth multiple 4 | width_multiple: 0.75 # layer channel multiple 5 | 6 | # anchors 7 | anchors: 8 | - [10,13, 16,30, 33,23] # P3/8 9 | - [30,61, 62,45, 59,119] # P4/16 10 | - [116,90, 156,198, 373,326] # P5/32 11 | 12 | # YOLOv5 backbone 13 | backbone: 14 | # [from, number, module, args] 15 | [[-1, 1, Focus, [64, 3]], # 0-P1/2 16 | [-1, 1, Conv, [128, 3, 2]], # 1-P2/4 17 | [-1, 3, BottleneckCSP, [128]], 18 | [-1, 1, Conv, [256, 3, 2]], # 3-P3/8 19 | [-1, 9, BottleneckCSP, [256]], 20 | [-1, 1, Conv, [512, 3, 2]], # 5-P4/16 21 | [-1, 9, BottleneckCSP, [512]], 22 | [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32 23 | [-1, 1, SPP, [1024, [5, 9, 13]]], 24 | [-1, 3, BottleneckCSP, [1024, False]], # 9 25 | ] 26 | 27 | # YOLOv5 head 28 | head: 29 | [[-1, 1, Conv, [512, 1, 1]], 30 | [-1, 1, nn.Upsample, [None, 2, 'nearest']], 31 | [[-1, 6], 1, Concat, [1]], # cat backbone P4 32 | [-1, 3, BottleneckCSP, [512, False]], # 13 33 | 34 | [-1, 1, Conv, [256, 1, 1]], 35 | [-1, 1, nn.Upsample, [None, 2, 'nearest']], 36 | [[-1, 4], 1, Concat, [1]], # cat backbone P3 37 | [-1, 3, BottleneckCSP, [256, False]], # 17 (P3/8-small) 38 | 39 | [-1, 1, Conv, [256, 3, 2]], 40 | [[-1, 14], 1, Concat, [1]], # cat head P4 41 | [-1, 3, BottleneckCSP, [512, False]], # 20 (P4/16-medium) 42 | 43 | [-1, 1, Conv, [512, 3, 2]], 44 | [[-1, 10], 1, Concat, [1]], # cat head P5 45 | [-1, 3, BottleneckCSP, [1024, False]], # 23 (P5/32-large) 46 | 47 | [[17, 20, 23], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5) 48 | ] 49 | -------------------------------------------------------------------------------- /models/yolov5s.yaml: -------------------------------------------------------------------------------- 1 | # parameters 2 | nc: 80 # number of classes 3 | depth_multiple: 0.33 # model depth multiple 4 | width_multiple: 0.50 # layer channel multiple 5 | 6 | # anchors 7 | anchors: 8 | - [10,13, 16,30, 33,23] # P3/8 9 | - [30,61, 62,45, 59,119] # P4/16 10 | - [116,90, 156,198, 373,326] # P5/32 11 | 12 | # YOLOv5 backbone 13 | backbone: 14 | # [from, number, module, args] 15 | [[-1, 1, Focus, [64, 3]], # 0-P1/2 16 | [-1, 1, Conv, [128, 3, 2]], # 1-P2/4 17 | [-1, 3, BottleneckCSP, [128]], 18 | [-1, 1, Conv, [256, 3, 2]], # 3-P3/8 19 | [-1, 9, BottleneckCSP, [256]], 20 | [-1, 1, Conv, [512, 3, 2]], # 5-P4/16 21 | [-1, 9, BottleneckCSP, [512]], 22 | [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32 23 | [-1, 1, SPP, [1024, [5, 9, 13]]], 24 | [-1, 3, BottleneckCSP, [1024, False]], # 9 25 | ] 26 | 27 | # YOLOv5 head 28 | head: 29 | [[-1, 1, Conv, [512, 1, 1]], 30 | [-1, 1, nn.Upsample, [None, 2, 'nearest']], 31 | [[-1, 6], 1, Concat, [1]], # cat backbone P4 32 | [-1, 3, BottleneckCSP, [512, False]], # 13 33 | 34 | [-1, 1, Conv, [256, 1, 1]], 35 | [-1, 1, nn.Upsample, [None, 2, 'nearest']], 36 | [[-1, 4], 1, Concat, [1]], # cat backbone P3 37 | [-1, 3, BottleneckCSP, [256, False]], # 17 (P3/8-small) 38 | 39 | [-1, 1, Conv, [256, 3, 2]], 40 | [[-1, 14], 1, Concat, [1]], # cat head P4 41 | [-1, 3, BottleneckCSP, [512, False]], # 20 (P4/16-medium) 42 | 43 | [-1, 1, Conv, [512, 3, 2]], 44 | [[-1, 10], 1, Concat, [1]], # cat head P5 45 | [-1, 3, BottleneckCSP, [1024, False]], # 23 (P5/32-large) 46 | 47 | [[17, 20, 23], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5) 48 | ] 49 | -------------------------------------------------------------------------------- /models/yolov5x.yaml: -------------------------------------------------------------------------------- 1 | # parameters 2 | nc: 80 # number of classes 3 | depth_multiple: 1.33 # model depth multiple 4 | width_multiple: 1.25 # layer channel multiple 5 | 6 | # anchors 7 | anchors: 8 | - [10,13, 16,30, 33,23] # P3/8 9 | - [30,61, 62,45, 59,119] # P4/16 10 | - [116,90, 156,198, 373,326] # P5/32 11 | 12 | # YOLOv5 backbone 13 | backbone: 14 | # [from, number, module, args] 15 | [[-1, 1, Focus, [64, 3]], # 0-P1/2 16 | [-1, 1, Conv, [128, 3, 2]], # 1-P2/4 17 | [-1, 3, BottleneckCSP, [128]], 18 | [-1, 1, Conv, [256, 3, 2]], # 3-P3/8 19 | [-1, 9, BottleneckCSP, [256]], 20 | [-1, 1, Conv, [512, 3, 2]], # 5-P4/16 21 | [-1, 9, BottleneckCSP, [512]], 22 | [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32 23 | [-1, 1, SPP, [1024, [5, 9, 13]]], 24 | [-1, 3, BottleneckCSP, [1024, False]], # 9 25 | ] 26 | 27 | # YOLOv5 head 28 | head: 29 | [[-1, 1, Conv, [512, 1, 1]], 30 | [-1, 1, nn.Upsample, [None, 2, 'nearest']], 31 | [[-1, 6], 1, Concat, [1]], # cat backbone P4 32 | [-1, 3, BottleneckCSP, [512, False]], # 13 33 | 34 | [-1, 1, Conv, [256, 1, 1]], 35 | [-1, 1, nn.Upsample, [None, 2, 'nearest']], 36 | [[-1, 4], 1, Concat, [1]], # cat backbone P3 37 | [-1, 3, BottleneckCSP, [256, False]], # 17 (P3/8-small) 38 | 39 | [-1, 1, Conv, [256, 3, 2]], 40 | [[-1, 14], 1, Concat, [1]], # cat head P4 41 | [-1, 3, BottleneckCSP, [512, False]], # 20 (P4/16-medium) 42 | 43 | [-1, 1, Conv, [512, 3, 2]], 44 | [[-1, 10], 1, Concat, [1]], # cat head P5 45 | [-1, 3, BottleneckCSP, [1024, False]], # 23 (P5/32-large) 46 | 47 | [[17, 20, 23], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5) 48 | ] 49 | -------------------------------------------------------------------------------- /models/hub/yolov5-panet.yaml: -------------------------------------------------------------------------------- 1 | # parameters 2 | nc: 80 # number of classes 3 | depth_multiple: 1.0 # model depth multiple 4 | width_multiple: 1.0 # layer channel multiple 5 | 6 | # anchors 7 | anchors: 8 | - [116,90, 156,198, 373,326] # P5/32 9 | - [30,61, 62,45, 59,119] # P4/16 10 | - [10,13, 16,30, 33,23] # P3/8 11 | 12 | # YOLOv5 backbone 13 | backbone: 14 | # [from, number, module, args] 15 | [[-1, 1, Focus, [64, 3]], # 0-P1/2 16 | [-1, 1, Conv, [128, 3, 2]], # 1-P2/4 17 | [-1, 3, BottleneckCSP, [128]], 18 | [-1, 1, Conv, [256, 3, 2]], # 3-P3/8 19 | [-1, 9, BottleneckCSP, [256]], 20 | [-1, 1, Conv, [512, 3, 2]], # 5-P4/16 21 | [-1, 9, BottleneckCSP, [512]], 22 | [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32 23 | [-1, 1, SPP, [1024, [5, 9, 13]]], 24 | [-1, 3, BottleneckCSP, [1024, False]], # 9 25 | ] 26 | 27 | # YOLOv5 PANet head 28 | head: 29 | [[-1, 1, Conv, [512, 1, 1]], 30 | [-1, 1, nn.Upsample, [None, 2, 'nearest']], 31 | [[-1, 6], 1, Concat, [1]], # cat backbone P4 32 | [-1, 3, BottleneckCSP, [512, False]], # 13 33 | 34 | [-1, 1, Conv, [256, 1, 1]], 35 | [-1, 1, nn.Upsample, [None, 2, 'nearest']], 36 | [[-1, 4], 1, Concat, [1]], # cat backbone P3 37 | [-1, 3, BottleneckCSP, [256, False]], # 17 (P3/8-small) 38 | 39 | [-1, 1, Conv, [256, 3, 2]], 40 | [[-1, 14], 1, Concat, [1]], # cat head P4 41 | [-1, 3, BottleneckCSP, [512, False]], # 20 (P4/16-medium) 42 | 43 | [-1, 1, Conv, [512, 3, 2]], 44 | [[-1, 10], 1, Concat, [1]], # cat head P5 45 | [-1, 3, BottleneckCSP, [1024, False]], # 23 (P5/32-large) 46 | 47 | [[17, 20, 23], 1, Detect, [nc, anchors]], # Detect(P5, P4, P3) 48 | ] 49 | -------------------------------------------------------------------------------- /models/hub/yolov3-spp.yaml: -------------------------------------------------------------------------------- 1 | # parameters 2 | nc: 80 # number of classes 3 | depth_multiple: 1.0 # model depth multiple 4 | width_multiple: 1.0 # layer channel multiple 5 | 6 | # anchors 7 | anchors: 8 | - [10,13, 16,30, 33,23] # P3/8 9 | - [30,61, 62,45, 59,119] # P4/16 10 | - [116,90, 156,198, 373,326] # P5/32 11 | 12 | # darknet53 backbone 13 | backbone: 14 | # [from, number, module, args] 15 | [[-1, 1, Conv, [32, 3, 1]], # 0 16 | [-1, 1, Conv, [64, 3, 2]], # 1-P1/2 17 | [-1, 1, Bottleneck, [64]], 18 | [-1, 1, Conv, [128, 3, 2]], # 3-P2/4 19 | [-1, 2, Bottleneck, [128]], 20 | [-1, 1, Conv, [256, 3, 2]], # 5-P3/8 21 | [-1, 8, Bottleneck, [256]], 22 | [-1, 1, Conv, [512, 3, 2]], # 7-P4/16 23 | [-1, 8, Bottleneck, [512]], 24 | [-1, 1, Conv, [1024, 3, 2]], # 9-P5/32 25 | [-1, 4, Bottleneck, [1024]], # 10 26 | ] 27 | 28 | # YOLOv3-SPP head 29 | head: 30 | [[-1, 1, Bottleneck, [1024, False]], 31 | [-1, 1, SPP, [512, [5, 9, 13]]], 32 | [-1, 1, Conv, [1024, 3, 1]], 33 | [-1, 1, Conv, [512, 1, 1]], 34 | [-1, 1, Conv, [1024, 3, 1]], # 15 (P5/32-large) 35 | 36 | [-2, 1, Conv, [256, 1, 1]], 37 | [-1, 1, nn.Upsample, [None, 2, 'nearest']], 38 | [[-1, 8], 1, Concat, [1]], # cat backbone P4 39 | [-1, 1, Bottleneck, [512, False]], 40 | [-1, 1, Bottleneck, [512, False]], 41 | [-1, 1, Conv, [256, 1, 1]], 42 | [-1, 1, Conv, [512, 3, 1]], # 22 (P4/16-medium) 43 | 44 | [-2, 1, Conv, [128, 1, 1]], 45 | [-1, 1, nn.Upsample, [None, 2, 'nearest']], 46 | [[-1, 6], 1, Concat, [1]], # cat backbone P3 47 | [-1, 1, Bottleneck, [256, False]], 48 | [-1, 2, Bottleneck, [256, False]], # 27 (P3/8-small) 49 | 50 | [[27, 22, 15], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5) 51 | ] 52 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Start FROM Nvidia PyTorch image https://ngc.nvidia.com/catalog/containers/nvidia:pytorch 2 | FROM nvcr.io/nvidia/pytorch:20.03-py3 3 | 4 | # Install dependencies 5 | COPY requirements.txt . 6 | RUN pip install -r requirements.txt gsutil 7 | 8 | # Create working directory 9 | RUN mkdir -p /usr/src/app 10 | WORKDIR /usr/src/app 11 | 12 | # Copy contents 13 | COPY . /usr/src/app 14 | 15 | # Copy weights 16 | #RUN python3 -c "from models import *; \ 17 | #attempt_download('weights/yolov5s.pt'); \ 18 | #attempt_download('weights/yolov5m.pt'); \ 19 | #attempt_download('weights/yolov5l.pt')" 20 | 21 | 22 | # --------------------------------------------------- Extras Below --------------------------------------------------- 23 | 24 | # Build and Push 25 | # t=ultralytics/yolov5:latest && sudo docker build -t $t . && sudo docker push $t 26 | 27 | # Pull and Run 28 | # t=ultralytics/yolov5:latest && sudo docker pull $t && sudo docker run -it --ipc=host $t 29 | 30 | # Pull and Run with local directory access 31 | # t=ultralytics/yolov5:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus all -v "$(pwd)"/coco:/usr/src/coco $t 32 | 33 | # Kill all 34 | # sudo docker kill "$(sudo docker ps -q)" 35 | 36 | # Kill all image-based 37 | # sudo docker kill $(sudo docker ps -a -q --filter ancestor=ultralytics/yolov5:latest) 38 | 39 | # Bash into running container 40 | # sudo docker container exec -it ba65811811ab bash 41 | 42 | # Bash into stopped container 43 | # sudo docker commit 092b16b25c5b usr/resume && sudo docker run -it --gpus all --ipc=host -v "$(pwd)"/coco:/usr/src/coco --entrypoint=sh usr/resume 44 | 45 | # Send weights to GCP 46 | # python -c "from utils.general import *; strip_optimizer('runs/exp0_*/weights/last.pt', 'tmp.pt')" && gsutil cp tmp.pt gs://* 47 | 48 | # Clean up 49 | # docker system prune -a --volumes 50 | -------------------------------------------------------------------------------- /templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Login 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Fork me on GitHub 19 | 20 |
21 |
22 | 23 |
24 | 25 | 26 | 27 |
28 |
29 | 30 |

31 |
32 |
33 |
34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /utils/activations.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn as nn 3 | import torch.nn.functional as F 4 | 5 | 6 | # Swish https://arxiv.org/pdf/1905.02244.pdf --------------------------------------------------------------------------- 7 | class Swish(nn.Module): # 8 | @staticmethod 9 | def forward(x): 10 | return x * torch.sigmoid(x) 11 | 12 | 13 | class Hardswish(nn.Module): # export-friendly version of nn.Hardswish() 14 | @staticmethod 15 | def forward(x): 16 | # return x * F.hardsigmoid(x) # for torchscript and CoreML 17 | return x * F.hardtanh(x + 3, 0., 6.) / 6. # for torchscript, CoreML and ONNX 18 | 19 | 20 | class MemoryEfficientSwish(nn.Module): 21 | class F(torch.autograd.Function): 22 | @staticmethod 23 | def forward(ctx, x): 24 | ctx.save_for_backward(x) 25 | return x * torch.sigmoid(x) 26 | 27 | @staticmethod 28 | def backward(ctx, grad_output): 29 | x = ctx.saved_tensors[0] 30 | sx = torch.sigmoid(x) 31 | return grad_output * (sx * (1 + x * (1 - sx))) 32 | 33 | def forward(self, x): 34 | return self.F.apply(x) 35 | 36 | 37 | # Mish https://github.com/digantamisra98/Mish -------------------------------------------------------------------------- 38 | class Mish(nn.Module): 39 | @staticmethod 40 | def forward(x): 41 | return x * F.softplus(x).tanh() 42 | 43 | 44 | class MemoryEfficientMish(nn.Module): 45 | class F(torch.autograd.Function): 46 | @staticmethod 47 | def forward(ctx, x): 48 | ctx.save_for_backward(x) 49 | return x.mul(torch.tanh(F.softplus(x))) # x * tanh(ln(1 + exp(x))) 50 | 51 | @staticmethod 52 | def backward(ctx, grad_output): 53 | x = ctx.saved_tensors[0] 54 | sx = torch.sigmoid(x) 55 | fx = F.softplus(x).tanh() 56 | return grad_output * (fx + x * sx * (1 - fx * fx)) 57 | 58 | def forward(self, x): 59 | return self.F.apply(x) 60 | 61 | 62 | # FReLU https://arxiv.org/abs/2007.11824 ------------------------------------------------------------------------------- 63 | class FReLU(nn.Module): 64 | def __init__(self, c1, k=3): # ch_in, kernel 65 | super().__init__() 66 | self.conv = nn.Conv2d(c1, c1, k, 1, 1, groups=c1) 67 | self.bn = nn.BatchNorm2d(c1) 68 | 69 | def forward(self, x): 70 | return torch.max(x, self.bn(self.conv(x))) 71 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /account.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # @Time : 2021/2/22 18:32 4 | # @Author : xiaorun 5 | # @Site : 6 | # @File : account.py 7 | # @Software: PyCharm 8 | from wtforms import Form, StringField, IntegerField, PasswordField, SubmitField 9 | from wtforms.validators import Length, NumberRange, DataRequired, Email, ValidationError, EqualTo 10 | from app.models.user import User 11 | from flask_wtf import FlaskForm 12 | 13 | 14 | # 这里使用wtforms类来创建注册的类 15 | class RegisterForm(Form): 16 | email = StringField( 17 | validators=[ 18 | DataRequired(), 19 | Length(8, 64), 20 | Email(message='电子邮箱不符合规范') 21 | ], 22 | render_kw={ 23 | 'placeholder': '请输入电子邮件!' 24 | } 25 | ) 26 | password = PasswordField( 27 | validators=[ 28 | DataRequired(message='密码不可以为空,请输入你的密码'), 29 | Length(6, 32, message='密码最小6位最长32') 30 | ], 31 | render_kw={ 32 | 'placeholder': '请输入密码!' 33 | } 34 | ) 35 | password2 = PasswordField( 36 | validators=[ 37 | DataRequired(message='密码不能为空,请输入你的密码'), 38 | Length(6, 32, message='密码最小6位最长32'), 39 | EqualTo('password', message="两次密码不一致!") 40 | ], 41 | render_kw={ 42 | 'placeholder': '请确认密码!' 43 | } 44 | ) 45 | nickname = StringField( 46 | validators=[ 47 | DataRequired(), 48 | Length(2, 10, message='昵称至少需要2个字符,最多10个字符') 49 | ], 50 | render_kw={ 51 | 'placeholder': '请输入昵称!' 52 | } 53 | ) 54 | submit = SubmitField( 55 | '提交' 56 | ) 57 | 58 | # 判断数据库中是否有同名的email 59 | # 这里的field是wtform自动传入的,是客户端浏览器传入的参数 60 | # wtform 会自动检测 validate_email这个函数将这个函数和email属性做关联 61 | def validate_email(self, field): 62 | # 不论查询出多少条,都只返回1条 63 | if User.query.filter_by(email=field.data).first(): 64 | raise ValidationError("电子邮件已被注册") 65 | 66 | def validate_nickname(self, field): 67 | if User.query.filter_by(nickname=field.data).first(): 68 | raise ValidationError('昵称已存在') 69 | 70 | 71 | # 这里使用Flask-WTF包来创建登录验证的类 72 | # class LoginForm(Form): 73 | class LoginForm(FlaskForm): 74 | email = StringField( 75 | validators=[ 76 | DataRequired(), 77 | Length(8, 64), 78 | Email(message='电子邮箱不符合规范') 79 | ], 80 | render_kw={ 81 | 'placeholder': '请输入注册邮箱!' 82 | } 83 | ) 84 | password = PasswordField( 85 | validators=[ 86 | DataRequired(message='密码不可以为空,请输入你的密码'), 87 | Length(6, 32, message='密码长度是6到32位') 88 | ], 89 | render_kw={ 90 | 'placeholder': '请输入密码!' 91 | } 92 | ) 93 | submit = SubmitField('提交') -------------------------------------------------------------------------------- /static/css/login_style.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Roboto:300); 2 | 3 | .body{ 4 | background-image: url('https://ordinaryfaith.net/wp-content/uploads/2016/03/Gray-plain-website-background.jpg'); 5 | background-repeat: no-repeat; 6 | background-size: cover; 7 | } 8 | 9 | .login-page { 10 | width: 360px; 11 | padding: 8% 0 0; 12 | margin: auto; 13 | 14 | } 15 | .form { 16 | position: relative; 17 | z-index: 1; 18 | background: #48c9b0; 19 | max-width: 360px; 20 | margin: 0 auto 100px; 21 | padding: 45px; 22 | text-align: center; 23 | box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24); 24 | 25 | } 26 | .form input { 27 | font-family: FontAwesome, "Roboto", sans-serif; 28 | outline: 0; 29 | background: #f2f2f2; 30 | width: 100%; 31 | border: 0; 32 | margin: 0 0 15px; 33 | padding: 15px; 34 | box-sizing: border-box; 35 | font-size: 14px; 36 | border-radius:10px; 37 | 38 | } 39 | .form button { 40 | font-family: "Titillium Web", sans-serif; 41 | font-size: 14px; 42 | font-weight: bold; 43 | letter-spacing: .1em; 44 | outline: 0; 45 | background: #17a589; 46 | width: 100%; 47 | border: 0; 48 | border-radius:30px; 49 | margin: 0px 0px 8px; 50 | padding: 15px; 51 | color: #FFFFFF; 52 | -webkit-transition: all 0.3 ease; 53 | transition: all 0.3 ease; 54 | cursor: pointer; 55 | transition: all 0.2s; 56 | 57 | 58 | } 59 | .form button:hover,.form button:focus { 60 | background: #148f77; 61 | box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); 62 | transform: translateY(-4px); 63 | } 64 | .form button:active { 65 | transform: translateY(2px); 66 | box-shadow: 0 2.5px 5px rgba(0, 0, 0, 0.2); 67 | } 68 | 69 | .form .message { 70 | 71 | margin: 6px 6px; 72 | color: #808080; 73 | font-size: 11px; 74 | text-align: center; 75 | font-weight: bold; 76 | font-style: normal; 77 | 78 | 79 | 80 | } 81 | .form .message a { 82 | color: #FFFFFF; 83 | text-decoration: none; 84 | font-size: 13px; 85 | } 86 | .form .register-form { 87 | display: none; 88 | } 89 | .container { 90 | position: relative; 91 | z-index: 1; 92 | max-width: 300px; 93 | margin: 0 auto; 94 | } 95 | .container:before, .container:after { 96 | content: ""; 97 | display: block; 98 | clear: both; 99 | } 100 | .container .info { 101 | margin: 50px auto; 102 | text-align: center; 103 | } 104 | .container .info h1 { 105 | margin: 0 0 15px; 106 | padding: 0; 107 | font-size: 36px; 108 | font-weight: 300; 109 | color: #1a1a1a; 110 | } 111 | .container .info span { 112 | color: #4d4d4d; 113 | font-size: 12px; 114 | } 115 | .container .info span a { 116 | color: #000000; 117 | text-decoration: none; 118 | } 119 | .container .info span .fa { 120 | color: #EF3B3A; 121 | } 122 | body { 123 | background: #76b852; /* fallback for old browsers */ 124 | background: -webkit-linear-gradient(right, #76b852, #8DC26F); 125 | background: -moz-linear-gradient(right, #76b852, #8DC26F); 126 | background: -o-linear-gradient(right, #76b852, #8DC26F); 127 | background: linear-gradient(to left, #76b852, #8DC26F); 128 | font-family: "Roboto", sans-serif; 129 | -webkit-font-smoothing: antialiased; 130 | -moz-osx-font-smoothing: grayscale; 131 | } 132 | -------------------------------------------------------------------------------- /static/css/signup_style.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Roboto:300); 2 | 3 | .body{ 4 | background-image: url('https://ordinaryfaith.net/wp-content/uploads/2016/03/Gray-plain-website-background.jpg'); 5 | background-repeat: no-repeat; 6 | background-size: cover; 7 | } 8 | 9 | 10 | .login-page { 11 | width: 360px; 12 | padding: 8% 0 0; 13 | margin: auto; 14 | 15 | } 16 | .form { 17 | position: relative; 18 | z-index: 1; 19 | background: #48c9b0; 20 | max-width: 360px; 21 | margin: 0 auto 100px; 22 | padding: 45px; 23 | text-align: center; 24 | box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24); 25 | 26 | } 27 | .form input { 28 | font-family: FontAwesome, "Roboto", sans-serif; 29 | outline: 0; 30 | background: #f2f2f2; 31 | width: 100%; 32 | border: 0; 33 | margin: 0 0 15px; 34 | padding: 15px; 35 | box-sizing: border-box; 36 | font-size: 14px; 37 | border-radius:10px; 38 | 39 | } 40 | .form button { 41 | font-family: "Titillium Web", sans-serif; 42 | font-size: 14px; 43 | font-weight: bold; 44 | letter-spacing: .1em; 45 | outline: 0; 46 | background: #17a589; 47 | width: 100%; 48 | border: 0; 49 | border-radius:30px; 50 | margin: 0px 0px 8px; 51 | padding: 15px; 52 | color: #FFFFFF; 53 | -webkit-transition: all 0.3 ease; 54 | transition: all 0.3 ease; 55 | cursor: pointer; 56 | transition: all 0.2s; 57 | 58 | } 59 | .form button:hover,.form button:focus { 60 | background: #148f77; 61 | box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); 62 | transform: translateY(-4px); 63 | } 64 | .form button:active { 65 | transform: translateY(2px); 66 | box-shadow: 0 2.5px 5px rgba(0, 0, 0, 0.2); 67 | } 68 | 69 | .form .message { 70 | 71 | margin: 6px 6px; 72 | color: #808080; 73 | font-size: 11px; 74 | text-align: center; 75 | font-weight: bold; 76 | font-style: normal; 77 | 78 | 79 | 80 | } 81 | .form .message a { 82 | color: #FFFFFF; 83 | text-decoration: none; 84 | font-size: 13px; 85 | } 86 | .form .register-form { 87 | display: none; 88 | } 89 | .container { 90 | position: relative; 91 | z-index: 1; 92 | max-width: 300px; 93 | margin: 0 auto; 94 | } 95 | .container:before, .container:after { 96 | content: ""; 97 | display: block; 98 | clear: both; 99 | } 100 | .container .info { 101 | margin: 50px auto; 102 | text-align: center; 103 | } 104 | .container .info h1 { 105 | margin: 0 0 15px; 106 | padding: 0; 107 | font-size: 36px; 108 | font-weight: 300; 109 | color: #1a1a1a; 110 | } 111 | .container .info span { 112 | color: #4d4d4d; 113 | font-size: 12px; 114 | } 115 | .container .info span a { 116 | color: #000000; 117 | text-decoration: none; 118 | } 119 | .container .info span .fa { 120 | color: #EF3B3A; 121 | } 122 | body { 123 | background: #76b852; /* fallback for old browsers */ 124 | background: -webkit-linear-gradient(right, #76b852, #8DC26F); 125 | background: -moz-linear-gradient(right, #76b852, #8DC26F); 126 | background: -o-linear-gradient(right, #76b852, #8DC26F); 127 | background: linear-gradient(to left, #76b852, #8DC26F); 128 | font-family: "Roboto", sans-serif; 129 | -webkit-font-smoothing: antialiased; 130 | -moz-osx-font-smoothing: grayscale; 131 | } 132 | -------------------------------------------------------------------------------- /yolo_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # @Time : 2021/2/20 18:19 4 | # @Author : xiaorun 5 | # @Site : 6 | # @File : yoloDetect.py 7 | # @Software: PyCharm 8 | import sys 9 | import threading 10 | from threading import Thread 11 | import time 12 | import os 13 | import cv2 14 | from yolo import YOLO5 15 | from flask import Flask, render_template, Response,request,redirect,url_for 16 | import argparse 17 | import json,jsonify 18 | from gevent import monkey 19 | monkey.patch_all() # 打上猴子补丁 20 | from gevent import pywsgi 21 | camera = cv2.VideoCapture(0) 22 | global objs 23 | def parseData(): 24 | parser = argparse.ArgumentParser() 25 | parser.add_argument('--weights', nargs='+', type=str, default='runs/exp0/weights/best.pt', help='model.pt path(s)') 26 | parser.add_argument('--source', type=str, default='0', help='source') # file/folder, 0 for webcam 27 | parser.add_argument('--output', type=str, default='inference/output', help='output folder') # output folder 28 | parser.add_argument('--img-size', type=int, default=480, help='inference size (pixels)') 29 | parser.add_argument('--conf-thres', type=float, default=0.25, help='object confidence threshold') 30 | parser.add_argument('--iou-thres', type=float, default=0.45, help='IOU threshold for NMS') 31 | parser.add_argument('--device', default='cpu', help='cuda device, i.e. 0 or 0,1,2,3 or cpu') 32 | parser.add_argument('--view-img', action='store_true', help='display results') 33 | parser.add_argument('--save-txt', action='store_true', help='save results to *.txt') 34 | parser.add_argument('--save-conf', action='store_true', help='output confidences in --save-txt labels') 35 | parser.add_argument('--classes', nargs='+', type=int, help='filter by class: --class 0, or --class 0 2 3') 36 | parser.add_argument('--agnostic-nms', action='store_true', help='class-agnostic NMS') 37 | parser.add_argument('--augment', action='store_true', help='augmented inference') 38 | parser.add_argument('--update', action='store_true', help='update all models') 39 | opt = parser.parse_args() 40 | return opt 41 | 42 | def objDetector(frame): 43 | yolo = YOLO5() 44 | opt = parseData() 45 | yolo.set_config(opt.weights, opt.device, opt.img_size, opt.conf_thres, opt.iou_thres, True) 46 | yolo.load_model() 47 | objs=yolo.obj_detect(frame) 48 | for obj in objs: 49 | cls=obj["class"] 50 | cor=obj["color"] 51 | conf='%.2f' % obj["confidence"] 52 | label=cls+" "+str(conf) 53 | x,y,w,h=obj["x"],obj["y"],obj["w"],obj["h"] 54 | cv2.rectangle(frame, (int(x),int(y)), (int(x+w), int(y+h)), tuple(cor)) 55 | cv2.putText(frame, label, (int(x),int(y)), cv2.FONT_HERSHEY_SIMPLEX, 1, cor, thickness=2) 56 | person="there are {} person ".format(len(objs)) 57 | cv2.putText(frame, person, (20, 20), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), thickness=3) 58 | #cv2.putText(frame, str(len(objs)), (20,20), cv2.FONT_HERSHEY_SIMPLEX, 1, (0,0,255), thickness=3) 59 | return frame 60 | 61 | def gen_detector(flags): 62 | while True: 63 | ret,frame=camera.read() 64 | if flags==True: 65 | frame=objDetector(frame) 66 | cv2.imshow("test",frame) 67 | if cv2.waitKey(2)==ord("q"): 68 | break 69 | if __name__ == '__main__': 70 | gen_detector(True) -------------------------------------------------------------------------------- /models/export.py: -------------------------------------------------------------------------------- 1 | """Exports a YOLOv5 *.pt model to ONNX and TorchScript formats 2 | 3 | Usage: 4 | $ export PYTHONPATH="$PWD" && python models/export.py --weights ./weights/yolov5s.pt --img 640 --batch 1 5 | """ 6 | 7 | import argparse 8 | 9 | import torch 10 | import torch.nn as nn 11 | 12 | import models 13 | from models.experimental import attempt_load 14 | from utils.activations import Hardswish 15 | from utils.general import set_logging 16 | 17 | if __name__ == '__main__': 18 | parser = argparse.ArgumentParser() 19 | parser.add_argument('--weights', type=str, default='./yolov5s.pt', help='weights path') # from yolov5/models/ 20 | parser.add_argument('--img-size', nargs='+', type=int, default=[640, 640], help='image size') # height, width 21 | parser.add_argument('--batch-size', type=int, default=1, help='batch size') 22 | opt = parser.parse_args() 23 | opt.img_size *= 2 if len(opt.img_size) == 1 else 1 # expand 24 | print(opt) 25 | set_logging() 26 | 27 | # Input 28 | img = torch.zeros((opt.batch_size, 3, *opt.img_size)) # image size(1,3,320,192) iDetection 29 | 30 | # Load PyTorch model 31 | model = attempt_load(opt.weights, map_location=torch.device('cpu')) # load FP32 model 32 | 33 | # Update model 34 | for k, m in model.named_modules(): 35 | m._non_persistent_buffers_set = set() # pytorch 1.6.0 compatability 36 | if isinstance(m, models.common.Conv) and isinstance(m.act, nn.Hardswish): 37 | m.act = Hardswish() # assign activation 38 | # if isinstance(m, models.yolo.Detect): 39 | # m.forward = m.forward_export # assign forward (optional) 40 | model.model[-1].export = True # set Detect() layer export=True 41 | y = model(img) # dry run 42 | 43 | # TorchScript export 44 | try: 45 | print('\nStarting TorchScript export with torch %s...' % torch.__version__) 46 | f = opt.weights.replace('.pt', '.torchscript.pt') # filename 47 | ts = torch.jit.trace(model, img) 48 | ts.save(f) 49 | print('TorchScript export success, saved as %s' % f) 50 | except Exception as e: 51 | print('TorchScript export failure: %s' % e) 52 | 53 | # ONNX export 54 | try: 55 | import onnx 56 | 57 | print('\nStarting ONNX export with onnx %s...' % onnx.__version__) 58 | f = opt.weights.replace('.pt', '.onnx') # filename 59 | torch.onnx.export(model, img, f, verbose=False, opset_version=12, input_names=['images'], 60 | output_names=['classes', 'boxes'] if y is None else ['output']) 61 | 62 | # Checks 63 | onnx_model = onnx.load(f) # load onnx model 64 | onnx.checker.check_model(onnx_model) # check onnx model 65 | # print(onnx.helper.printable_graph(onnx_model.graph)) # print a human readable model 66 | print('ONNX export success, saved as %s' % f) 67 | except Exception as e: 68 | print('ONNX export failure: %s' % e) 69 | 70 | # CoreML export 71 | try: 72 | import coremltools as ct 73 | 74 | print('\nStarting CoreML export with coremltools %s...' % ct.__version__) 75 | # convert model from torchscript and apply pixel scaling as per detect.py 76 | model = ct.convert(ts, inputs=[ct.ImageType(name='images', shape=img.shape, scale=1 / 255.0, bias=[0, 0, 0])]) 77 | f = opt.weights.replace('.pt', '.mlmodel') # filename 78 | model.save(f) 79 | print('CoreML export success, saved as %s' % f) 80 | except Exception as e: 81 | print('CoreML export failure: %s' % e) 82 | 83 | # Finish 84 | print('\nExport complete. Visualize with https://github.com/lutzroeder/netron.') 85 | -------------------------------------------------------------------------------- /hubconf.py: -------------------------------------------------------------------------------- 1 | """File for accessing YOLOv5 via PyTorch Hub https://pytorch.org/hub/ 2 | 3 | Usage: 4 | import torch 5 | model = torch.hub.load('ultralytics/yolov5', 'yolov5s', pretrained=True, channels=3, classes=80) 6 | """ 7 | 8 | dependencies = ['torch', 'yaml'] 9 | import os 10 | 11 | import torch 12 | 13 | from models.common import NMS 14 | from models.yolo import Model 15 | from utils.google_utils import attempt_download 16 | 17 | 18 | def create(name, pretrained, channels, classes): 19 | """Creates a specified YOLOv5 model 20 | 21 | Arguments: 22 | name (str): name of model, i.e. 'yolov5s' 23 | pretrained (bool): load pretrained weights into the model 24 | channels (int): number of input channels 25 | classes (int): number of model classes 26 | 27 | Returns: 28 | pytorch model 29 | """ 30 | config = os.path.join(os.path.dirname(__file__), 'models', '%s.yaml' % name) # model.yaml path 31 | try: 32 | model = Model(config, channels, classes) 33 | if pretrained: 34 | ckpt = '%s.pt' % name # checkpoint filename 35 | attempt_download(ckpt) # download if not found locally 36 | state_dict = torch.load(ckpt, map_location=torch.device('cpu'))['model'].float().state_dict() # to FP32 37 | state_dict = {k: v for k, v in state_dict.items() if model.state_dict()[k].shape == v.shape} # filter 38 | model.load_state_dict(state_dict, strict=False) # load 39 | 40 | model.add_nms() # add NMS module 41 | model.eval() 42 | return model 43 | 44 | except Exception as e: 45 | help_url = 'https://github.com/ultralytics/yolov5/issues/36' 46 | s = 'Cache maybe be out of date, deleting cache and retrying may solve this. See %s for help.' % help_url 47 | raise Exception(s) from e 48 | 49 | 50 | def yolov5s(pretrained=False, channels=3, classes=80): 51 | """YOLOv5-small model from https://github.com/ultralytics/yolov5 52 | 53 | Arguments: 54 | pretrained (bool): load pretrained weights into the model, default=False 55 | channels (int): number of input channels, default=3 56 | classes (int): number of model classes, default=80 57 | 58 | Returns: 59 | pytorch model 60 | """ 61 | return create('yolov5s', pretrained, channels, classes) 62 | 63 | 64 | def yolov5m(pretrained=False, channels=3, classes=80): 65 | """YOLOv5-medium model from https://github.com/ultralytics/yolov5 66 | 67 | Arguments: 68 | pretrained (bool): load pretrained weights into the model, default=False 69 | channels (int): number of input channels, default=3 70 | classes (int): number of model classes, default=80 71 | 72 | Returns: 73 | pytorch model 74 | """ 75 | return create('yolov5m', pretrained, channels, classes) 76 | 77 | 78 | def yolov5l(pretrained=False, channels=3, classes=80): 79 | """YOLOv5-large model from https://github.com/ultralytics/yolov5 80 | 81 | Arguments: 82 | pretrained (bool): load pretrained weights into the model, default=False 83 | channels (int): number of input channels, default=3 84 | classes (int): number of model classes, default=80 85 | 86 | Returns: 87 | pytorch model 88 | """ 89 | return create('yolov5l', pretrained, channels, classes) 90 | 91 | 92 | def yolov5x(pretrained=False, channels=3, classes=80): 93 | """YOLOv5-xlarge model from https://github.com/ultralytics/yolov5 94 | 95 | Arguments: 96 | pretrained (bool): load pretrained weights into the model, default=False 97 | channels (int): number of input channels, default=3 98 | classes (int): number of model classes, default=80 99 | 100 | Returns: 101 | pytorch model 102 | """ 103 | return create('yolov5x', pretrained, channels, classes) 104 | -------------------------------------------------------------------------------- /yoloDetect.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # @Time : 2021/2/20 18:19 4 | # @Author : xiaorun 5 | # @Site : 6 | # @File : yoloDetect.py 7 | # @Software: PyCharm 8 | import sys 9 | import threading 10 | from threading import Thread 11 | import time 12 | import os 13 | import cv2 14 | from yolo import YOLO5 15 | from flask import Flask, render_template, Response,request,redirect,url_for 16 | import argparse 17 | import json,jsonify 18 | from gevent import monkey 19 | monkey.patch_all() # 打上猴子补丁 20 | from gevent import pywsgi 21 | camera = cv2.VideoCapture(0) 22 | app = Flask(__name__,template_folder='./templates') 23 | global objs 24 | def parseData(): 25 | parser = argparse.ArgumentParser() 26 | parser.add_argument('--weights', nargs='+', type=str, default='runs/exp0/weights/best.pt', help='model.pt path(s)') 27 | parser.add_argument('--source', type=str, default='0', help='source') # file/folder, 0 for webcam 28 | parser.add_argument('--output', type=str, default='inference/output', help='output folder') # output folder 29 | parser.add_argument('--img-size', type=int, default=480, help='inference size (pixels)') 30 | parser.add_argument('--conf-thres', type=float, default=0.25, help='object confidence threshold') 31 | parser.add_argument('--iou-thres', type=float, default=0.45, help='IOU threshold for NMS') 32 | parser.add_argument('--device', default='cpu', help='cuda device, i.e. 0 or 0,1,2,3 or cpu') 33 | parser.add_argument('--view-img', action='store_true', help='display results') 34 | parser.add_argument('--save-txt', action='store_true', help='save results to *.txt') 35 | parser.add_argument('--save-conf', action='store_true', help='output confidences in --save-txt labels') 36 | parser.add_argument('--classes', nargs='+', type=int, help='filter by class: --class 0, or --class 0 2 3') 37 | parser.add_argument('--agnostic-nms', action='store_true', help='class-agnostic NMS') 38 | parser.add_argument('--augment', action='store_true', help='augmented inference') 39 | parser.add_argument('--update', action='store_true', help='update all models') 40 | opt = parser.parse_args() 41 | return opt 42 | 43 | def objDetector(frame): 44 | yolo = YOLO5() 45 | opt = parseData() 46 | yolo.set_config(opt.weights, opt.device, opt.img_size, opt.conf_thres, opt.iou_thres, True) 47 | yolo.load_model() 48 | objs=yolo.obj_detect(frame) 49 | print(objs) 50 | for obj in objs: 51 | cls=obj["class"] 52 | cor=obj["color"] 53 | conf='%.2f' % obj["confidence"] 54 | label=cls+" "+str(conf) 55 | x,y,w,h=obj["x"],obj["y"],obj["w"],obj["h"] 56 | cv2.rectangle(frame, (int(x),int(y)), (int(x+w), int(y+h)), tuple(cor)) 57 | cv2.putText(frame, label, (int(x),int(y)), cv2.FONT_HERSHEY_SIMPLEX, 1, cor, thickness=2) 58 | 59 | return frame 60 | 61 | def gen_detector(flags): 62 | while True: 63 | ret,frame=camera.read() 64 | if flags==True: 65 | frame=objDetector(frame) 66 | _, frame = cv2.imencode('.JPEG',frame) 67 | yield (b'--frame\r\n' 68 | b'Content-Type: image/jpeg\r\n\r\n' + frame.tostring() + b'\r\n') 69 | 70 | 71 | 72 | @app.route('/camera_detector') 73 | def video_feed(): 74 | return Response(gen_detector(True), 75 | mimetype='multipart/x-mixed-replace; boundary=frame') 76 | 77 | 78 | @app.route('/camera_raw') 79 | def video_raw(): 80 | return Response(gen_detector(False), 81 | mimetype='multipart/x-mixed-replace; boundary=frame') 82 | 83 | 84 | @app.route('/config') 85 | def parseConfig(): 86 | if request.method == 'GET': # 请求方式是get 87 | iou_thresh= request.args.get('iou_thresh') # args取get方式参数 88 | conf= request.args.get('conf') 89 | source = request.args.get('source') 90 | 91 | return iou_thresh,conf,source 92 | 93 | @app.route('/') 94 | def index(): # 视图函数 95 | return render_template('login.html') 96 | 97 | 98 | 99 | 100 | @app.route('/person') # 代表个人中心页 101 | def login(): # 视图函数 102 | if request.method == 'GET': # 请求方式是get 103 | name = request.args.get('username') # args取get方式参数 104 | password = request.args.get('password') 105 | if (name=="admin" and password=="admin"): 106 | return render_template('index.html') 107 | #return redirect(url_for('index.html')) 108 | else: 109 | return render_template('login.html') 110 | 111 | 112 | 113 | @app.route('/data') 114 | def data_response(): 115 | global objs 116 | data=jsonify(objs) 117 | return data 118 | 119 | if __name__ == '__main__': 120 | server = pywsgi.WSGIServer(('127.0.0.1', 7000), app) 121 | server.serve_forever() 122 | #app.run(host='127.0.0.1', port=7000) -------------------------------------------------------------------------------- /yolo.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | 4 | import numpy as np 5 | import torch 6 | 7 | from models.experimental import attempt_load 8 | from utils.datasets import letterbox 9 | from utils.general import (check_img_size, non_max_suppression, scale_coords, set_logging) 10 | from utils.torch_utils import select_device, time_synchronized 11 | 12 | 13 | class YOLO5: 14 | def __init__(self): 15 | self.opt = dict() # 配置信息 16 | self.model = None 17 | self.device = None 18 | self.names = [] 19 | self.colors = [] 20 | 21 | def set_config(self, weights, device='cpu', img_size=480, conf=0.4, iou=0.5, 22 | agnostic=True, augment=True,netstreamvedio="") -> bool: 23 | """检查参数的正确性并设置参数,参数改变后需要重新设置""" 24 | # 判断weights文件是否以'pt'结尾且真实存在 25 | if not os.path.exists(weights) or '.pt' not in weights: 26 | return False 27 | 28 | # 判断device设置是否正确 29 | check_device = True 30 | if device in ['cpu', '0', '1', '2', '3']: 31 | check_device = True 32 | elif re.match(r'[0-3],[0-3](,[0-3])?(,[0-3])?', device): 33 | for c in ['0', '1', '2', '3']: 34 | if device.count(c) > 1: 35 | check_device = False 36 | break 37 | if not check_device: 38 | return False 39 | 40 | # img_size是否32的整数倍 41 | if img_size % 32 != 0: 42 | return False 43 | 44 | if conf <= 0 or conf >= 1: 45 | return False 46 | 47 | if iou <= 0 or iou >= 1: 48 | return False 49 | 50 | # 初始化配置 51 | self.opt = { 52 | 'weights': weights, 53 | 'device': device, 54 | 'img_size': img_size, 55 | 'conf_thresh': conf, 56 | 'iou_thresh': iou, 57 | 'agnostic_nms': agnostic, 58 | 'augment': augment 59 | } 60 | return True 61 | 62 | def load_model(self): 63 | """加载模型,参数改变后需要重新加载模型""" 64 | # Initialize 65 | set_logging() 66 | #print(torch.cuda.is_available()) 67 | self.device = select_device(self.opt['device']) 68 | 69 | # Load model 70 | self.model = attempt_load(self.opt['weights'], map_location=self.device) # load FP32 model 71 | self.opt['img_size'] = check_img_size( 72 | self.opt['img_size'], s=self.model.stride.max()) # check img_size 73 | 74 | # Get names and colors 75 | self.names = self.model.module.names if hasattr(self.model, 'module') else self.model.names 76 | #self.colors = [[np.random.randint(0, 255) for _ in range(3)] for _ in range(len(self.names))] 77 | self.colors = [[0,0,255],[255,0,0]] 78 | return True 79 | 80 | def obj_detect(self, image): 81 | objects = [] # 返回目标列表 82 | img_h, img_w, _ = image.shape 83 | 84 | # Padded resize 85 | img = letterbox(image, new_shape=self.opt['img_size'])[0] 86 | 87 | # Convert 88 | img = img[:, :, ::-1].transpose(2, 0, 1) # BGR to RGB 89 | img = np.ascontiguousarray(img) # 转换为内存连续存储的数组 90 | 91 | # Run inference 92 | img = torch.from_numpy(img).to(self.device) 93 | img = img.float() # uint8 to fp16/32 94 | img /= 255.0 # 0 - 255 to 0.0 - 1.0 95 | if img.ndimension() == 3: 96 | img = img.unsqueeze(0) # 添加一维 97 | 98 | # Inference 99 | t1 = time_synchronized() 100 | pred = self.model(img, augment=self.opt['augment'])[0] 101 | t2 = time_synchronized() 102 | #print('Time:', t2 - t1) 103 | 104 | # Apply NMS 105 | pred = non_max_suppression(pred, self.opt['conf_thresh'], self.opt['iou_thresh'], 106 | classes=None, agnostic=self.opt['agnostic_nms']) 107 | 108 | # Process detections 109 | person = 0 110 | hat = 0 111 | #print(self.names,self.colors) 112 | for i, det in enumerate(pred): # detections per image 113 | gn = torch.tensor(image.shape)[[1, 0, 1, 0]] # normalization gain whwh 114 | if det is not None and len(det): 115 | # Rescale boxes from img_size to image size 116 | det[:, :4] = scale_coords(img.shape[2:], det[:, :4], image.shape).round() 117 | 118 | # Write results 119 | for *xyxy, conf, cls in reversed(det): 120 | xyxy = [xy.item() for xy in xyxy] # tensor列表转为一般列表 121 | xywh = [xyxy[0] / img_w, xyxy[1] / img_h, 122 | (xyxy[2] - xyxy[0]) / img_w, (xyxy[3] - xyxy[1]) / img_h] # 转相对于宽高的坐标 123 | #xywh=[xyxy[0],xyxy[1],xyxy[2]-xyxy[0],xyxy[3]-xyxy[1]] 124 | #objects.append({'class': self.names[int(cls)], 'color': self.colors[int(cls)], 125 | 'confidence': conf.item(), 'x': xywh[0], 'y': xywh[1], 'w': xywh[2], 'h': xywh[3]}) 126 | return objects 127 | -------------------------------------------------------------------------------- /models/common.py: -------------------------------------------------------------------------------- 1 | # This file contains modules common to various models 2 | import math 3 | 4 | import torch 5 | import torch.nn as nn 6 | from utils.general import non_max_suppression 7 | 8 | 9 | def autopad(k, p=None): # kernel, padding 10 | # Pad to 'same' 11 | if p is None: 12 | p = k // 2 if isinstance(k, int) else [x // 2 for x in k] # auto-pad 13 | return p 14 | 15 | 16 | def DWConv(c1, c2, k=1, s=1, act=True): 17 | # Depthwise convolution 18 | return Conv(c1, c2, k, s, g=math.gcd(c1, c2), act=act) 19 | 20 | 21 | class Conv(nn.Module): 22 | # Standard convolution 23 | def __init__(self, c1, c2, k=1, s=1, p=None, g=1, act=True): # ch_in, ch_out, kernel, stride, padding, groups 24 | super(Conv, self).__init__() 25 | self.conv = nn.Conv2d(c1, c2, k, s, autopad(k, p), groups=g, bias=False) 26 | self.bn = nn.BatchNorm2d(c2) 27 | self.act = nn.Hardswish() if act else nn.Identity() 28 | 29 | def forward(self, x): 30 | return self.act(self.bn(self.conv(x))) 31 | 32 | def fuseforward(self, x): 33 | return self.act(self.conv(x)) 34 | 35 | 36 | class Bottleneck(nn.Module): 37 | # Standard bottleneck 38 | def __init__(self, c1, c2, shortcut=True, g=1, e=0.5): # ch_in, ch_out, shortcut, groups, expansion 39 | super(Bottleneck, self).__init__() 40 | c_ = int(c2 * e) # hidden channels 41 | self.cv1 = Conv(c1, c_, 1, 1) 42 | self.cv2 = Conv(c_, c2, 3, 1, g=g) 43 | self.add = shortcut and c1 == c2 44 | 45 | def forward(self, x): 46 | return x + self.cv2(self.cv1(x)) if self.add else self.cv2(self.cv1(x)) 47 | 48 | 49 | class BottleneckCSP(nn.Module): 50 | # CSP Bottleneck https://github.com/WongKinYiu/CrossStagePartialNetworks 51 | def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): # ch_in, ch_out, number, shortcut, groups, expansion 52 | super(BottleneckCSP, self).__init__() 53 | c_ = int(c2 * e) # hidden channels 54 | self.cv1 = Conv(c1, c_, 1, 1) 55 | self.cv2 = nn.Conv2d(c1, c_, 1, 1, bias=False) 56 | self.cv3 = nn.Conv2d(c_, c_, 1, 1, bias=False) 57 | self.cv4 = Conv(2 * c_, c2, 1, 1) 58 | self.bn = nn.BatchNorm2d(2 * c_) # applied to cat(cv2, cv3) 59 | self.act = nn.LeakyReLU(0.1, inplace=True) 60 | self.m = nn.Sequential(*[Bottleneck(c_, c_, shortcut, g, e=1.0) for _ in range(n)]) 61 | 62 | def forward(self, x): 63 | y1 = self.cv3(self.m(self.cv1(x))) 64 | y2 = self.cv2(x) 65 | return self.cv4(self.act(self.bn(torch.cat((y1, y2), dim=1)))) 66 | 67 | 68 | class SPP(nn.Module): 69 | # Spatial pyramid pooling layer used in YOLOv3-SPP 70 | def __init__(self, c1, c2, k=(5, 9, 13)): 71 | super(SPP, self).__init__() 72 | c_ = c1 // 2 # hidden channels 73 | self.cv1 = Conv(c1, c_, 1, 1) 74 | self.cv2 = Conv(c_ * (len(k) + 1), c2, 1, 1) 75 | self.m = nn.ModuleList([nn.MaxPool2d(kernel_size=x, stride=1, padding=x // 2) for x in k]) 76 | 77 | def forward(self, x): 78 | x = self.cv1(x) 79 | return self.cv2(torch.cat([x] + [m(x) for m in self.m], 1)) 80 | 81 | 82 | class Focus(nn.Module): 83 | # Focus wh information into c-space 84 | def __init__(self, c1, c2, k=1, s=1, p=None, g=1, act=True): # ch_in, ch_out, kernel, stride, padding, groups 85 | super(Focus, self).__init__() 86 | self.conv = Conv(c1 * 4, c2, k, s, p, g, act) 87 | 88 | def forward(self, x): # x(b,c,w,h) -> y(b,4c,w/2,h/2) 89 | return self.conv(torch.cat([x[..., ::2, ::2], x[..., 1::2, ::2], x[..., ::2, 1::2], x[..., 1::2, 1::2]], 1)) 90 | 91 | 92 | class Concat(nn.Module): 93 | # Concatenate a list of tensors along dimension 94 | def __init__(self, dimension=1): 95 | super(Concat, self).__init__() 96 | self.d = dimension 97 | 98 | def forward(self, x): 99 | return torch.cat(x, self.d) 100 | 101 | 102 | class NMS(nn.Module): 103 | # Non-Maximum Suppression (NMS) module 104 | conf = 0.3 # confidence threshold 105 | iou = 0.6 # IoU threshold 106 | classes = None # (optional list) filter by class 107 | 108 | def __init__(self, dimension=1): 109 | super(NMS, self).__init__() 110 | 111 | def forward(self, x): 112 | return non_max_suppression(x[0], conf_thres=self.conf, iou_thres=self.iou, classes=self.classes) 113 | 114 | 115 | class Flatten(nn.Module): 116 | # Use after nn.AdaptiveAvgPool2d(1) to remove last 2 dimensions 117 | @staticmethod 118 | def forward(x): 119 | return x.view(x.size(0), -1) 120 | 121 | 122 | class Classify(nn.Module): 123 | # Classification head, i.e. x(b,c1,20,20) to x(b,c2) 124 | def __init__(self, c1, c2, k=1, s=1, p=None, g=1): # ch_in, ch_out, kernel, stride, padding, groups 125 | super(Classify, self).__init__() 126 | self.aap = nn.AdaptiveAvgPool2d(1) # to x(b,c1,1,1) 127 | self.conv = nn.Conv2d(c1, c2, k, s, autopad(k, p), groups=g, bias=False) # to x(b,c2,1,1) 128 | self.flat = Flatten() 129 | 130 | def forward(self, x): 131 | z = torch.cat([self.aap(y) for y in (x if isinstance(x, list) else [x])], 1) # cat if list 132 | return self.flat(self.conv(z)) # flatten to x(b,c2) 133 | -------------------------------------------------------------------------------- /utils/google_utils.py: -------------------------------------------------------------------------------- 1 | # This file contains google utils: https://cloud.google.com/storage/docs/reference/libraries 2 | # pip install --upgrade google-cloud-storage 3 | # from google.cloud import storage 4 | 5 | import os 6 | import platform 7 | import subprocess 8 | import time 9 | from pathlib import Path 10 | 11 | import torch 12 | 13 | 14 | def gsutil_getsize(url=''): 15 | # gs://bucket/file size https://cloud.google.com/storage/docs/gsutil/commands/du 16 | s = subprocess.check_output('gsutil du %s' % url, shell=True).decode('utf-8') 17 | return eval(s.split(' ')[0]) if len(s) else 0 # bytes 18 | 19 | 20 | def attempt_download(weights): 21 | # Attempt to download pretrained weights if not found locally 22 | weights = weights.strip().replace("'", '') 23 | file = Path(weights).name 24 | 25 | msg = weights + ' missing, try downloading from https://github.com/ultralytics/yolov5/releases/' 26 | models = ['yolov5s.pt', 'yolov5m.pt', 'yolov5l.pt', 'yolov5x.pt'] # available models 27 | 28 | if file in models and not os.path.isfile(weights): 29 | # Google Drive 30 | # d = {'yolov5s.pt': '1R5T6rIyy3lLwgFXNms8whc-387H0tMQO', 31 | # 'yolov5m.pt': '1vobuEExpWQVpXExsJ2w-Mbf3HJjWkQJr', 32 | # 'yolov5l.pt': '1hrlqD1Wdei7UT4OgT785BEk1JwnSvNEV', 33 | # 'yolov5x.pt': '1mM8aZJlWTxOg7BZJvNUMrTnA2AbeCVzS'} 34 | # r = gdrive_download(id=d[file], name=weights) if file in d else 1 35 | # if r == 0 and os.path.exists(weights) and os.path.getsize(weights) > 1E6: # check 36 | # return 37 | 38 | try: # GitHub 39 | url = 'https://github.com/ultralytics/yolov5/releases/download/v3.0/' + file 40 | print('Downloading %s to %s...' % (url, weights)) 41 | torch.hub.download_url_to_file(url, weights) 42 | assert os.path.exists(weights) and os.path.getsize(weights) > 1E6 # check 43 | except Exception as e: # GCP 44 | print('Download error: %s' % e) 45 | url = 'https://storage.googleapis.com/ultralytics/yolov5/ckpt/' + file 46 | print('Downloading %s to %s...' % (url, weights)) 47 | r = os.system('curl -L %s -o %s' % (url, weights)) # torch.hub.download_url_to_file(url, weights) 48 | finally: 49 | if not (os.path.exists(weights) and os.path.getsize(weights) > 1E6): # check 50 | os.remove(weights) if os.path.exists(weights) else None # remove partial downloads 51 | print('ERROR: Download failure: %s' % msg) 52 | print('') 53 | return 54 | 55 | 56 | def gdrive_download(id='1n_oKgR81BJtqk75b00eAjdv03qVCQn2f', name='coco128.zip'): 57 | # Downloads a file from Google Drive. from utils.google_utils import *; gdrive_download() 58 | t = time.time() 59 | 60 | print('Downloading https://drive.google.com/uc?export=download&id=%s as %s... ' % (id, name), end='') 61 | os.remove(name) if os.path.exists(name) else None # remove existing 62 | os.remove('cookie') if os.path.exists('cookie') else None 63 | 64 | # Attempt file download 65 | out = "NUL" if platform.system() == "Windows" else "/dev/null" 66 | os.system('curl -c ./cookie -s -L "drive.google.com/uc?export=download&id=%s" > %s ' % (id, out)) 67 | if os.path.exists('cookie'): # large file 68 | s = 'curl -Lb ./cookie "drive.google.com/uc?export=download&confirm=%s&id=%s" -o %s' % (get_token(), id, name) 69 | else: # small file 70 | s = 'curl -s -L -o %s "drive.google.com/uc?export=download&id=%s"' % (name, id) 71 | r = os.system(s) # execute, capture return 72 | os.remove('cookie') if os.path.exists('cookie') else None 73 | 74 | # Error check 75 | if r != 0: 76 | os.remove(name) if os.path.exists(name) else None # remove partial 77 | print('Download error ') # raise Exception('Download error') 78 | return r 79 | 80 | # Unzip if archive 81 | if name.endswith('.zip'): 82 | print('unzipping... ', end='') 83 | os.system('unzip -q %s' % name) # unzip 84 | os.remove(name) # remove zip to free space 85 | 86 | print('Done (%.1fs)' % (time.time() - t)) 87 | return r 88 | 89 | 90 | def get_token(cookie="./cookie"): 91 | with open(cookie) as f: 92 | for line in f: 93 | if "download" in line: 94 | return line.split()[-1] 95 | return "" 96 | 97 | # def upload_blob(bucket_name, source_file_name, destination_blob_name): 98 | # # Uploads a file to a bucket 99 | # # https://cloud.google.com/storage/docs/uploading-objects#storage-upload-object-python 100 | # 101 | # storage_client = storage.Client() 102 | # bucket = storage_client.get_bucket(bucket_name) 103 | # blob = bucket.blob(destination_blob_name) 104 | # 105 | # blob.upload_from_filename(source_file_name) 106 | # 107 | # print('File {} uploaded to {}.'.format( 108 | # source_file_name, 109 | # destination_blob_name)) 110 | # 111 | # 112 | # def download_blob(bucket_name, source_blob_name, destination_file_name): 113 | # # Uploads a blob from a bucket 114 | # storage_client = storage.Client() 115 | # bucket = storage_client.get_bucket(bucket_name) 116 | # blob = bucket.blob(source_blob_name) 117 | # 118 | # blob.download_to_filename(destination_file_name) 119 | # 120 | # print('Blob {} downloaded to {}.'.format( 121 | # source_blob_name, 122 | # destination_file_name)) 123 | -------------------------------------------------------------------------------- /models/experimental.py: -------------------------------------------------------------------------------- 1 | # This file contains experimental modules 2 | 3 | import numpy as np 4 | import torch 5 | import torch.nn as nn 6 | 7 | from models.common import Conv, DWConv 8 | from utils.google_utils import attempt_download 9 | 10 | 11 | class CrossConv(nn.Module): 12 | # Cross Convolution Downsample 13 | def __init__(self, c1, c2, k=3, s=1, g=1, e=1.0, shortcut=False): 14 | # ch_in, ch_out, kernel, stride, groups, expansion, shortcut 15 | super(CrossConv, self).__init__() 16 | c_ = int(c2 * e) # hidden channels 17 | self.cv1 = Conv(c1, c_, (1, k), (1, s)) 18 | self.cv2 = Conv(c_, c2, (k, 1), (s, 1), g=g) 19 | self.add = shortcut and c1 == c2 20 | 21 | def forward(self, x): 22 | return x + self.cv2(self.cv1(x)) if self.add else self.cv2(self.cv1(x)) 23 | 24 | 25 | class C3(nn.Module): 26 | # Cross Convolution CSP 27 | def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): # ch_in, ch_out, number, shortcut, groups, expansion 28 | super(C3, self).__init__() 29 | c_ = int(c2 * e) # hidden channels 30 | self.cv1 = Conv(c1, c_, 1, 1) 31 | self.cv2 = nn.Conv2d(c1, c_, 1, 1, bias=False) 32 | self.cv3 = nn.Conv2d(c_, c_, 1, 1, bias=False) 33 | self.cv4 = Conv(2 * c_, c2, 1, 1) 34 | self.bn = nn.BatchNorm2d(2 * c_) # applied to cat(cv2, cv3) 35 | self.act = nn.LeakyReLU(0.1, inplace=True) 36 | self.m = nn.Sequential(*[CrossConv(c_, c_, 3, 1, g, 1.0, shortcut) for _ in range(n)]) 37 | 38 | def forward(self, x): 39 | y1 = self.cv3(self.m(self.cv1(x))) 40 | y2 = self.cv2(x) 41 | return self.cv4(self.act(self.bn(torch.cat((y1, y2), dim=1)))) 42 | 43 | 44 | class Sum(nn.Module): 45 | # Weighted sum of 2 or more layers https://arxiv.org/abs/1911.09070 46 | def __init__(self, n, weight=False): # n: number of inputs 47 | super(Sum, self).__init__() 48 | self.weight = weight # apply weights boolean 49 | self.iter = range(n - 1) # iter object 50 | if weight: 51 | self.w = nn.Parameter(-torch.arange(1., n) / 2, requires_grad=True) # layer weights 52 | 53 | def forward(self, x): 54 | y = x[0] # no weight 55 | if self.weight: 56 | w = torch.sigmoid(self.w) * 2 57 | for i in self.iter: 58 | y = y + x[i + 1] * w[i] 59 | else: 60 | for i in self.iter: 61 | y = y + x[i + 1] 62 | return y 63 | 64 | 65 | class GhostConv(nn.Module): 66 | # Ghost Convolution https://github.com/huawei-noah/ghostnet 67 | def __init__(self, c1, c2, k=1, s=1, g=1, act=True): # ch_in, ch_out, kernel, stride, groups 68 | super(GhostConv, self).__init__() 69 | c_ = c2 // 2 # hidden channels 70 | self.cv1 = Conv(c1, c_, k, s, g, act) 71 | self.cv2 = Conv(c_, c_, 5, 1, c_, act) 72 | 73 | def forward(self, x): 74 | y = self.cv1(x) 75 | return torch.cat([y, self.cv2(y)], 1) 76 | 77 | 78 | class GhostBottleneck(nn.Module): 79 | # Ghost Bottleneck https://github.com/huawei-noah/ghostnet 80 | def __init__(self, c1, c2, k, s): 81 | super(GhostBottleneck, self).__init__() 82 | c_ = c2 // 2 83 | self.conv = nn.Sequential(GhostConv(c1, c_, 1, 1), # pw 84 | DWConv(c_, c_, k, s, act=False) if s == 2 else nn.Identity(), # dw 85 | GhostConv(c_, c2, 1, 1, act=False)) # pw-linear 86 | self.shortcut = nn.Sequential(DWConv(c1, c1, k, s, act=False), 87 | Conv(c1, c2, 1, 1, act=False)) if s == 2 else nn.Identity() 88 | 89 | def forward(self, x): 90 | return self.conv(x) + self.shortcut(x) 91 | 92 | 93 | class MixConv2d(nn.Module): 94 | # Mixed Depthwise Conv https://arxiv.org/abs/1907.09595 95 | def __init__(self, c1, c2, k=(1, 3), s=1, equal_ch=True): 96 | super(MixConv2d, self).__init__() 97 | groups = len(k) 98 | if equal_ch: # equal c_ per group 99 | i = torch.linspace(0, groups - 1E-6, c2).floor() # c2 indices 100 | c_ = [(i == g).sum() for g in range(groups)] # intermediate channels 101 | else: # equal weight.numel() per group 102 | b = [c2] + [0] * groups 103 | a = np.eye(groups + 1, groups, k=-1) 104 | a -= np.roll(a, 1, axis=1) 105 | a *= np.array(k) ** 2 106 | a[0] = 1 107 | c_ = np.linalg.lstsq(a, b, rcond=None)[0].round() # solve for equal weight indices, ax = b 108 | 109 | self.m = nn.ModuleList([nn.Conv2d(c1, int(c_[g]), k[g], s, k[g] // 2, bias=False) for g in range(groups)]) 110 | self.bn = nn.BatchNorm2d(c2) 111 | self.act = nn.LeakyReLU(0.1, inplace=True) 112 | 113 | def forward(self, x): 114 | return x + self.act(self.bn(torch.cat([m(x) for m in self.m], 1))) 115 | 116 | 117 | class Ensemble(nn.ModuleList): 118 | # Ensemble of models 119 | def __init__(self): 120 | super(Ensemble, self).__init__() 121 | 122 | def forward(self, x, augment=False): 123 | y = [] 124 | for module in self: 125 | y.append(module(x, augment)[0]) 126 | # y = torch.stack(y).max(0)[0] # max ensemble 127 | # y = torch.cat(y, 1) # nms ensemble 128 | y = torch.stack(y).mean(0) # mean ensemble 129 | return y, None # inference, train output 130 | 131 | 132 | def attempt_load(weights, map_location=None): 133 | # Loads an ensemble of models weights=[a,b,c] or a single model weights=[a] or weights=a 134 | model = Ensemble() 135 | for w in weights if isinstance(weights, list) else [weights]: 136 | attempt_download(w) 137 | model.append(torch.load(w, map_location=map_location)['model'].float().fuse().eval()) # load FP32 model 138 | 139 | if len(model) == 1: 140 | return model[-1] # return model 141 | else: 142 | print('Ensemble created with %s\n' % weights) 143 | for k in ['names', 'stride']: 144 | setattr(model, k, getattr(model[-1], k)) 145 | return model # return ensemble 146 | -------------------------------------------------------------------------------- /utils/torch_utils.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import math 3 | import os 4 | import time 5 | from copy import deepcopy 6 | 7 | import torch 8 | import torch.backends.cudnn as cudnn 9 | import torch.nn as nn 10 | import torch.nn.functional as F 11 | import torchvision.models as models 12 | 13 | logger = logging.getLogger(__name__) 14 | 15 | 16 | def init_seeds(seed=0): 17 | torch.manual_seed(seed) 18 | 19 | # Speed-reproducibility tradeoff https://pytorch.org/docs/stable/notes/randomness.html 20 | if seed == 0: # slower, more reproducible 21 | cudnn.deterministic = True 22 | cudnn.benchmark = False 23 | else: # faster, less reproducible 24 | cudnn.deterministic = False 25 | cudnn.benchmark = True 26 | 27 | 28 | def select_device(device='', batch_size=None): 29 | # device = 'cpu' or '0' or '0,1,2,3' 30 | print(torch.cuda.is_available()) 31 | cpu_request = device.lower() == 'cpu' 32 | if device and not cpu_request: # if device requested other than 'cpu' 33 | os.environ['CUDA_VISIBLE_DEVICES'] = device # set environment variable 34 | assert torch.cuda.is_available(), 'CUDA unavailable, invalid device %s requested' % device # check availablity 35 | 36 | cuda = False if cpu_request else torch.cuda.is_available() 37 | if cuda: 38 | c = 1024 ** 2 # bytes to MB 39 | ng = torch.cuda.device_count() 40 | if ng > 1 and batch_size: # check that batch_size is compatible with device_count 41 | assert batch_size % ng == 0, 'batch-size %g not multiple of GPU count %g' % (batch_size, ng) 42 | x = [torch.cuda.get_device_properties(i) for i in range(ng)] 43 | s = 'Using CUDA ' 44 | for i in range(0, ng): 45 | if i == 1: 46 | s = ' ' * len(s) 47 | logger.info("%sdevice%g _CudaDeviceProperties(name='%s', total_memory=%dMB)" % 48 | (s, i, x[i].name, x[i].total_memory / c)) 49 | else: 50 | logger.info('Using CPU') 51 | 52 | logger.info('') # skip a line 53 | return torch.device('cuda:0' if cuda else 'cpu') 54 | 55 | 56 | def time_synchronized(): 57 | torch.cuda.synchronize() if torch.cuda.is_available() else None 58 | return time.time() 59 | 60 | 61 | def is_parallel(model): 62 | return type(model) in (nn.parallel.DataParallel, nn.parallel.DistributedDataParallel) 63 | 64 | 65 | def intersect_dicts(da, db, exclude=()): 66 | # Dictionary intersection of matching keys and shapes, omitting 'exclude' keys, using da values 67 | return {k: v for k, v in da.items() if k in db and not any(x in k for x in exclude) and v.shape == db[k].shape} 68 | 69 | 70 | def initialize_weights(model): 71 | for m in model.modules(): 72 | t = type(m) 73 | if t is nn.Conv2d: 74 | pass # nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu') 75 | elif t is nn.BatchNorm2d: 76 | m.eps = 1e-3 77 | m.momentum = 0.03 78 | elif t in [nn.LeakyReLU, nn.ReLU, nn.ReLU6]: 79 | m.inplace = True 80 | 81 | 82 | def find_modules(model, mclass=nn.Conv2d): 83 | # Finds layer indices matching module class 'mclass' 84 | return [i for i, m in enumerate(model.module_list) if isinstance(m, mclass)] 85 | 86 | 87 | def sparsity(model): 88 | # Return global model sparsity 89 | a, b = 0., 0. 90 | for p in model.parameters(): 91 | a += p.numel() 92 | b += (p == 0).sum() 93 | return b / a 94 | 95 | 96 | def prune(model, amount=0.3): 97 | # Prune model to requested global sparsity 98 | import torch.nn.utils.prune as prune 99 | print('Pruning model... ', end='') 100 | for name, m in model.named_modules(): 101 | if isinstance(m, nn.Conv2d): 102 | prune.l1_unstructured(m, name='weight', amount=amount) # prune 103 | prune.remove(m, 'weight') # make permanent 104 | print(' %.3g global sparsity' % sparsity(model)) 105 | 106 | 107 | def fuse_conv_and_bn(conv, bn): 108 | # Fuse convolution and batchnorm layers https://tehnokv.com/posts/fusing-batchnorm-and-conv/ 109 | 110 | # init 111 | fusedconv = nn.Conv2d(conv.in_channels, 112 | conv.out_channels, 113 | kernel_size=conv.kernel_size, 114 | stride=conv.stride, 115 | padding=conv.padding, 116 | groups=conv.groups, 117 | bias=True).requires_grad_(False).to(conv.weight.device) 118 | 119 | # prepare filters 120 | w_conv = conv.weight.clone().view(conv.out_channels, -1) 121 | w_bn = torch.diag(bn.weight.div(torch.sqrt(bn.eps + bn.running_var))) 122 | fusedconv.weight.copy_(torch.mm(w_bn, w_conv).view(fusedconv.weight.size())) 123 | 124 | # prepare spatial bias 125 | b_conv = torch.zeros(conv.weight.size(0), device=conv.weight.device) if conv.bias is None else conv.bias 126 | b_bn = bn.bias - bn.weight.mul(bn.running_mean).div(torch.sqrt(bn.running_var + bn.eps)) 127 | fusedconv.bias.copy_(torch.mm(w_bn, b_conv.reshape(-1, 1)).reshape(-1) + b_bn) 128 | 129 | return fusedconv 130 | 131 | 132 | def model_info(model, verbose=False): 133 | # Plots a line-by-line description of a PyTorch model 134 | n_p = sum(x.numel() for x in model.parameters()) # number parameters 135 | n_g = sum(x.numel() for x in model.parameters() if x.requires_grad) # number gradients 136 | if verbose: 137 | print('%5s %40s %9s %12s %20s %10s %10s' % ('layer', 'name', 'gradient', 'parameters', 'shape', 'mu', 'sigma')) 138 | for i, (name, p) in enumerate(model.named_parameters()): 139 | name = name.replace('module_list.', '') 140 | print('%5g %40s %9s %12g %20s %10.3g %10.3g' % 141 | (i, name, p.requires_grad, p.numel(), list(p.shape), p.mean(), p.std())) 142 | 143 | try: # FLOPS 144 | from thop import profile 145 | flops = profile(deepcopy(model), inputs=(torch.zeros(1, 3, 64, 64),), verbose=False)[0] / 1E9 * 2 146 | fs = ', %.1f GFLOPS' % (flops * 100) # 640x640 FLOPS 147 | except: 148 | fs = '' 149 | 150 | logger.info( 151 | 'Model Summary: %g layers, %g parameters, %g gradients%s' % (len(list(model.parameters())), n_p, n_g, fs)) 152 | 153 | 154 | def load_classifier(name='resnet101', n=2): 155 | # Loads a pretrained model reshaped to n-class output 156 | model = models.__dict__[name](pretrained=True) 157 | 158 | # Display model properties 159 | input_size = [3, 224, 224] 160 | input_space = 'RGB' 161 | input_range = [0, 1] 162 | mean = [0.485, 0.456, 0.406] 163 | std = [0.229, 0.224, 0.225] 164 | for x in ['input_size', 'input_space', 'input_range', 'mean', 'std']: 165 | print(x + ' =', eval(x)) 166 | 167 | # Reshape output to n classes 168 | filters = model.fc.weight.shape[1] 169 | model.fc.bias = nn.Parameter(torch.zeros(n), requires_grad=True) 170 | model.fc.weight = nn.Parameter(torch.zeros(n, filters), requires_grad=True) 171 | model.fc.out_features = n 172 | return model 173 | 174 | 175 | def scale_img(img, ratio=1.0, same_shape=False): # img(16,3,256,416), r=ratio 176 | # scales img(bs,3,y,x) by ratio 177 | if ratio == 1.0: 178 | return img 179 | else: 180 | h, w = img.shape[2:] 181 | s = (int(h * ratio), int(w * ratio)) # new size 182 | img = F.interpolate(img, size=s, mode='bilinear', align_corners=False) # resize 183 | if not same_shape: # pad/crop img 184 | gs = 32 # (pixels) grid size 185 | h, w = [math.ceil(x * ratio / gs) * gs for x in (h, w)] 186 | return F.pad(img, [0, w - s[1], 0, h - s[0]], value=0.447) # value = imagenet mean 187 | 188 | 189 | def copy_attr(a, b, include=(), exclude=()): 190 | # Copy attributes from b to a, options to only include [...] and to exclude [...] 191 | for k, v in b.__dict__.items(): 192 | if (len(include) and k not in include) or k.startswith('_') or k in exclude: 193 | continue 194 | else: 195 | setattr(a, k, v) 196 | 197 | 198 | class ModelEMA: 199 | """ Model Exponential Moving Average from https://github.com/rwightman/pytorch-image-models 200 | Keep a moving average of everything in the model state_dict (parameters and buffers). 201 | This is intended to allow functionality like 202 | https://www.tensorflow.org/api_docs/python/tf/train/ExponentialMovingAverage 203 | A smoothed version of the weights is necessary for some training schemes to perform well. 204 | This class is sensitive where it is initialized in the sequence of model init, 205 | GPU assignment and distributed training wrappers. 206 | """ 207 | 208 | def __init__(self, model, decay=0.9999, updates=0): 209 | # Create EMA 210 | self.ema = deepcopy(model.module if is_parallel(model) else model).eval() # FP32 EMA 211 | # if next(model.parameters()).device.type != 'cpu': 212 | # self.ema.half() # FP16 EMA 213 | self.updates = updates # number of EMA updates 214 | self.decay = lambda x: decay * (1 - math.exp(-x / 2000)) # decay exponential ramp (to help early epochs) 215 | for p in self.ema.parameters(): 216 | p.requires_grad_(False) 217 | 218 | def update(self, model): 219 | # Update EMA parameters 220 | with torch.no_grad(): 221 | self.updates += 1 222 | d = self.decay(self.updates) 223 | 224 | msd = model.module.state_dict() if is_parallel(model) else model.state_dict() # model state_dict 225 | for k, v in self.ema.state_dict().items(): 226 | if v.dtype.is_floating_point: 227 | v *= d 228 | v += (1. - d) * msd[k].detach() 229 | 230 | def update_attr(self, model, include=(), exclude=('process_group', 'reducer')): 231 | # Update EMA attributes 232 | copy_attr(self.ema, model, include, exclude) 233 | -------------------------------------------------------------------------------- /models/yolo.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import logging 3 | import math 4 | from copy import deepcopy 5 | from pathlib import Path 6 | 7 | import torch 8 | import torch.nn as nn 9 | 10 | from models.common import Conv, Bottleneck, SPP, DWConv, Focus, BottleneckCSP, Concat, NMS 11 | from models.experimental import MixConv2d, CrossConv, C3 12 | from utils.general import check_anchor_order, make_divisible, check_file, set_logging 13 | from utils.torch_utils import ( 14 | time_synchronized, fuse_conv_and_bn, model_info, scale_img, initialize_weights, select_device) 15 | 16 | logger = logging.getLogger(__name__) 17 | 18 | 19 | class Detect(nn.Module): 20 | stride = None # strides computed during build 21 | export = False # onnx export 22 | 23 | def __init__(self, nc=80, anchors=(), ch=()): # detection layer 24 | super(Detect, self).__init__() 25 | self.nc = nc # number of classes 26 | self.no = nc + 5 # number of outputs per anchor 27 | self.nl = len(anchors) # number of detection layers 28 | self.na = len(anchors[0]) // 2 # number of anchors 29 | self.grid = [torch.zeros(1)] * self.nl # init grid 30 | a = torch.tensor(anchors).float().view(self.nl, -1, 2) 31 | self.register_buffer('anchors', a) # shape(nl,na,2) 32 | self.register_buffer('anchor_grid', a.clone().view(self.nl, 1, -1, 1, 1, 2)) # shape(nl,1,na,1,1,2) 33 | self.m = nn.ModuleList(nn.Conv2d(x, self.no * self.na, 1) for x in ch) # output conv 34 | 35 | def forward(self, x): 36 | # x = x.copy() # for profiling 37 | z = [] # inference output 38 | self.training |= self.export 39 | for i in range(self.nl): 40 | x[i] = self.m[i](x[i]) # conv 41 | bs, _, ny, nx = x[i].shape # x(bs,255,20,20) to x(bs,3,20,20,85) 42 | x[i] = x[i].view(bs, self.na, self.no, ny, nx).permute(0, 1, 3, 4, 2).contiguous() 43 | 44 | if not self.training: # inference 45 | if self.grid[i].shape[2:4] != x[i].shape[2:4]: 46 | self.grid[i] = self._make_grid(nx, ny).to(x[i].device) 47 | 48 | y = x[i].sigmoid() 49 | y[..., 0:2] = (y[..., 0:2] * 2. - 0.5 + self.grid[i].to(x[i].device)) * self.stride[i] # xy 50 | y[..., 2:4] = (y[..., 2:4] * 2) ** 2 * self.anchor_grid[i] # wh 51 | z.append(y.view(bs, -1, self.no)) 52 | 53 | return x if self.training else (torch.cat(z, 1), x) 54 | 55 | @staticmethod 56 | def _make_grid(nx=20, ny=20): 57 | yv, xv = torch.meshgrid([torch.arange(ny), torch.arange(nx)]) 58 | return torch.stack((xv, yv), 2).view((1, 1, ny, nx, 2)).float() 59 | 60 | 61 | class Model(nn.Module): 62 | def __init__(self, cfg='yolov5s.yaml', ch=3, nc=None): # model, input channels, number of classes 63 | super(Model, self).__init__() 64 | if isinstance(cfg, dict): 65 | self.yaml = cfg # model dict 66 | else: # is *.yaml 67 | import yaml # for torch hub 68 | self.yaml_file = Path(cfg).name 69 | with open(cfg) as f: 70 | self.yaml = yaml.load(f, Loader=yaml.FullLoader) # model dict 71 | 72 | # Define model 73 | if nc and nc != self.yaml['nc']: 74 | print('Overriding model.yaml nc=%g with nc=%g' % (self.yaml['nc'], nc)) 75 | self.yaml['nc'] = nc # override yaml value 76 | self.model, self.save = parse_model(deepcopy(self.yaml), ch=[ch]) # model, savelist, ch_out 77 | # print([x.shape for x in self.forward(torch.zeros(1, ch, 64, 64))]) 78 | 79 | # Build strides, anchors 80 | m = self.model[-1] # Detect() 81 | if isinstance(m, Detect): 82 | s = 128 # 2x min stride 83 | m.stride = torch.tensor([s / x.shape[-2] for x in self.forward(torch.zeros(1, ch, s, s))]) # forward 84 | m.anchors /= m.stride.view(-1, 1, 1) 85 | check_anchor_order(m) 86 | self.stride = m.stride 87 | self._initialize_biases() # only run once 88 | # print('Strides: %s' % m.stride.tolist()) 89 | 90 | # Init weights, biases 91 | initialize_weights(self) 92 | self.info() 93 | print('') 94 | 95 | def forward(self, x, augment=False, profile=False): 96 | if augment: 97 | img_size = x.shape[-2:] # height, width 98 | s = [1, 0.83, 0.67] # scales 99 | f = [None, 3, None] # flips (2-ud, 3-lr) 100 | y = [] # outputs 101 | for si, fi in zip(s, f): 102 | xi = scale_img(x.flip(fi) if fi else x, si) 103 | yi = self.forward_once(xi)[0] # forward 104 | # cv2.imwrite('img%g.jpg' % s, 255 * xi[0].numpy().transpose((1, 2, 0))[:, :, ::-1]) # save 105 | yi[..., :4] /= si # de-scale 106 | if fi == 2: 107 | yi[..., 1] = img_size[0] - yi[..., 1] # de-flip ud 108 | elif fi == 3: 109 | yi[..., 0] = img_size[1] - yi[..., 0] # de-flip lr 110 | y.append(yi) 111 | return torch.cat(y, 1), None # augmented inference, train 112 | else: 113 | return self.forward_once(x, profile) # single-scale inference, train 114 | 115 | def forward_once(self, x, profile=False): 116 | y, dt = [], [] # outputs 117 | for m in self.model: 118 | if m.f != -1: # if not from previous layer 119 | x = y[m.f] if isinstance(m.f, int) else [x if j == -1 else y[j] for j in m.f] # from earlier layers 120 | 121 | if profile: 122 | try: 123 | import thop 124 | o = thop.profile(m, inputs=(x,), verbose=False)[0] / 1E9 * 2 # FLOPS 125 | except: 126 | o = 0 127 | t = time_synchronized() 128 | for _ in range(10): 129 | _ = m(x) 130 | dt.append((time_synchronized() - t) * 100) 131 | print('%10.1f%10.0f%10.1fms %-40s' % (o, m.np, dt[-1], m.type)) 132 | 133 | x = m(x) # run 134 | y.append(x if m.i in self.save else None) # save output 135 | 136 | if profile: 137 | print('%.1fms total' % sum(dt)) 138 | return x 139 | 140 | def _initialize_biases(self, cf=None): # initialize biases into Detect(), cf is class frequency 141 | # cf = torch.bincount(torch.tensor(np.concatenate(dataset.labels, 0)[:, 0]).long(), minlength=nc) + 1. 142 | m = self.model[-1] # Detect() module 143 | for mi, s in zip(m.m, m.stride): # from 144 | b = mi.bias.view(m.na, -1) # conv.bias(255) to (3,85) 145 | b[:, 4] += math.log(8 / (640 / s) ** 2) # obj (8 objects per 640 image) 146 | b[:, 5:] += math.log(0.6 / (m.nc - 0.99)) if cf is None else torch.log(cf / cf.sum()) # cls 147 | mi.bias = torch.nn.Parameter(b.view(-1), requires_grad=True) 148 | 149 | def _print_biases(self): 150 | m = self.model[-1] # Detect() module 151 | for mi in m.m: # from 152 | b = mi.bias.detach().view(m.na, -1).T # conv.bias(255) to (3,85) 153 | print(('%6g Conv2d.bias:' + '%10.3g' * 6) % (mi.weight.shape[1], *b[:5].mean(1).tolist(), b[5:].mean())) 154 | 155 | # def _print_weights(self): 156 | # for m in self.model.modules(): 157 | # if type(m) is Bottleneck: 158 | # print('%10.3g' % (m.w.detach().sigmoid() * 2)) # shortcut weights 159 | 160 | def fuse(self): # fuse model Conv2d() + BatchNorm2d() layers 161 | print('Fusing layers... ') 162 | for m in self.model.modules(): 163 | if type(m) is Conv and hasattr(Conv, 'bn'): 164 | m._non_persistent_buffers_set = set() # pytorch 1.6.0 compatability 165 | m.conv = fuse_conv_and_bn(m.conv, m.bn) # update conv 166 | delattr(m, 'bn') # remove batchnorm 167 | m.forward = m.fuseforward # update forward 168 | self.info() 169 | return self 170 | 171 | def add_nms(self): # fuse model Conv2d() + BatchNorm2d() layers 172 | if type(self.model[-1]) is not NMS: # if missing NMS 173 | print('Adding NMS module... ') 174 | m = NMS() # module 175 | m.f = -1 # from 176 | m.i = self.model[-1].i + 1 # index 177 | self.model.add_module(name='%s' % m.i, module=m) # add 178 | return self 179 | 180 | def info(self, verbose=False): # print model information 181 | model_info(self, verbose) 182 | 183 | 184 | def parse_model(d, ch): # model_dict, input_channels(3) 185 | logger.info('\n%3s%18s%3s%10s %-40s%-30s' % ('', 'from', 'n', 'params', 'module', 'arguments')) 186 | anchors, nc, gd, gw = d['anchors'], d['nc'], d['depth_multiple'], d['width_multiple'] 187 | na = (len(anchors[0]) // 2) if isinstance(anchors, list) else anchors # number of anchors 188 | no = na * (nc + 5) # number of outputs = anchors * (classes + 5) 189 | 190 | layers, save, c2 = [], [], ch[-1] # layers, savelist, ch out 191 | for i, (f, n, m, args) in enumerate(d['backbone'] + d['head']): # from, number, module, args 192 | m = eval(m) if isinstance(m, str) else m # eval strings 193 | for j, a in enumerate(args): 194 | try: 195 | args[j] = eval(a) if isinstance(a, str) else a # eval strings 196 | except: 197 | pass 198 | 199 | n = max(round(n * gd), 1) if n > 1 else n # depth gain 200 | if m in [Conv, Bottleneck, SPP, DWConv, MixConv2d, Focus, CrossConv, BottleneckCSP, C3]: 201 | c1, c2 = ch[f], args[0] 202 | 203 | # Normal 204 | # if i > 0 and args[0] != no: # channel expansion factor 205 | # ex = 1.75 # exponential (default 2.0) 206 | # e = math.log(c2 / ch[1]) / math.log(2) 207 | # c2 = int(ch[1] * ex ** e) 208 | # if m != Focus: 209 | 210 | c2 = make_divisible(c2 * gw, 8) if c2 != no else c2 211 | 212 | # Experimental 213 | # if i > 0 and args[0] != no: # channel expansion factor 214 | # ex = 1 + gw # exponential (default 2.0) 215 | # ch1 = 32 # ch[1] 216 | # e = math.log(c2 / ch1) / math.log(2) # level 1-n 217 | # c2 = int(ch1 * ex ** e) 218 | # if m != Focus: 219 | # c2 = make_divisible(c2, 8) if c2 != no else c2 220 | 221 | args = [c1, c2, *args[1:]] 222 | if m in [BottleneckCSP, C3]: 223 | args.insert(2, n) 224 | n = 1 225 | elif m is nn.BatchNorm2d: 226 | args = [ch[f]] 227 | elif m is Concat: 228 | c2 = sum([ch[-1 if x == -1 else x + 1] for x in f]) 229 | elif m is Detect: 230 | args.append([ch[x + 1] for x in f]) 231 | if isinstance(args[1], int): # number of anchors 232 | args[1] = [list(range(args[1] * 2))] * len(f) 233 | else: 234 | c2 = ch[f] 235 | 236 | m_ = nn.Sequential(*[m(*args) for _ in range(n)]) if n > 1 else m(*args) # module 237 | t = str(m)[8:-2].replace('__main__.', '') # module type 238 | np = sum([x.numel() for x in m_.parameters()]) # number params 239 | m_.i, m_.f, m_.type, m_.np = i, f, t, np # attach index, 'from' index, type, number params 240 | logger.info('%3s%18s%3s%10.0f %-40s%-30s' % (i, f, n, np, t, args)) # print 241 | save.extend(x % i for x in ([f] if isinstance(f, int) else f) if x != -1) # append to savelist 242 | layers.append(m_) 243 | ch.append(c2) 244 | return nn.Sequential(*layers), sorted(save) 245 | 246 | 247 | if __name__ == '__main__': 248 | parser = argparse.ArgumentParser() 249 | parser.add_argument('--cfg', type=str, default='yolov5s.yaml', help='model.yaml') 250 | parser.add_argument('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu') 251 | opt = parser.parse_args() 252 | opt.cfg = check_file(opt.cfg) # check file 253 | set_logging() 254 | device = select_device(opt.device) 255 | 256 | # Create model 257 | model = Model(opt.cfg).to(device) 258 | model.train() 259 | 260 | # Profile 261 | # img = torch.rand(8 if torch.cuda.is_available() else 1, 3, 640, 640).to(device) 262 | # y = model(img, profile=True) 263 | 264 | # ONNX export 265 | # model.model[-1].export = True 266 | # torch.onnx.export(model, img, opt.cfg.replace('.yaml', '.onnx'), verbose=True, opset_version=11) 267 | 268 | # Tensorboard 269 | # from torch.utils.tensorboard import SummaryWriter 270 | # tb_writer = SummaryWriter() 271 | # print("Run 'tensorboard --logdir=models/runs' to view tensorboard at http://localhost:6006/") 272 | # tb_writer.add_graph(model.model, img) # add model to tensorboard 273 | # tb_writer.add_image('test', img[0], dataformats='CWH') # add model to tensorboard 274 | -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import glob 3 | import json 4 | import os 5 | import shutil 6 | from pathlib import Path 7 | 8 | import numpy as np 9 | import torch 10 | import yaml 11 | from tqdm import tqdm 12 | 13 | from models.experimental import attempt_load 14 | from utils.datasets import create_dataloader 15 | from utils.general import ( 16 | coco80_to_coco91_class, check_dataset, check_file, check_img_size, compute_loss, non_max_suppression, scale_coords, 17 | xyxy2xywh, clip_coords, plot_images, xywh2xyxy, box_iou, output_to_target, ap_per_class, set_logging) 18 | from utils.torch_utils import select_device, time_synchronized 19 | 20 | 21 | def test(data, 22 | weights=None, 23 | batch_size=16, 24 | imgsz=640, 25 | conf_thres=0.001, 26 | iou_thres=0.6, # for NMS 27 | save_json=False, 28 | single_cls=False, 29 | augment=False, 30 | verbose=False, 31 | model=None, 32 | dataloader=None, 33 | save_dir='', 34 | merge=False, 35 | save_txt=False): 36 | # Initialize/load model and set device 37 | training = model is not None 38 | if training: # called by train.py 39 | device = next(model.parameters()).device # get model device 40 | 41 | else: # called directly 42 | set_logging() 43 | device = select_device(opt.device, batch_size=batch_size) 44 | merge, save_txt = opt.merge, opt.save_txt # use Merge NMS, save *.txt labels 45 | if save_txt: 46 | out = Path('inference/output') 47 | if os.path.exists(out): 48 | shutil.rmtree(out) # delete output folder 49 | os.makedirs(out) # make new output folder 50 | 51 | # Remove previous 52 | for f in glob.glob(str(Path(save_dir) / 'test_batch*.jpg')): 53 | os.remove(f) 54 | 55 | # Load model 56 | model = attempt_load(weights, map_location=device) # load FP32 model 57 | imgsz = check_img_size(imgsz, s=model.stride.max()) # check img_size 58 | 59 | # Multi-GPU disabled, incompatible with .half() https://github.com/ultralytics/yolov5/issues/99 60 | # if device.type != 'cpu' and torch.cuda.device_count() > 1: 61 | # model = nn.DataParallel(model) 62 | 63 | # Half 64 | half = device.type != 'cpu' # half precision only supported on CUDA 65 | if half: 66 | model.half() 67 | 68 | # Configure 69 | model.eval() 70 | with open(data) as f: 71 | data = yaml.load(f, Loader=yaml.FullLoader) # model dict 72 | check_dataset(data) # check 73 | nc = 1 if single_cls else int(data['nc']) # number of classes 74 | iouv = torch.linspace(0.5, 0.95, 10).to(device) # iou vector for mAP@0.5:0.95 75 | niou = iouv.numel() 76 | 77 | # Dataloader 78 | if not training: 79 | img = torch.zeros((1, 3, imgsz, imgsz), device=device) # init img 80 | _ = model(img.half() if half else img) if device.type != 'cpu' else None # run once 81 | path = data['test'] if opt.task == 'test' else data['val'] # path to val/test images 82 | dataloader = create_dataloader(path, imgsz, batch_size, model.stride.max(), opt, 83 | hyp=None, augment=False, cache=False, pad=0.5, rect=True)[0] 84 | 85 | seen = 0 86 | names = model.names if hasattr(model, 'names') else model.module.names 87 | coco91class = coco80_to_coco91_class() 88 | s = ('%20s' + '%12s' * 6) % ('Class', 'Images', 'Targets', 'P', 'R', 'mAP@.5', 'mAP@.5:.95') 89 | p, r, f1, mp, mr, map50, map, t0, t1 = 0., 0., 0., 0., 0., 0., 0., 0., 0. 90 | loss = torch.zeros(3, device=device) 91 | jdict, stats, ap, ap_class = [], [], [], [] 92 | for batch_i, (img, targets, paths, shapes) in enumerate(tqdm(dataloader, desc=s)): 93 | img = img.to(device, non_blocking=True) 94 | img = img.half() if half else img.float() # uint8 to fp16/32 95 | img /= 255.0 # 0 - 255 to 0.0 - 1.0 96 | targets = targets.to(device) 97 | nb, _, height, width = img.shape # batch size, channels, height, width 98 | whwh = torch.Tensor([width, height, width, height]).to(device) 99 | 100 | # Disable gradients 101 | with torch.no_grad(): 102 | # Run model 103 | t = time_synchronized() 104 | inf_out, train_out = model(img, augment=augment) # inference and training outputs 105 | t0 += time_synchronized() - t 106 | 107 | # Compute loss 108 | if training: # if model has loss hyperparameters 109 | loss += compute_loss([x.float() for x in train_out], targets, model)[1][:3] # GIoU, obj, cls 110 | 111 | # Run NMS 112 | t = time_synchronized() 113 | output = non_max_suppression(inf_out, conf_thres=conf_thres, iou_thres=iou_thres, merge=merge) 114 | t1 += time_synchronized() - t 115 | 116 | # Statistics per image 117 | for si, pred in enumerate(output): 118 | labels = targets[targets[:, 0] == si, 1:] 119 | nl = len(labels) 120 | tcls = labels[:, 0].tolist() if nl else [] # target class 121 | seen += 1 122 | 123 | if pred is None: 124 | if nl: 125 | stats.append((torch.zeros(0, niou, dtype=torch.bool), torch.Tensor(), torch.Tensor(), tcls)) 126 | continue 127 | 128 | # Append to text file 129 | if save_txt: 130 | gn = torch.tensor(shapes[si][0])[[1, 0, 1, 0]] # normalization gain whwh 131 | x = pred.clone() 132 | x[:, :4] = scale_coords(img[si].shape[1:], x[:, :4], shapes[si][0], shapes[si][1]) # to original 133 | for *xyxy, conf, cls in x: 134 | xywh = (xyxy2xywh(torch.tensor(xyxy).view(1, 4)) / gn).view(-1).tolist() # normalized xywh 135 | with open(str(out / Path(paths[si]).stem) + '.txt', 'a') as f: 136 | f.write(('%g ' * 5 + '\n') % (cls, *xywh)) # label format 137 | 138 | # Clip boxes to image bounds 139 | clip_coords(pred, (height, width)) 140 | 141 | # Append to pycocotools JSON dictionary 142 | if save_json: 143 | # [{"image_id": 42, "category_id": 18, "bbox": [258.15, 41.29, 348.26, 243.78], "score": 0.236}, ... 144 | image_id = Path(paths[si]).stem 145 | box = pred[:, :4].clone() # xyxy 146 | scale_coords(img[si].shape[1:], box, shapes[si][0], shapes[si][1]) # to original shape 147 | box = xyxy2xywh(box) # xywh 148 | box[:, :2] -= box[:, 2:] / 2 # xy center to top-left corner 149 | for p, b in zip(pred.tolist(), box.tolist()): 150 | jdict.append({'image_id': int(image_id) if image_id.isnumeric() else image_id, 151 | 'category_id': coco91class[int(p[5])], 152 | 'bbox': [round(x, 3) for x in b], 153 | 'score': round(p[4], 5)}) 154 | 155 | # Assign all predictions as incorrect 156 | correct = torch.zeros(pred.shape[0], niou, dtype=torch.bool, device=device) 157 | if nl: 158 | detected = [] # target indices 159 | tcls_tensor = labels[:, 0] 160 | 161 | # target boxes 162 | tbox = xywh2xyxy(labels[:, 1:5]) * whwh 163 | 164 | # Per target class 165 | for cls in torch.unique(tcls_tensor): 166 | ti = (cls == tcls_tensor).nonzero(as_tuple=False).view(-1) # prediction indices 167 | pi = (cls == pred[:, 5]).nonzero(as_tuple=False).view(-1) # target indices 168 | 169 | # Search for detections 170 | if pi.shape[0]: 171 | # Prediction to target ious 172 | ious, i = box_iou(pred[pi, :4], tbox[ti]).max(1) # best ious, indices 173 | 174 | # Append detections 175 | detected_set = set() 176 | for j in (ious > iouv[0]).nonzero(as_tuple=False): 177 | d = ti[i[j]] # detected target 178 | if d.item() not in detected_set: 179 | detected_set.add(d.item()) 180 | detected.append(d) 181 | correct[pi[j]] = ious[j] > iouv # iou_thres is 1xn 182 | if len(detected) == nl: # all targets already located in image 183 | break 184 | 185 | # Append statistics (correct, conf, pcls, tcls) 186 | stats.append((correct.cpu(), pred[:, 4].cpu(), pred[:, 5].cpu(), tcls)) 187 | 188 | # Plot images 189 | if batch_i < 1: 190 | f = Path(save_dir) / ('test_batch%g_gt.jpg' % batch_i) # filename 191 | plot_images(img, targets, paths, str(f), names) # ground truth 192 | f = Path(save_dir) / ('test_batch%g_pred.jpg' % batch_i) 193 | plot_images(img, output_to_target(output, width, height), paths, str(f), names) # predictions 194 | 195 | # Compute statistics 196 | stats = [np.concatenate(x, 0) for x in zip(*stats)] # to numpy 197 | if len(stats) and stats[0].any(): 198 | p, r, ap, f1, ap_class = ap_per_class(*stats) 199 | p, r, ap50, ap = p[:, 0], r[:, 0], ap[:, 0], ap.mean(1) # [P, R, AP@0.5, AP@0.5:0.95] 200 | mp, mr, map50, map = p.mean(), r.mean(), ap50.mean(), ap.mean() 201 | nt = np.bincount(stats[3].astype(np.int64), minlength=nc) # number of targets per class 202 | else: 203 | nt = torch.zeros(1) 204 | 205 | # Print results 206 | pf = '%20s' + '%12.3g' * 6 # print format 207 | print(pf % ('all', seen, nt.sum(), mp, mr, map50, map)) 208 | 209 | # Print results per class 210 | if verbose and nc > 1 and len(stats): 211 | for i, c in enumerate(ap_class): 212 | print(pf % (names[c], seen, nt[c], p[i], r[i], ap50[i], ap[i])) 213 | 214 | # Print speeds 215 | t = tuple(x / seen * 1E3 for x in (t0, t1, t0 + t1)) + (imgsz, imgsz, batch_size) # tuple 216 | if not training: 217 | print('Speed: %.1f/%.1f/%.1f ms inference/NMS/total per %gx%g image at batch-size %g' % t) 218 | 219 | # Save JSON 220 | if save_json and len(jdict): 221 | f = 'detections_val2017_%s_results.json' % \ 222 | (weights.split(os.sep)[-1].replace('.pt', '') if isinstance(weights, str) else '') # filename 223 | print('\nCOCO mAP with pycocotools... saving %s...' % f) 224 | with open(f, 'w') as file: 225 | json.dump(jdict, file) 226 | 227 | try: # https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocoEvalDemo.ipynb 228 | from pycocotools.coco import COCO 229 | from pycocotools.cocoeval import COCOeval 230 | 231 | imgIds = [int(Path(x).stem) for x in dataloader.dataset.img_files] 232 | cocoGt = COCO(glob.glob('../coco/annotations/instances_val*.json')[0]) # initialize COCO ground truth api 233 | cocoDt = cocoGt.loadRes(f) # initialize COCO pred api 234 | cocoEval = COCOeval(cocoGt, cocoDt, 'bbox') 235 | cocoEval.params.imgIds = imgIds # image IDs to evaluate 236 | cocoEval.evaluate() 237 | cocoEval.accumulate() 238 | cocoEval.summarize() 239 | map, map50 = cocoEval.stats[:2] # update results (mAP@0.5:0.95, mAP@0.5) 240 | except Exception as e: 241 | print('ERROR: pycocotools unable to run: %s' % e) 242 | 243 | # Return results 244 | model.float() # for training 245 | maps = np.zeros(nc) + map 246 | for i, c in enumerate(ap_class): 247 | maps[c] = ap[i] 248 | return (mp, mr, map50, map, *(loss.cpu() / len(dataloader)).tolist()), maps, t 249 | 250 | 251 | if __name__ == '__main__': 252 | parser = argparse.ArgumentParser(prog='test.py') 253 | parser.add_argument('--weights', nargs='+', type=str, default='yolov5s.pt', help='model.pt path(s)') 254 | parser.add_argument('--data', type=str, default='data/coco128.yaml', help='*.data path') 255 | parser.add_argument('--batch-size', type=int, default=32, help='size of each image batch') 256 | parser.add_argument('--img-size', type=int, default=640, help='inference size (pixels)') 257 | parser.add_argument('--conf-thres', type=float, default=0.001, help='object confidence threshold') 258 | parser.add_argument('--iou-thres', type=float, default=0.65, help='IOU threshold for NMS') 259 | parser.add_argument('--save-json', action='store_true', help='save a cocoapi-compatible JSON results file') 260 | parser.add_argument('--task', default='val', help="'val', 'test', 'study'") 261 | parser.add_argument('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu') 262 | parser.add_argument('--single-cls', action='store_true', help='treat as single-class dataset') 263 | parser.add_argument('--augment', action='store_true', help='augmented inference') 264 | parser.add_argument('--merge', action='store_true', help='use Merge NMS') 265 | parser.add_argument('--verbose', action='store_true', help='report mAP by class') 266 | parser.add_argument('--save-txt', action='store_true', help='save results to *.txt') 267 | opt = parser.parse_args() 268 | opt.save_json |= opt.data.endswith('coco.yaml') 269 | opt.data = check_file(opt.data) # check file 270 | print(opt) 271 | 272 | if opt.task in ['val', 'test']: # run normally 273 | test(opt.data, 274 | opt.weights, 275 | opt.batch_size, 276 | opt.img_size, 277 | opt.conf_thres, 278 | opt.iou_thres, 279 | opt.save_json, 280 | opt.single_cls, 281 | opt.augment, 282 | opt.verbose) 283 | 284 | elif opt.task == 'study': # run over a range of settings and save/plot 285 | for weights in ['yolov5s.pt', 'yolov5m.pt', 'yolov5l.pt', 'yolov5x.pt']: 286 | f = 'study_%s_%s.txt' % (Path(opt.data).stem, Path(weights).stem) # filename to save to 287 | x = list(range(320, 800, 64)) # x axis 288 | y = [] # y axis 289 | for i in x: # img-size 290 | print('\nRunning %s point %s...' % (f, i)) 291 | r, _, t = test(opt.data, weights, opt.batch_size, i, opt.conf_thres, opt.iou_thres, opt.save_json) 292 | y.append(r + t) # results and times 293 | np.savetxt(f, y, fmt='%10.4g') # save 294 | os.system('zip -r study.zip study_*.txt') 295 | # utils.general.plot_study_txt(f, x) # plot 296 | --------------------------------------------------------------------------------