Spaces:
Runtime error
Runtime error
Annas Dev
commited on
Commit
·
461480c
1
Parent(s):
f6f2c76
fix import
Browse files- Pipfile +1 -0
- Pipfile.lock +234 -1
- detection/app.py +8 -5
- detection/models/__init__.py +0 -1
- detection/models/common.py +4 -4
- detection/models/experimental.py +5 -2
- detection/utils/datasets.py +7 -7
- detection/utils/general.py +4 -4
- detection/utils/plots.py +10 -10
Pipfile
CHANGED
|
@@ -22,6 +22,7 @@ ipython = "*"
|
|
| 22 |
psutil = "*"
|
| 23 |
thop = "*"
|
| 24 |
gradio = "*"
|
|
|
|
| 25 |
|
| 26 |
[dev-packages]
|
| 27 |
|
|
|
|
| 22 |
psutil = "*"
|
| 23 |
thop = "*"
|
| 24 |
gradio = "*"
|
| 25 |
+
easyocr = "*"
|
| 26 |
|
| 27 |
[dev-packages]
|
| 28 |
|
Pipfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"_meta": {
|
| 3 |
"hash": {
|
| 4 |
-
"sha256": "
|
| 5 |
},
|
| 6 |
"pipfile-spec": 6,
|
| 7 |
"requires": {
|
|
@@ -405,6 +405,13 @@
|
|
| 405 |
"markers": "python_version >= '3.5'",
|
| 406 |
"version": "==5.1.1"
|
| 407 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 408 |
"executing": {
|
| 409 |
"hashes": [
|
| 410 |
"sha256:550d581b497228b572235e633599133eeee67073c65914ca346100ad56775349",
|
|
@@ -614,6 +621,14 @@
|
|
| 614 |
"markers": "python_version >= '3.5'",
|
| 615 |
"version": "==3.4"
|
| 616 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 617 |
"importlib-metadata": {
|
| 618 |
"hashes": [
|
| 619 |
"sha256:637245b8bab2b6502fcbc752cc4b7a6f6243bb02b31c5c26156ad103d3d45670",
|
|
@@ -935,6 +950,33 @@
|
|
| 935 |
"markers": "python_version >= '3.7'",
|
| 936 |
"version": "==6.0.2"
|
| 937 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 938 |
"numpy": {
|
| 939 |
"hashes": [
|
| 940 |
"sha256:004f0efcb2fe1c0bd6ae1fcfc69cc8b6bf2407e0f18be308612007a0762b4089",
|
|
@@ -990,6 +1032,42 @@
|
|
| 990 |
"index": "pypi",
|
| 991 |
"version": "==4.6.0.66"
|
| 992 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 993 |
"orjson": {
|
| 994 |
"hashes": [
|
| 995 |
"sha256:02d638d43951ba346a80f0abd5942a872cc87db443e073f6f6fc530fee81e19b",
|
|
@@ -1297,6 +1375,43 @@
|
|
| 1297 |
],
|
| 1298 |
"version": "==0.2.8"
|
| 1299 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1300 |
"pycparser": {
|
| 1301 |
"hashes": [
|
| 1302 |
"sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9",
|
|
@@ -1421,6 +1536,13 @@
|
|
| 1421 |
"markers": "python_full_version >= '3.6.8'",
|
| 1422 |
"version": "==3.0.9"
|
| 1423 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1424 |
"python-dateutil": {
|
| 1425 |
"hashes": [
|
| 1426 |
"sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86",
|
|
@@ -1442,6 +1564,37 @@
|
|
| 1442 |
],
|
| 1443 |
"version": "==2022.2.1"
|
| 1444 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1445 |
"pyyaml": {
|
| 1446 |
"hashes": [
|
| 1447 |
"sha256:01b45c0191e6d66c470b6cf1b9531a771a83c1c4208272ead47a3ae4f2f603bf",
|
|
@@ -1522,6 +1675,38 @@
|
|
| 1522 |
"markers": "python_version >= '3.6'",
|
| 1523 |
"version": "==4.9"
|
| 1524 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1525 |
"scipy": {
|
| 1526 |
"hashes": [
|
| 1527 |
"sha256:0419485dbcd0ed78c0d5bf234c5dd63e86065b39b4d669e45810d42199d49521",
|
|
@@ -1567,6 +1752,46 @@
|
|
| 1567 |
"markers": "python_version >= '3.7'",
|
| 1568 |
"version": "==65.3.0"
|
| 1569 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1570 |
"six": {
|
| 1571 |
"hashes": [
|
| 1572 |
"sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926",
|
|
@@ -1627,6 +1852,14 @@
|
|
| 1627 |
"index": "pypi",
|
| 1628 |
"version": "==0.1.1.post2209072238"
|
| 1629 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1630 |
"torch": {
|
| 1631 |
"hashes": [
|
| 1632 |
"sha256:03e31c37711db2cd201e02de5826de875529e45a55631d317aadce2f1ed45aa8",
|
|
|
|
| 1 |
{
|
| 2 |
"_meta": {
|
| 3 |
"hash": {
|
| 4 |
+
"sha256": "bc64203a89b242b16cf862f44e35753a2adabc1ba1a9001968f8bc0ee9d75a08"
|
| 5 |
},
|
| 6 |
"pipfile-spec": 6,
|
| 7 |
"requires": {
|
|
|
|
| 405 |
"markers": "python_version >= '3.5'",
|
| 406 |
"version": "==5.1.1"
|
| 407 |
},
|
| 408 |
+
"easyocr": {
|
| 409 |
+
"hashes": [
|
| 410 |
+
"sha256:c47015beb56c147b2712af3c9d8cc677691ebad42560257e6e145411773c66c3"
|
| 411 |
+
],
|
| 412 |
+
"index": "pypi",
|
| 413 |
+
"version": "==1.6.2"
|
| 414 |
+
},
|
| 415 |
"executing": {
|
| 416 |
"hashes": [
|
| 417 |
"sha256:550d581b497228b572235e633599133eeee67073c65914ca346100ad56775349",
|
|
|
|
| 621 |
"markers": "python_version >= '3.5'",
|
| 622 |
"version": "==3.4"
|
| 623 |
},
|
| 624 |
+
"imageio": {
|
| 625 |
+
"hashes": [
|
| 626 |
+
"sha256:b10a583c831c932f4afbea9e8403082d2a76b1d30d7555b777ceb70441890b3c",
|
| 627 |
+
"sha256:f8ada7a1cab07a4c437c3367bac271ff3010cf71275955825a5cde778543ca52"
|
| 628 |
+
],
|
| 629 |
+
"markers": "python_version >= '3.7'",
|
| 630 |
+
"version": "==2.21.3"
|
| 631 |
+
},
|
| 632 |
"importlib-metadata": {
|
| 633 |
"hashes": [
|
| 634 |
"sha256:637245b8bab2b6502fcbc752cc4b7a6f6243bb02b31c5c26156ad103d3d45670",
|
|
|
|
| 950 |
"markers": "python_version >= '3.7'",
|
| 951 |
"version": "==6.0.2"
|
| 952 |
},
|
| 953 |
+
"networkx": {
|
| 954 |
+
"hashes": [
|
| 955 |
+
"sha256:2a30822761f34d56b9a370d96a4bf4827a535f5591a4078a453425caeba0c5bb",
|
| 956 |
+
"sha256:bd2b7730300860cbd2dafe8e5af89ff5c9a65c3975b352799d87a6238b4301a6"
|
| 957 |
+
],
|
| 958 |
+
"markers": "python_version >= '3.8'",
|
| 959 |
+
"version": "==2.8.6"
|
| 960 |
+
},
|
| 961 |
+
"ninja": {
|
| 962 |
+
"hashes": [
|
| 963 |
+
"sha256:0560eea57199e41e86ac2c1af0108b63ae77c3ca4d05a9425a750e908135935a",
|
| 964 |
+
"sha256:21a1d84d4c7df5881bfd86c25cce4cf7af44ba2b8b255c57bc1c434ec30a2dfc",
|
| 965 |
+
"sha256:279836285975e3519392c93c26e75755e8a8a7fafec9f4ecbb0293119ee0f9c6",
|
| 966 |
+
"sha256:29570a18d697fc84d361e7e6330f0021f34603ae0fcb0ef67ae781e9814aae8d",
|
| 967 |
+
"sha256:5ea785bf6a15727040835256577239fa3cf5da0d60e618c307aa5efc31a1f0ce",
|
| 968 |
+
"sha256:688167841b088b6802e006f911d911ffa925e078c73e8ef2f88286107d3204f8",
|
| 969 |
+
"sha256:6bd76a025f26b9ae507cf8b2b01bb25bb0031df54ed685d85fc559c411c86cf4",
|
| 970 |
+
"sha256:740d61fefb4ca13573704ee8fe89b973d40b8dc2a51aaa4e9e68367233743bb6",
|
| 971 |
+
"sha256:840a0b042d43a8552c4004966e18271ec726e5996578f28345d9ce78e225b67e",
|
| 972 |
+
"sha256:84be6f9ec49f635dc40d4b871319a49fa49b8d55f1d9eae7cd50d8e57ddf7a85",
|
| 973 |
+
"sha256:9ca8dbece144366d5f575ffc657af03eb11c58251268405bc8519d11cf42f113",
|
| 974 |
+
"sha256:cc8b31b5509a2129e4d12a35fc21238c157038022560aaf22e49ef0a77039086",
|
| 975 |
+
"sha256:d5e0275d28997a750a4f445c00bdd357b35cc334c13cdff13edf30e544704fbd",
|
| 976 |
+
"sha256:e1b86ad50d4e681a7dbdff05fc23bb52cb773edb90bc428efba33fa027738408"
|
| 977 |
+
],
|
| 978 |
+
"version": "==1.10.2.3"
|
| 979 |
+
},
|
| 980 |
"numpy": {
|
| 981 |
"hashes": [
|
| 982 |
"sha256:004f0efcb2fe1c0bd6ae1fcfc69cc8b6bf2407e0f18be308612007a0762b4089",
|
|
|
|
| 1032 |
"index": "pypi",
|
| 1033 |
"version": "==4.6.0.66"
|
| 1034 |
},
|
| 1035 |
+
"opencv-python-headless": {
|
| 1036 |
+
"hashes": [
|
| 1037 |
+
"sha256:01f76ca55fdb7e94c3e7eab5035376d06518155e3d88a08096e4670e57a0cee4",
|
| 1038 |
+
"sha256:03349d9fb28703b2eaa8b1f333a6139b9849596ae4445cb1d76e2a7f5e4a2cf8",
|
| 1039 |
+
"sha256:29f5372dabdcd571074f0539bd294a2f5a245a00b871827af6d75a971b3f657e",
|
| 1040 |
+
"sha256:30261b87477a718993fa7cd8a44b7de986b81f8005e23110978c58fd53eb5e43",
|
| 1041 |
+
"sha256:33e534fbc7a417a05ef6b14812fe8ff6b6b7152c22d502b61536c50ad63f80cb",
|
| 1042 |
+
"sha256:3a8457918ecbca57669f141e7dba92e56af370876d022d75d58b94174d11e26b",
|
| 1043 |
+
"sha256:4ef93f338b16e95418b69293924745a36f23e3d05da5ee10dde76af72b0889e3",
|
| 1044 |
+
"sha256:5009a183be7a6817ff216dcb63ef95022c74e360011fa52aa33bc833256693b5",
|
| 1045 |
+
"sha256:5331ce17a094bea4f8132ee23b2eaade85904199c0d04501102c9bb889302c67",
|
| 1046 |
+
"sha256:659107ea6059b5cc953e1a32136a54998540cefea47b01dd62f1e806d10cbe39",
|
| 1047 |
+
"sha256:6d949ec3e10cffa915ab1853e490674b8c420ba29eb0aeea72785f3e254dc7a1",
|
| 1048 |
+
"sha256:6e7710aff3a0717f39c9ade77fdd9111203b09589539655044e73cc5d9960666",
|
| 1049 |
+
"sha256:7b4bd3c6a0d2601b2619ae406eb85a41dff538a7c9cb2a54fb1e90631bf33887",
|
| 1050 |
+
"sha256:7da49405e163b7a2cf891bf54a877ff3e198bc0bfe55009c1d19eb5a0153921d",
|
| 1051 |
+
"sha256:7f8dd594ea0b0049d1614d7bfba984ebd926b2f12670edf6ae3d9d5d6ff8f8f0",
|
| 1052 |
+
"sha256:8f8a06f75dc69631404e0846038d30ff43c9a9d60fcffe07c7a88f8b8c8c776c",
|
| 1053 |
+
"sha256:99e678db353102119cbfe9d17aef520bacf585a3a287c4278dd1ce6fcd3be8f7",
|
| 1054 |
+
"sha256:a1f9d41c6afe86fdbe85ac31ff9a6ce893af2d0fce68fbd1581dbbc0e4dfcb25",
|
| 1055 |
+
"sha256:a1fd5bbf5db00432fb368c73e7d70ead13f69619b33e01dabf2906426a1a9277",
|
| 1056 |
+
"sha256:a5461ad9789c784e75713d6c213c0e34b709073c71ec8ed94129419ea0ce7c01",
|
| 1057 |
+
"sha256:a6ba305364df31b8ac8471a719371d0c05e1e5f7cc5b8a2295e7e958f9bc39bb",
|
| 1058 |
+
"sha256:bbf37d5de98b09e7513e61fca6ebf6466fd82c3c2f0475e51d2a3c80e0bc1a92",
|
| 1059 |
+
"sha256:bc9502064e8c3ff6f40b74c8a68fb31d0c9eae18c1d3f52d4e3f0ccda986f7cb",
|
| 1060 |
+
"sha256:cdea7ab1698b69274eb69b16efdd7b16944c5019c06f0ace9530f91862496cf4",
|
| 1061 |
+
"sha256:cdfec5dedd44617d94725170446cbe77c0b45044188bdc97cd251e698aeee822",
|
| 1062 |
+
"sha256:db112fe9ffde7af96df09befcefdd33c4338f3a34fbfe894e04e66e14f584d9e",
|
| 1063 |
+
"sha256:db461f2f0bfac155d56be7688ab6b43c140ce8b944aa5e6cfcb754bfeeeca750",
|
| 1064 |
+
"sha256:dc303a5e09089001fd4fd51bd18a6d519e81ad5cbc36bb4b5fc3388d22a64be1",
|
| 1065 |
+
"sha256:eb9e571427b7f44b8d8f9a3b6b7b25e45bc8e8895ed3cf3ecd917c0125cf3477",
|
| 1066 |
+
"sha256:f4fbd431b2b0014b7d99e870f428eebf50a0149e4be1a72b905569aaadf4b540"
|
| 1067 |
+
],
|
| 1068 |
+
"markers": "python_version >= '3.6'",
|
| 1069 |
+
"version": "==4.5.4.60"
|
| 1070 |
+
},
|
| 1071 |
"orjson": {
|
| 1072 |
"hashes": [
|
| 1073 |
"sha256:02d638d43951ba346a80f0abd5942a872cc87db443e073f6f6fc530fee81e19b",
|
|
|
|
| 1375 |
],
|
| 1376 |
"version": "==0.2.8"
|
| 1377 |
},
|
| 1378 |
+
"pyclipper": {
|
| 1379 |
+
"hashes": [
|
| 1380 |
+
"sha256:1408461fba4985d58589fa74c59e273e8aa91d8b55c2e9a6abf966eed7562d90",
|
| 1381 |
+
"sha256:1df7e4bce6ac68abfe926d319f52b749b7c9d5e0a6bd7112a0c7f2f908abecbc",
|
| 1382 |
+
"sha256:24b6b70114941805c14a33e9378e52d24b18791f1bfc365853d5adb33425f173",
|
| 1383 |
+
"sha256:2b0950dada5b56a002dddccf131815a8f9b55c4df86ff6a43b7ef48a91b572aa",
|
| 1384 |
+
"sha256:2d51757df15f1721946f39016191c7d685306fc69d8a5f2933a1d22119150a1d",
|
| 1385 |
+
"sha256:341556b83ce2a5d4ee36e263e04751a9949e4161f60f0011f9500b845b25ce3c",
|
| 1386 |
+
"sha256:46b3996c8dcda562c408e653ccef8efd95a7d69400f9119df2c2cb8083d36bf8",
|
| 1387 |
+
"sha256:5434e1e69425dc7958579b1f7bedfa8a7cce79400e1b708a42be769a165a3a2c",
|
| 1388 |
+
"sha256:5b4e0e360ebfc25d01c7e0873b27f912d1c02d99b84393d526bc01836a5fb9f4",
|
| 1389 |
+
"sha256:60f20e96e9e055e9bb2e729fe6078969ce252c6b7b1b18d8d963e5343d99f99e",
|
| 1390 |
+
"sha256:615bece709d8c304d97089a83f8ff91ca0d2646e8fe42f2637d7cdfcf99a6e4e",
|
| 1391 |
+
"sha256:639fbc55569b94487f89261b1656e3e655d06888a582218c5432c426705d1f6f",
|
| 1392 |
+
"sha256:6748239b89a5edd00b3ce36cb5c7a177978ff3361de861fe2cc559bb2760625d",
|
| 1393 |
+
"sha256:679bfd1fd4595a3f58a706256dc6cc7179ee40fbeff4d134aa3163a9c87ca545",
|
| 1394 |
+
"sha256:6ace0de72f252e48eda28981e24142a2b02ac17eacc3d8a2baf628671dd8cc8f",
|
| 1395 |
+
"sha256:771ba332790e88eb4aa9de2172131af25525ac23fdda789691e543962849f149",
|
| 1396 |
+
"sha256:8fabba875314ebc751b66e571b8b0d5319c76e22051304880a552d70db2252af",
|
| 1397 |
+
"sha256:a050ec9df95e9611461adb7f86da4f066848c045d966c46e7b124593e6410e2a",
|
| 1398 |
+
"sha256:ab7e2f9b655333a37002b90bea47d77ff8d1f01293798911afa7f39217f1b71d",
|
| 1399 |
+
"sha256:b0097aef9ac8a5e10434059641fea338fb682c61993bfe65670e459ec14b4151",
|
| 1400 |
+
"sha256:b509cfd696962683553cd6b9fc7f0baf05bff47c09fd68b085a8aea493436267",
|
| 1401 |
+
"sha256:bad590e701eaef644899ce164631f83e39669796e552f17aef5a37238646b392",
|
| 1402 |
+
"sha256:c586ca07c1418d4f010c6bc65215c4b193211e1b95dd8a1bd312d8207c5ccf6a",
|
| 1403 |
+
"sha256:cb5ad68b82c2aa408672444e567cea138db29790997d603525878632d61fd6ec",
|
| 1404 |
+
"sha256:cd9f0496daa9b505902848d401bfc3ffe80ee3a6863451fc6c05ceb2a45b9d8f",
|
| 1405 |
+
"sha256:da4d8f253dd8e152b3364902bed5e221165d3af4e71e2ae81eb9a9a9802089a2",
|
| 1406 |
+
"sha256:e8d77755a00566e0f0cf48da2e42e76ff93423b55880621944f950058be3fc0e",
|
| 1407 |
+
"sha256:ebc13dbfaec1b489fc6ed92a642b8a2c7072fa2d4bc12514cc2bbeacd47c5baf",
|
| 1408 |
+
"sha256:ed5ea68bc6f3428fbf9d98f1e72e2020d763d88053cc9a9d31b2eeb49500b26f",
|
| 1409 |
+
"sha256:ee52b9d29512eb7b8b9faee6db3f8694eb6c8455785a5d2d561c40eca67b226f",
|
| 1410 |
+
"sha256:f428ecdd224ec30c1a4dbdbaac44e746cbe9a05c25627b05cc7bc2dcda235a26",
|
| 1411 |
+
"sha256:f5f3ad171f21511813085ac549bb717bbdcc0f4da27abf6b0629438e1f23ca0b"
|
| 1412 |
+
],
|
| 1413 |
+
"version": "==1.3.0.post3"
|
| 1414 |
+
},
|
| 1415 |
"pycparser": {
|
| 1416 |
"hashes": [
|
| 1417 |
"sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9",
|
|
|
|
| 1536 |
"markers": "python_full_version >= '3.6.8'",
|
| 1537 |
"version": "==3.0.9"
|
| 1538 |
},
|
| 1539 |
+
"python-bidi": {
|
| 1540 |
+
"hashes": [
|
| 1541 |
+
"sha256:50eef6f6a0bbdd685f9e8c207f3c9050f5b578d0a46e37c76a9c4baea2cc2e13",
|
| 1542 |
+
"sha256:5347f71e82b3e9976dc657f09ded2bfe39ba8d6777ca81a5b2c56c30121c496e"
|
| 1543 |
+
],
|
| 1544 |
+
"version": "==0.4.2"
|
| 1545 |
+
},
|
| 1546 |
"python-dateutil": {
|
| 1547 |
"hashes": [
|
| 1548 |
"sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86",
|
|
|
|
| 1564 |
],
|
| 1565 |
"version": "==2022.2.1"
|
| 1566 |
},
|
| 1567 |
+
"pywavelets": {
|
| 1568 |
+
"hashes": [
|
| 1569 |
+
"sha256:030670a213ee8fefa56f6387b0c8e7d970c7f7ad6850dc048bd7c89364771b9b",
|
| 1570 |
+
"sha256:058b46434eac4c04dd89aeef6fa39e4b6496a951d78c500b6641fd5b2cc2f9f4",
|
| 1571 |
+
"sha256:231b0e0b1cdc1112f4af3c24eea7bf181c418d37922a67670e9bf6cfa2d544d4",
|
| 1572 |
+
"sha256:23bafd60350b2b868076d976bdd92f950b3944f119b4754b1d7ff22b7acbf6c6",
|
| 1573 |
+
"sha256:3f19327f2129fb7977bc59b966b4974dfd72879c093e44a7287500a7032695de",
|
| 1574 |
+
"sha256:47cac4fa25bed76a45bc781a293c26ac63e8eaae9eb8f9be961758d22b58649c",
|
| 1575 |
+
"sha256:578af438a02a86b70f1975b546f68aaaf38f28fb082a61ceb799816049ed18aa",
|
| 1576 |
+
"sha256:6437af3ddf083118c26d8f97ab43b0724b956c9f958e9ea788659f6a2834ba93",
|
| 1577 |
+
"sha256:64c6bac6204327321db30b775060fbe8e8642316e6bff17f06b9f34936f88875",
|
| 1578 |
+
"sha256:67a0d28a08909f21400cb09ff62ba94c064882ffd9e3a6b27880a111211d59bd",
|
| 1579 |
+
"sha256:71ab30f51ee4470741bb55fc6b197b4a2b612232e30f6ac069106f0156342356",
|
| 1580 |
+
"sha256:7231461d7a8eb3bdc7aa2d97d9f67ea5a9f8902522818e7e2ead9c2b3408eeb1",
|
| 1581 |
+
"sha256:754fa5085768227c4f4a26c1e0c78bc509a266d9ebd0eb69a278be7e3ece943c",
|
| 1582 |
+
"sha256:7ab8d9db0fe549ab2ee0bea61f614e658dd2df419d5b75fba47baa761e95f8f2",
|
| 1583 |
+
"sha256:875d4d620eee655346e3589a16a73790cf9f8917abba062234439b594e706784",
|
| 1584 |
+
"sha256:88aa5449e109d8f5e7f0adef85f7f73b1ab086102865be64421a3a3d02d277f4",
|
| 1585 |
+
"sha256:91d3d393cffa634f0e550d88c0e3f217c96cfb9e32781f2960876f1808d9b45b",
|
| 1586 |
+
"sha256:9cb5ca8d11d3f98e89e65796a2125be98424d22e5ada360a0dbabff659fca0fc",
|
| 1587 |
+
"sha256:ab7da0a17822cd2f6545626946d3b82d1a8e106afc4b50e3387719ba01c7b966",
|
| 1588 |
+
"sha256:ad987748f60418d5f4138db89d82ba0cb49b086e0cbb8fd5c3ed4a814cfb705e",
|
| 1589 |
+
"sha256:d0e56cd7a53aed3cceca91a04d62feb3a0aca6725b1912d29546c26f6ea90426",
|
| 1590 |
+
"sha256:d854411eb5ee9cb4bc5d0e66e3634aeb8f594210f6a1bed96dbed57ec70f181c",
|
| 1591 |
+
"sha256:da7b9c006171be1f9ddb12cc6e0d3d703b95f7f43cb5e2c6f5f15d3233fcf202",
|
| 1592 |
+
"sha256:daf0aa79842b571308d7c31a9c43bc99a30b6328e6aea3f50388cd8f69ba7dbc",
|
| 1593 |
+
"sha256:de7cd61a88a982edfec01ea755b0740e94766e00a1ceceeafef3ed4c85c605cd"
|
| 1594 |
+
],
|
| 1595 |
+
"markers": "python_version >= '3.8'",
|
| 1596 |
+
"version": "==1.4.1"
|
| 1597 |
+
},
|
| 1598 |
"pyyaml": {
|
| 1599 |
"hashes": [
|
| 1600 |
"sha256:01b45c0191e6d66c470b6cf1b9531a771a83c1c4208272ead47a3ae4f2f603bf",
|
|
|
|
| 1675 |
"markers": "python_version >= '3.6'",
|
| 1676 |
"version": "==4.9"
|
| 1677 |
},
|
| 1678 |
+
"scikit-image": {
|
| 1679 |
+
"hashes": [
|
| 1680 |
+
"sha256:03779a7e1736fdf89d83c0ba67d44110496edd736a3bfce61a2b5177a1c8a099",
|
| 1681 |
+
"sha256:0b0a199157ce8487c77de4fde0edc0b42d6d42818881c11f459262351d678b2d",
|
| 1682 |
+
"sha256:19a21a101a20c587a3b611a2cf6f86c35aae9f8d9563279b987e83ee1c9a9790",
|
| 1683 |
+
"sha256:24b5367de1762da6ee126dd8f30cc4e7efda474e0d7d70685433f0e3aa2ec450",
|
| 1684 |
+
"sha256:2a02d1bd0e2b53e36b952bd5fd6118d9ccc3ee51de35705d63d8eb1f2e86adef",
|
| 1685 |
+
"sha256:2f50b923f8099c1045fcde7418d86b206c87e333e43da980f41d8577b9605245",
|
| 1686 |
+
"sha256:32fb88cc36203b99c9672fb972c9ef98635deaa5fc889fe969f3e11c44f22919",
|
| 1687 |
+
"sha256:33dfd463ee6cc509defa279b963829f2230c9e0639ccd3931045be055878eea6",
|
| 1688 |
+
"sha256:3a01372ae4bca223873304b0bff79b9d92446ac6d6177f73d89b45561e2d09d8",
|
| 1689 |
+
"sha256:651de1c2ce1fbee834753b46b8e7d81cb12a5594898babba63ac82b30ddad49d",
|
| 1690 |
+
"sha256:6b6a8f98f2ac9bb73706461fd1dec875f6a5141759ed526850a5a49e90003d19",
|
| 1691 |
+
"sha256:7f9f8a1387afc6c70f2bed007c3854a2d7489f9f7713c242f16f32ee05934bc2",
|
| 1692 |
+
"sha256:84baa3179f3ae983c3a5d81c1e404bc92dcf7daeb41bfe9369badcda3fb22b92",
|
| 1693 |
+
"sha256:8d8917fcf85b987b1f287f823f3a1a7dac38b70aaca759bc0200f3bc292d5ced",
|
| 1694 |
+
"sha256:9439e5294de3f18d6e82ec8eee2c46590231cf9c690da80545e83a0733b7a69e",
|
| 1695 |
+
"sha256:9fb0923a3bfa99457c5e17888f27b3b8a83a3600b4fef317992e7b7234764732",
|
| 1696 |
+
"sha256:a7c3985c68bfe05f7571167ee021d14f5b8d1a4a250c91f0b13be7fb07e6af34",
|
| 1697 |
+
"sha256:a8714348ddd671f819457a797c97d4c672166f093def66d66c3254cbd1d43f83",
|
| 1698 |
+
"sha256:ad5d8000207a264d1a55681a9276e6a739d3f05cf4429004ad00d61d1892235f",
|
| 1699 |
+
"sha256:cc24177de3fdceca5d04807ad9c87d665f0bf01032ed94a9055cd1ed2b3f33e9",
|
| 1700 |
+
"sha256:ce3d2207f253b8eb2c824e30d145a9f07a34a14212d57f3beca9f7e03c383cbe",
|
| 1701 |
+
"sha256:cfbb073f23deb48e0e60c47f8741d8089121d89cc78629ea8c5b51096efc5be7",
|
| 1702 |
+
"sha256:e207c6ce5ce121d7d9b9d2b61b9adca57d1abed112c902d8ffbfdc20fb42c12b",
|
| 1703 |
+
"sha256:fd9dd3994bb6f9f7a35f228323f3c4dc44b3cf2ff15fd72d895216e9333550c6",
|
| 1704 |
+
"sha256:fdf48d9b1f13af69e4e2c78e05067e322e9c8c97463c315cd0ecb47a94e259fc",
|
| 1705 |
+
"sha256:ff3b1025356508d41f4fe48528e509d95f9e4015e90cf158cd58c56dc63e0ac5"
|
| 1706 |
+
],
|
| 1707 |
+
"markers": "python_version >= '3.7'",
|
| 1708 |
+
"version": "==0.19.3"
|
| 1709 |
+
},
|
| 1710 |
"scipy": {
|
| 1711 |
"hashes": [
|
| 1712 |
"sha256:0419485dbcd0ed78c0d5bf234c5dd63e86065b39b4d669e45810d42199d49521",
|
|
|
|
| 1752 |
"markers": "python_version >= '3.7'",
|
| 1753 |
"version": "==65.3.0"
|
| 1754 |
},
|
| 1755 |
+
"shapely": {
|
| 1756 |
+
"hashes": [
|
| 1757 |
+
"sha256:007f0d51d045307dc3addd1c318d18f450c565c8ea96ea41304e020ca34d85b7",
|
| 1758 |
+
"sha256:033b9eaf50c9de4c87b0d1ffa532edcf7420b70a329c630431da50071be939d9",
|
| 1759 |
+
"sha256:04f416aa8ca9480b5cd74d2184fe43d4196a5941046661f7be27fe5c10f89ede",
|
| 1760 |
+
"sha256:1d431ac2bb75e7c59a75820719b2f0f494720d821cb68eeb2487812d1d7bc287",
|
| 1761 |
+
"sha256:1f071175777f87d9220c24e4576dcf972b14f93dffd05a1d72ee0555dfa2a799",
|
| 1762 |
+
"sha256:20157b20f32eac57a56b5ef5a5a0ffb5288e1554e0172bc9452d3de190965709",
|
| 1763 |
+
"sha256:20c40085835fbd5b12566b9b0a6d718b0b6a4d308ff1fff5b19d7cf29f75cc77",
|
| 1764 |
+
"sha256:2a6e2fb40415cecf67dff1a13844d27a11c09604839b5cfbbb41b80cf97a625c",
|
| 1765 |
+
"sha256:34765b0495c6297adb95d7de8fc62790f8eaf8e7fb96260dd644cf11d37b3d21",
|
| 1766 |
+
"sha256:41e1395bb3865e42ca3dec857669ed3ab90806925fce38c47d7f92bd4276f7cd",
|
| 1767 |
+
"sha256:471ce47f3b221731b3a8fb90c24dd5899140ca892bb78c5df49b340a73da5bd2",
|
| 1768 |
+
"sha256:4c10d55a2dfab648d9aeca1818f986e505f29be2763edd0910b50c76d73db085",
|
| 1769 |
+
"sha256:4f14ea7f041412ff5b277d5424e76638921ba771c43b21b20706abc7900d5ce9",
|
| 1770 |
+
"sha256:53d453f40e5b1265b8806ac7e5f3ce775b758e5c42c24239e3d8de6e861b7699",
|
| 1771 |
+
"sha256:5b77a7fd5bbf051a640d25db85fc062d245ef03cd80081321b6b87213a8b0892",
|
| 1772 |
+
"sha256:5d629bcf68b45dfdfd85cc0dc37f5325d4ce9341b235f16969c1a76599476e84",
|
| 1773 |
+
"sha256:5f3bf1d985dc8367f480f68f07770f57a5fe54477e98237c6f328db79568f1e2",
|
| 1774 |
+
"sha256:6702a5df484ca92bbd1494b5945dd7d6b8f6caab13ca9f6240e64034a114fa13",
|
| 1775 |
+
"sha256:687520cf1db1fac2970cca5eb2ea037c1862b2e6938a514f9f6106c9d4ac0445",
|
| 1776 |
+
"sha256:6c399712b98fef80ef53748a572b229788650b0af535e6d4c5a3168aabbc0013",
|
| 1777 |
+
"sha256:7855ac13c5a951bcef1f3834d1affeeacea42a4abd2c0f46b341229b350f2406",
|
| 1778 |
+
"sha256:79da29fde8ad2ca791b324f2cc3e75093573f69488ade7b524f79d781b042699",
|
| 1779 |
+
"sha256:95a864b83857de736499d171785b8e71df97e8cef62d4e36b34f057b5a4dc98c",
|
| 1780 |
+
"sha256:a195e51caafa218291f2cbaa3fef69fd3353c93ec4b65b2a4722c4cf40c3198c",
|
| 1781 |
+
"sha256:a2cc137d525a2e54557df2f70f7b9d52749840e1d877cf500a8f7f0f77170552",
|
| 1782 |
+
"sha256:a352f00637dda1354c549b602d9dcc69a7048d5d64dcdaf3b5e702d0bf5faad2",
|
| 1783 |
+
"sha256:b1756c28a48a61e5581720171a89d69ae303d5faffc58efef0dab498e16a50f1",
|
| 1784 |
+
"sha256:b70463ef505f509809b92ffb1202890a1236ce9f21666020de289fed911fdeaf",
|
| 1785 |
+
"sha256:bb371511269d8320652b980edb044f9c45c87df12ecce00c4bb1d0662d53bdb4",
|
| 1786 |
+
"sha256:be731cf35cfd54091d62cd63a4c4d87a97db68c2224408ec6ef28c6333d74501",
|
| 1787 |
+
"sha256:d7a6fd1329f75e290b858e9faeef15ae76d7ea05a02648fe216fec3c3bed4eb0",
|
| 1788 |
+
"sha256:e018163500109ab4c9ad51d018ba28abb1aed5b0451476859e189fbb00c46c7b",
|
| 1789 |
+
"sha256:eac2d08c0a02dccffd7f836901ea1d1b0f8e7ff3878b2c7a45443f0a34e7f087",
|
| 1790 |
+
"sha256:f6801a33897fb54ce39d5e841214192ecf95f4ddf8458d17e196a314fefe43bb"
|
| 1791 |
+
],
|
| 1792 |
+
"markers": "python_version >= '3.6'",
|
| 1793 |
+
"version": "==1.8.4"
|
| 1794 |
+
},
|
| 1795 |
"six": {
|
| 1796 |
"hashes": [
|
| 1797 |
"sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926",
|
|
|
|
| 1852 |
"index": "pypi",
|
| 1853 |
"version": "==0.1.1.post2209072238"
|
| 1854 |
},
|
| 1855 |
+
"tifffile": {
|
| 1856 |
+
"hashes": [
|
| 1857 |
+
"sha256:1456f9f6943c85082ef4d73f5329038826da67f70d5d513873a06f3b1598d23e",
|
| 1858 |
+
"sha256:3e74e0fd48838477ebcf40e09b7780bd095ee5920b2238f485e2c68463a3dcb4"
|
| 1859 |
+
],
|
| 1860 |
+
"markers": "python_version >= '3.8'",
|
| 1861 |
+
"version": "==2022.8.12"
|
| 1862 |
+
},
|
| 1863 |
"torch": {
|
| 1864 |
"hashes": [
|
| 1865 |
"sha256:03e31c37711db2cd201e02de5826de875529e45a55631d317aadce2f1ed45aa8",
|
detection/app.py
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
import argparse
|
| 3 |
import time
|
|
@@ -8,12 +11,12 @@ import torch
|
|
| 8 |
import torch.backends.cudnn as cudnn
|
| 9 |
from numpy import random
|
| 10 |
|
| 11 |
-
from models.experimental import attempt_load
|
| 12 |
-
from utils.datasets import LoadStreams, LoadImages
|
| 13 |
-
from utils.general import check_img_size, check_requirements, check_imshow, non_max_suppression, apply_classifier, \
|
| 14 |
scale_coords, xyxy2xywh, strip_optimizer, set_logging, increment_path
|
| 15 |
-
from utils.plots import plot_one_box
|
| 16 |
-
from utils.torch_utils import select_device, load_classifier, time_synchronized, TracedModel
|
| 17 |
from PIL import Image
|
| 18 |
|
| 19 |
#downloading models
|
|
|
|
| 1 |
+
# import sys
|
| 2 |
+
# sys.path.append('../')
|
| 3 |
+
|
| 4 |
import os
|
| 5 |
import argparse
|
| 6 |
import time
|
|
|
|
| 11 |
import torch.backends.cudnn as cudnn
|
| 12 |
from numpy import random
|
| 13 |
|
| 14 |
+
from detection.models.experimental import attempt_load
|
| 15 |
+
from detection.utils.datasets import LoadStreams, LoadImages
|
| 16 |
+
from detection.utils.general import check_img_size, check_requirements, check_imshow, non_max_suppression, apply_classifier, \
|
| 17 |
scale_coords, xyxy2xywh, strip_optimizer, set_logging, increment_path
|
| 18 |
+
from detection.utils.plots import plot_one_box
|
| 19 |
+
from detection.utils.torch_utils import select_device, load_classifier, time_synchronized, TracedModel
|
| 20 |
from PIL import Image
|
| 21 |
|
| 22 |
#downloading models
|
detection/models/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
# init
|
|
|
|
|
|
detection/models/common.py
CHANGED
|
@@ -12,10 +12,10 @@ from torchvision.ops import DeformConv2d
|
|
| 12 |
from PIL import Image
|
| 13 |
from torch.cuda import amp
|
| 14 |
|
| 15 |
-
from utils.datasets import letterbox
|
| 16 |
-
from utils.general import non_max_suppression, make_divisible, scale_coords, increment_path, xyxy2xywh
|
| 17 |
-
from utils.plots import color_list, plot_one_box
|
| 18 |
-
from utils.torch_utils import time_synchronized
|
| 19 |
|
| 20 |
|
| 21 |
##### basic ####
|
|
|
|
| 12 |
from PIL import Image
|
| 13 |
from torch.cuda import amp
|
| 14 |
|
| 15 |
+
from detection.utils.datasets import letterbox
|
| 16 |
+
from detection.utils.general import non_max_suppression, make_divisible, scale_coords, increment_path, xyxy2xywh
|
| 17 |
+
from detection.utils.plots import color_list, plot_one_box
|
| 18 |
+
from detection.utils.torch_utils import time_synchronized
|
| 19 |
|
| 20 |
|
| 21 |
##### basic ####
|
detection/models/experimental.py
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import numpy as np
|
| 2 |
import random
|
| 3 |
import torch
|
| 4 |
import torch.nn as nn
|
| 5 |
|
| 6 |
-
from models.common import Conv, DWConv
|
| 7 |
-
from utils.google_utils import attempt_download
|
| 8 |
|
| 9 |
|
| 10 |
class CrossConv(nn.Module):
|
|
|
|
| 1 |
+
# import sys
|
| 2 |
+
# sys.path.append('../')
|
| 3 |
+
|
| 4 |
import numpy as np
|
| 5 |
import random
|
| 6 |
import torch
|
| 7 |
import torch.nn as nn
|
| 8 |
|
| 9 |
+
from detection.models.common import Conv, DWConv
|
| 10 |
+
from detection.utils.google_utils import attempt_download
|
| 11 |
|
| 12 |
|
| 13 |
class CrossConv(nn.Module):
|
detection/utils/datasets.py
CHANGED
|
@@ -26,9 +26,9 @@ from copy import deepcopy
|
|
| 26 |
from torchvision.utils import save_image
|
| 27 |
from torchvision.ops import roi_pool, roi_align, ps_roi_pool, ps_roi_align
|
| 28 |
|
| 29 |
-
from utils.general import check_requirements, xyxy2xywh, xywh2xyxy, xywhn2xyxy, xyn2xy, segment2box, segments2boxes, \
|
| 30 |
resample_segments, clean_str
|
| 31 |
-
from utils.torch_utils import torch_distributed_zero_first
|
| 32 |
|
| 33 |
# Parameters
|
| 34 |
help_url = 'https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data'
|
|
@@ -79,9 +79,9 @@ def create_dataloader(path, imgsz, batch_size, stride, opt, hyp=None, augment=Fa
|
|
| 79 |
|
| 80 |
batch_size = min(batch_size, len(dataset))
|
| 81 |
nw = min([os.cpu_count() // world_size, batch_size if batch_size > 1 else 0, workers]) # number of workers
|
| 82 |
-
sampler = torch.utils.data.distributed.DistributedSampler(dataset) if rank != -1 else None
|
| 83 |
-
loader = torch.utils.data.DataLoader if image_weights else InfiniteDataLoader
|
| 84 |
-
# Use torch.utils.data.DataLoader() if dataset.properties will update during training else InfiniteDataLoader()
|
| 85 |
dataloader = loader(dataset,
|
| 86 |
batch_size=batch_size,
|
| 87 |
num_workers=nw,
|
|
@@ -1255,7 +1255,7 @@ def flatten_recursive(path='../coco'):
|
|
| 1255 |
shutil.copyfile(file, new_path / Path(file).name)
|
| 1256 |
|
| 1257 |
|
| 1258 |
-
def extract_boxes(path='../coco/'): # from utils.datasets import *; extract_boxes('../coco128')
|
| 1259 |
# Convert detection dataset into classification dataset, with one directory per class
|
| 1260 |
|
| 1261 |
path = Path(path) # images dir
|
|
@@ -1292,7 +1292,7 @@ def extract_boxes(path='../coco/'): # from utils.datasets import *; extract_box
|
|
| 1292 |
|
| 1293 |
def autosplit(path='../coco', weights=(0.9, 0.1, 0.0), annotated_only=False):
|
| 1294 |
""" Autosplit a dataset into train/val/test splits and save path/autosplit_*.txt files
|
| 1295 |
-
Usage: from utils.datasets import *; autosplit('../coco')
|
| 1296 |
Arguments
|
| 1297 |
path: Path to images directory
|
| 1298 |
weights: Train, val, test weights (list)
|
|
|
|
| 26 |
from torchvision.utils import save_image
|
| 27 |
from torchvision.ops import roi_pool, roi_align, ps_roi_pool, ps_roi_align
|
| 28 |
|
| 29 |
+
from detection.utils.general import check_requirements, xyxy2xywh, xywh2xyxy, xywhn2xyxy, xyn2xy, segment2box, segments2boxes, \
|
| 30 |
resample_segments, clean_str
|
| 31 |
+
from detection.utils.torch_utils import torch_distributed_zero_first
|
| 32 |
|
| 33 |
# Parameters
|
| 34 |
help_url = 'https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data'
|
|
|
|
| 79 |
|
| 80 |
batch_size = min(batch_size, len(dataset))
|
| 81 |
nw = min([os.cpu_count() // world_size, batch_size if batch_size > 1 else 0, workers]) # number of workers
|
| 82 |
+
sampler = torch.detection.utils.data.distributed.DistributedSampler(dataset) if rank != -1 else None
|
| 83 |
+
loader = torch.detection.utils.data.DataLoader if image_weights else InfiniteDataLoader
|
| 84 |
+
# Use torch.detection.utils.data.DataLoader() if dataset.properties will update during training else InfiniteDataLoader()
|
| 85 |
dataloader = loader(dataset,
|
| 86 |
batch_size=batch_size,
|
| 87 |
num_workers=nw,
|
|
|
|
| 1255 |
shutil.copyfile(file, new_path / Path(file).name)
|
| 1256 |
|
| 1257 |
|
| 1258 |
+
def extract_boxes(path='../coco/'): # from detection.utils.datasets import *; extract_boxes('../coco128')
|
| 1259 |
# Convert detection dataset into classification dataset, with one directory per class
|
| 1260 |
|
| 1261 |
path = Path(path) # images dir
|
|
|
|
| 1292 |
|
| 1293 |
def autosplit(path='../coco', weights=(0.9, 0.1, 0.0), annotated_only=False):
|
| 1294 |
""" Autosplit a dataset into train/val/test splits and save path/autosplit_*.txt files
|
| 1295 |
+
Usage: from detection.utils.datasets import *; autosplit('../coco')
|
| 1296 |
Arguments
|
| 1297 |
path: Path to images directory
|
| 1298 |
weights: Train, val, test weights (list)
|
detection/utils/general.py
CHANGED
|
@@ -18,9 +18,9 @@ import torch
|
|
| 18 |
import torchvision
|
| 19 |
import yaml
|
| 20 |
|
| 21 |
-
from utils.google_utils import gsutil_getsize
|
| 22 |
-
from utils.metrics import fitness
|
| 23 |
-
from utils.torch_utils import init_torch_seeds
|
| 24 |
|
| 25 |
# Settings
|
| 26 |
torch.set_printoptions(linewidth=320, precision=5, profile='long')
|
|
@@ -796,7 +796,7 @@ def non_max_suppression_kpt(prediction, conf_thres=0.25, iou_thres=0.45, classes
|
|
| 796 |
return output
|
| 797 |
|
| 798 |
|
| 799 |
-
def strip_optimizer(f='best.pt', s=''): # from utils.general import *; strip_optimizer()
|
| 800 |
# Strip optimizer from 'f' to finalize training, optionally save as 's'
|
| 801 |
x = torch.load(f, map_location=torch.device('cpu'))
|
| 802 |
if x.get('ema'):
|
|
|
|
| 18 |
import torchvision
|
| 19 |
import yaml
|
| 20 |
|
| 21 |
+
from detection.utils.google_utils import gsutil_getsize
|
| 22 |
+
from detection.utils.metrics import fitness
|
| 23 |
+
from detection.utils.torch_utils import init_torch_seeds
|
| 24 |
|
| 25 |
# Settings
|
| 26 |
torch.set_printoptions(linewidth=320, precision=5, profile='long')
|
|
|
|
| 796 |
return output
|
| 797 |
|
| 798 |
|
| 799 |
+
def strip_optimizer(f='best.pt', s=''): # from detection.utils.general import *; strip_optimizer()
|
| 800 |
# Strip optimizer from 'f' to finalize training, optionally save as 's'
|
| 801 |
x = torch.load(f, map_location=torch.device('cpu'))
|
| 802 |
if x.get('ema'):
|
detection/utils/plots.py
CHANGED
|
@@ -18,8 +18,8 @@ import yaml
|
|
| 18 |
from PIL import Image, ImageDraw, ImageFont
|
| 19 |
from scipy.signal import butter, filtfilt
|
| 20 |
|
| 21 |
-
from utils.general import xywh2xyxy, xyxy2xywh
|
| 22 |
-
from utils.metrics import fitness
|
| 23 |
|
| 24 |
# Settings
|
| 25 |
matplotlib.rc('font', **{'size': 11})
|
|
@@ -82,7 +82,7 @@ def plot_one_box_PIL(box, img, color=None, label=None, line_thickness=None):
|
|
| 82 |
return np.asarray(img)
|
| 83 |
|
| 84 |
|
| 85 |
-
def plot_wh_methods(): # from utils.plots import *; plot_wh_methods()
|
| 86 |
# Compares the two methods for width-height anchor multiplication
|
| 87 |
# https://github.com/ultralytics/yolov3/issues/168
|
| 88 |
x = np.arange(-4.0, 4.0, .1)
|
|
@@ -207,7 +207,7 @@ def plot_lr_scheduler(optimizer, scheduler, epochs=300, save_dir=''):
|
|
| 207 |
plt.close()
|
| 208 |
|
| 209 |
|
| 210 |
-
def plot_test_txt(): # from utils.plots import *; plot_test()
|
| 211 |
# Plot test.txt histograms
|
| 212 |
x = np.loadtxt('test.txt', dtype=np.float32)
|
| 213 |
box = xyxy2xywh(x[:, :4])
|
|
@@ -224,7 +224,7 @@ def plot_test_txt(): # from utils.plots import *; plot_test()
|
|
| 224 |
plt.savefig('hist1d.png', dpi=200)
|
| 225 |
|
| 226 |
|
| 227 |
-
def plot_targets_txt(): # from utils.plots import *; plot_targets_txt()
|
| 228 |
# Plot targets.txt histograms
|
| 229 |
x = np.loadtxt('targets.txt', dtype=np.float32).T
|
| 230 |
s = ['x targets', 'y targets', 'width targets', 'height targets']
|
|
@@ -237,7 +237,7 @@ def plot_targets_txt(): # from utils.plots import *; plot_targets_txt()
|
|
| 237 |
plt.savefig('targets.jpg', dpi=200)
|
| 238 |
|
| 239 |
|
| 240 |
-
def plot_study_txt(path='', x=None): # from utils.plots import *; plot_study_txt()
|
| 241 |
# Plot study.txt generated by test.py
|
| 242 |
fig, ax = plt.subplots(2, 4, figsize=(10, 6), tight_layout=True)
|
| 243 |
# ax = ax.ravel()
|
|
@@ -318,7 +318,7 @@ def plot_labels(labels, names=(), save_dir=Path(''), loggers=None):
|
|
| 318 |
v.log({"Labels": [v.Image(str(x), caption=x.name) for x in save_dir.glob('*labels*.jpg')]}, commit=False)
|
| 319 |
|
| 320 |
|
| 321 |
-
def plot_evolution(yaml_file='data/hyp.finetune.yaml'): # from utils.plots import *; plot_evolution()
|
| 322 |
# Plot hyperparameter evolution results in evolve.txt
|
| 323 |
with open(yaml_file) as f:
|
| 324 |
hyp = yaml.load(f, Loader=yaml.SafeLoader)
|
|
@@ -343,7 +343,7 @@ def plot_evolution(yaml_file='data/hyp.finetune.yaml'): # from utils.plots impo
|
|
| 343 |
|
| 344 |
|
| 345 |
def profile_idetection(start=0, stop=0, labels=(), save_dir=''):
|
| 346 |
-
# Plot iDetection '*.txt' per-image logs. from utils.plots import *; profile_idetection()
|
| 347 |
ax = plt.subplots(2, 4, figsize=(12, 6), tight_layout=True)[1].ravel()
|
| 348 |
s = ['Images', 'Free Storage (GB)', 'RAM Usage (GB)', 'Battery', 'dt_raw (ms)', 'dt_smooth (ms)', 'real-world FPS']
|
| 349 |
files = list(Path(save_dir).glob('frames*.txt'))
|
|
@@ -374,7 +374,7 @@ def profile_idetection(start=0, stop=0, labels=(), save_dir=''):
|
|
| 374 |
plt.savefig(Path(save_dir) / 'idetection_profile.png', dpi=200)
|
| 375 |
|
| 376 |
|
| 377 |
-
def plot_results_overlay(start=0, stop=0): # from utils.plots import *; plot_results_overlay()
|
| 378 |
# Plot training 'results*.txt', overlaying train and val losses
|
| 379 |
s = ['train', 'train', 'train', 'Precision', 'mAP@0.5', 'val', 'val', 'val', 'Recall', 'mAP@0.5:0.95'] # legends
|
| 380 |
t = ['Box', 'Objectness', 'Classification', 'P-R', 'mAP-F1'] # titles
|
|
@@ -398,7 +398,7 @@ def plot_results_overlay(start=0, stop=0): # from utils.plots import *; plot_re
|
|
| 398 |
|
| 399 |
|
| 400 |
def plot_results(start=0, stop=0, bucket='', id=(), labels=(), save_dir=''):
|
| 401 |
-
# Plot training 'results*.txt'. from utils.plots import *; plot_results(save_dir='runs/train/exp')
|
| 402 |
fig, ax = plt.subplots(2, 5, figsize=(12, 6), tight_layout=True)
|
| 403 |
ax = ax.ravel()
|
| 404 |
s = ['Box', 'Objectness', 'Classification', 'Precision', 'Recall',
|
|
|
|
| 18 |
from PIL import Image, ImageDraw, ImageFont
|
| 19 |
from scipy.signal import butter, filtfilt
|
| 20 |
|
| 21 |
+
from detection.utils.general import xywh2xyxy, xyxy2xywh
|
| 22 |
+
from detection.utils.metrics import fitness
|
| 23 |
|
| 24 |
# Settings
|
| 25 |
matplotlib.rc('font', **{'size': 11})
|
|
|
|
| 82 |
return np.asarray(img)
|
| 83 |
|
| 84 |
|
| 85 |
+
def plot_wh_methods(): # from detection.utils.plots import *; plot_wh_methods()
|
| 86 |
# Compares the two methods for width-height anchor multiplication
|
| 87 |
# https://github.com/ultralytics/yolov3/issues/168
|
| 88 |
x = np.arange(-4.0, 4.0, .1)
|
|
|
|
| 207 |
plt.close()
|
| 208 |
|
| 209 |
|
| 210 |
+
def plot_test_txt(): # from detection.utils.plots import *; plot_test()
|
| 211 |
# Plot test.txt histograms
|
| 212 |
x = np.loadtxt('test.txt', dtype=np.float32)
|
| 213 |
box = xyxy2xywh(x[:, :4])
|
|
|
|
| 224 |
plt.savefig('hist1d.png', dpi=200)
|
| 225 |
|
| 226 |
|
| 227 |
+
def plot_targets_txt(): # from detection.utils.plots import *; plot_targets_txt()
|
| 228 |
# Plot targets.txt histograms
|
| 229 |
x = np.loadtxt('targets.txt', dtype=np.float32).T
|
| 230 |
s = ['x targets', 'y targets', 'width targets', 'height targets']
|
|
|
|
| 237 |
plt.savefig('targets.jpg', dpi=200)
|
| 238 |
|
| 239 |
|
| 240 |
+
def plot_study_txt(path='', x=None): # from detection.utils.plots import *; plot_study_txt()
|
| 241 |
# Plot study.txt generated by test.py
|
| 242 |
fig, ax = plt.subplots(2, 4, figsize=(10, 6), tight_layout=True)
|
| 243 |
# ax = ax.ravel()
|
|
|
|
| 318 |
v.log({"Labels": [v.Image(str(x), caption=x.name) for x in save_dir.glob('*labels*.jpg')]}, commit=False)
|
| 319 |
|
| 320 |
|
| 321 |
+
def plot_evolution(yaml_file='data/hyp.finetune.yaml'): # from detection.utils.plots import *; plot_evolution()
|
| 322 |
# Plot hyperparameter evolution results in evolve.txt
|
| 323 |
with open(yaml_file) as f:
|
| 324 |
hyp = yaml.load(f, Loader=yaml.SafeLoader)
|
|
|
|
| 343 |
|
| 344 |
|
| 345 |
def profile_idetection(start=0, stop=0, labels=(), save_dir=''):
|
| 346 |
+
# Plot iDetection '*.txt' per-image logs. from detection.utils.plots import *; profile_idetection()
|
| 347 |
ax = plt.subplots(2, 4, figsize=(12, 6), tight_layout=True)[1].ravel()
|
| 348 |
s = ['Images', 'Free Storage (GB)', 'RAM Usage (GB)', 'Battery', 'dt_raw (ms)', 'dt_smooth (ms)', 'real-world FPS']
|
| 349 |
files = list(Path(save_dir).glob('frames*.txt'))
|
|
|
|
| 374 |
plt.savefig(Path(save_dir) / 'idetection_profile.png', dpi=200)
|
| 375 |
|
| 376 |
|
| 377 |
+
def plot_results_overlay(start=0, stop=0): # from detection.utils.plots import *; plot_results_overlay()
|
| 378 |
# Plot training 'results*.txt', overlaying train and val losses
|
| 379 |
s = ['train', 'train', 'train', 'Precision', 'mAP@0.5', 'val', 'val', 'val', 'Recall', 'mAP@0.5:0.95'] # legends
|
| 380 |
t = ['Box', 'Objectness', 'Classification', 'P-R', 'mAP-F1'] # titles
|
|
|
|
| 398 |
|
| 399 |
|
| 400 |
def plot_results(start=0, stop=0, bucket='', id=(), labels=(), save_dir=''):
|
| 401 |
+
# Plot training 'results*.txt'. from detection.utils.plots import *; plot_results(save_dir='runs/train/exp')
|
| 402 |
fig, ax = plt.subplots(2, 5, figsize=(12, 6), tight_layout=True)
|
| 403 |
ax = ax.ravel()
|
| 404 |
s = ['Box', 'Objectness', 'Classification', 'Precision', 'Recall',
|