Bingsu commited on
Commit
24c40e1
1 Parent(s): 189300e

chore: update

Browse files
Files changed (4) hide show
  1. .pre-commit-config.yaml +1 -1
  2. models.py +7 -7
  3. pdm.lock +46 -30
  4. pyproject.toml +1 -0
.pre-commit-config.yaml CHANGED
@@ -19,7 +19,7 @@ repos:
19
  - id: prettier
20
 
21
  - repo: https://github.com/astral-sh/ruff-pre-commit
22
- rev: v0.4.5
23
  hooks:
24
  - id: ruff
25
  args: [--fix, --exit-non-zero-on-fix]
 
19
  - id: prettier
20
 
21
  - repo: https://github.com/astral-sh/ruff-pre-commit
22
+ rev: v0.4.7
23
  hooks:
24
  - id: ruff
25
  args: [--fix, --exit-non-zero-on-fix]
models.py CHANGED
@@ -39,9 +39,7 @@ model_info = [
39
 
40
 
41
  def download(model: str, repo: str) -> str:
42
- return hf_hub_download(
43
- repo, model, local_dir="downloads", local_dir_use_symlinks=False
44
- )
45
 
46
 
47
  def export(path: str) -> str:
@@ -54,15 +52,17 @@ def main():
54
  save.mkdir(exist_ok=True)
55
 
56
  pbar = tqdm(model_info)
 
57
  with ThreadPoolExecutor() as executor:
58
- fs = []
59
- for repo, model in tqdm(model_info):
60
  fu = executor.submit(download, model, repo)
61
  fu.add_done_callback(lambda _: pbar.update())
62
  fs.append(fu)
63
 
64
- for future in fs:
65
- path = future.result()
 
 
66
  onnx = export(path)
67
  target_dir = save / Path(model).stem
68
  (target_dir / "1").mkdir(exist_ok=True, parents=True)
 
39
 
40
 
41
  def download(model: str, repo: str) -> str:
42
+ return hf_hub_download(repo, model, local_dir="downloads")
 
 
43
 
44
 
45
  def export(path: str) -> str:
 
52
  save.mkdir(exist_ok=True)
53
 
54
  pbar = tqdm(model_info)
55
+ fs = []
56
  with ThreadPoolExecutor() as executor:
57
+ for repo, model in model_info:
 
58
  fu = executor.submit(download, model, repo)
59
  fu.add_done_callback(lambda _: pbar.update())
60
  fs.append(fu)
61
 
62
+ paths = [fu.result() for fu in fs]
63
+ pbar.close()
64
+
65
+ for path in paths:
66
  onnx = export(path)
67
  target_dir = save / Path(model).stem
68
  (target_dir / "1").mkdir(exist_ok=True, parents=True)
pdm.lock CHANGED
@@ -5,7 +5,7 @@
5
  groups = ["default", "dev"]
6
  strategy = ["cross_platform", "inherit_metadata"]
7
  lock_version = "4.4.1"
8
- content_hash = "sha256:d48e655aeff6da1a1cb75c9ca8f161e74da3a0f345fa661facd473a60392d7b6"
9
 
10
  [[package]]
11
  name = "certifi"
@@ -746,6 +746,22 @@ files = [
746
  {file = "onnxsim-0.4.36.tar.gz", hash = "sha256:6e0ee9d6d4a83042bdef7319fbe58352d9fda5f253386be2b267c7c27f0638ee"},
747
  ]
748
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
749
  [[package]]
750
  name = "opencv-python"
751
  version = "4.9.0.80"
@@ -891,18 +907,18 @@ files = [
891
 
892
  [[package]]
893
  name = "protobuf"
894
- version = "5.27.0"
895
  requires_python = ">=3.8"
896
  summary = ""
897
  groups = ["default"]
898
  files = [
899
- {file = "protobuf-5.27.0-cp310-abi3-win32.whl", hash = "sha256:2f83bf341d925650d550b8932b71763321d782529ac0eaf278f5242f513cc04e"},
900
- {file = "protobuf-5.27.0-cp310-abi3-win_amd64.whl", hash = "sha256:b276e3f477ea1eebff3c2e1515136cfcff5ac14519c45f9b4aa2f6a87ea627c4"},
901
- {file = "protobuf-5.27.0-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:744489f77c29174328d32f8921566fb0f7080a2f064c5137b9d6f4b790f9e0c1"},
902
- {file = "protobuf-5.27.0-cp38-abi3-manylinux2014_aarch64.whl", hash = "sha256:f51f33d305e18646f03acfdb343aac15b8115235af98bc9f844bf9446573827b"},
903
- {file = "protobuf-5.27.0-cp38-abi3-manylinux2014_x86_64.whl", hash = "sha256:56937f97ae0dcf4e220ff2abb1456c51a334144c9960b23597f044ce99c29c89"},
904
- {file = "protobuf-5.27.0-py3-none-any.whl", hash = "sha256:673ad60f1536b394b4fa0bcd3146a4130fcad85bfe3b60eaa86d6a0ace0fa374"},
905
- {file = "protobuf-5.27.0.tar.gz", hash = "sha256:07f2b9a15255e3cf3f137d884af7972407b556a7a220912b252f26dc3121e6bf"},
906
  ]
907
 
908
  [[package]]
@@ -1047,28 +1063,28 @@ files = [
1047
 
1048
  [[package]]
1049
  name = "ruff"
1050
- version = "0.4.5"
1051
  requires_python = ">=3.7"
1052
  summary = "An extremely fast Python linter and code formatter, written in Rust."
1053
  groups = ["dev"]
1054
  files = [
1055
- {file = "ruff-0.4.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:8f58e615dec58b1a6b291769b559e12fdffb53cc4187160a2fc83250eaf54e96"},
1056
- {file = "ruff-0.4.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:84dd157474e16e3a82745d2afa1016c17d27cb5d52b12e3d45d418bcc6d49264"},
1057
- {file = "ruff-0.4.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:25f483ad9d50b00e7fd577f6d0305aa18494c6af139bce7319c68a17180087f4"},
1058
- {file = "ruff-0.4.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:63fde3bf6f3ad4e990357af1d30e8ba2730860a954ea9282c95fc0846f5f64af"},
1059
- {file = "ruff-0.4.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:78e3ba4620dee27f76bbcad97067766026c918ba0f2d035c2fc25cbdd04d9c97"},
1060
- {file = "ruff-0.4.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:441dab55c568e38d02bbda68a926a3d0b54f5510095c9de7f95e47a39e0168aa"},
1061
- {file = "ruff-0.4.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1169e47e9c4136c997f08f9857ae889d614c5035d87d38fda9b44b4338909cdf"},
1062
- {file = "ruff-0.4.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:755ac9ac2598a941512fc36a9070a13c88d72ff874a9781493eb237ab02d75df"},
1063
- {file = "ruff-0.4.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f4b02a65985be2b34b170025a8b92449088ce61e33e69956ce4d316c0fe7cce0"},
1064
- {file = "ruff-0.4.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:75a426506a183d9201e7e5664de3f6b414ad3850d7625764106f7b6d0486f0a1"},
1065
- {file = "ruff-0.4.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:6e1b139b45e2911419044237d90b60e472f57285950e1492c757dfc88259bb06"},
1066
- {file = "ruff-0.4.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:a6f29a8221d2e3d85ff0c7b4371c0e37b39c87732c969b4d90f3dad2e721c5b1"},
1067
- {file = "ruff-0.4.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:d6ef817124d72b54cc923f3444828ba24fa45c3164bc9e8f1813db2f3d3a8a11"},
1068
- {file = "ruff-0.4.5-py3-none-win32.whl", hash = "sha256:aed8166c18b1a169a5d3ec28a49b43340949e400665555b51ee06f22813ef062"},
1069
- {file = "ruff-0.4.5-py3-none-win_amd64.whl", hash = "sha256:b0b03c619d2b4350b4a27e34fd2ac64d0dabe1afbf43de57d0f9d8a05ecffa45"},
1070
- {file = "ruff-0.4.5-py3-none-win_arm64.whl", hash = "sha256:9d15de3425f53161b3f5a5658d4522e4eee5ea002bf2ac7aa380743dd9ad5fba"},
1071
- {file = "ruff-0.4.5.tar.gz", hash = "sha256:286eabd47e7d4d521d199cab84deca135557e6d1e0f0d01c29e757c3cb151b54"},
1072
  ]
1073
 
1074
  [[package]]
@@ -1285,7 +1301,7 @@ files = [
1285
 
1286
  [[package]]
1287
  name = "ultralytics"
1288
- version = "8.2.22"
1289
  requires_python = ">=3.8"
1290
  summary = "Ultralytics YOLOv8 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification."
1291
  groups = ["default"]
@@ -1306,8 +1322,8 @@ dependencies = [
1306
  "tqdm>=4.64.0",
1307
  ]
1308
  files = [
1309
- {file = "ultralytics-8.2.22-py3-none-any.whl", hash = "sha256:5e1eafb9126855216c05749502a7e733c7c678d76d1c07a610c963f3a6dd3b96"},
1310
- {file = "ultralytics-8.2.22.tar.gz", hash = "sha256:1c1887a041d7d4a41d6f7e02913012f8e412972b06184d3a8b1712c457e1fedb"},
1311
  ]
1312
 
1313
  [[package]]
 
5
  groups = ["default", "dev"]
6
  strategy = ["cross_platform", "inherit_metadata"]
7
  lock_version = "4.4.1"
8
+ content_hash = "sha256:659b132ba542d46c3673238a3cd96727a02f50d2d594d7ac63290ea66ee23092"
9
 
10
  [[package]]
11
  name = "certifi"
 
746
  {file = "onnxsim-0.4.36.tar.gz", hash = "sha256:6e0ee9d6d4a83042bdef7319fbe58352d9fda5f253386be2b267c7c27f0638ee"},
747
  ]
748
 
749
+ [[package]]
750
+ name = "onnxslim"
751
+ version = "0.1.28"
752
+ requires_python = ">=3.6"
753
+ summary = "OnnxSlim: A Toolkit to Help Optimize Large Onnx Model"
754
+ groups = ["default"]
755
+ dependencies = [
756
+ "onnx",
757
+ "packaging",
758
+ "sympy",
759
+ ]
760
+ files = [
761
+ {file = "onnxslim-0.1.28-py3-none-any.whl", hash = "sha256:93adbdcd54f1d7591c86e8d0c00e514b712040cf6080bfd7ac6d6b92add89802"},
762
+ {file = "onnxslim-0.1.28.tar.gz", hash = "sha256:590028bee9c8e5e644ada4c6374f86b23db2f2edd4917e929eef36f4c68e2422"},
763
+ ]
764
+
765
  [[package]]
766
  name = "opencv-python"
767
  version = "4.9.0.80"
 
907
 
908
  [[package]]
909
  name = "protobuf"
910
+ version = "4.25.3"
911
  requires_python = ">=3.8"
912
  summary = ""
913
  groups = ["default"]
914
  files = [
915
+ {file = "protobuf-4.25.3-cp310-abi3-win32.whl", hash = "sha256:d4198877797a83cbfe9bffa3803602bbe1625dc30d8a097365dbc762e5790faa"},
916
+ {file = "protobuf-4.25.3-cp310-abi3-win_amd64.whl", hash = "sha256:209ba4cc916bab46f64e56b85b090607a676f66b473e6b762e6f1d9d591eb2e8"},
917
+ {file = "protobuf-4.25.3-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:f1279ab38ecbfae7e456a108c5c0681e4956d5b1090027c1de0f934dfdb4b35c"},
918
+ {file = "protobuf-4.25.3-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:e7cb0ae90dd83727f0c0718634ed56837bfeeee29a5f82a7514c03ee1364c019"},
919
+ {file = "protobuf-4.25.3-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:7c8daa26095f82482307bc717364e7c13f4f1c99659be82890dcfc215194554d"},
920
+ {file = "protobuf-4.25.3-py3-none-any.whl", hash = "sha256:f0700d54bcf45424477e46a9f0944155b46fb0639d69728739c0e47bab83f2b9"},
921
+ {file = "protobuf-4.25.3.tar.gz", hash = "sha256:25b5d0b42fd000320bd7830b349e3b696435f3b329810427a6bcce6a5492cc5c"},
922
  ]
923
 
924
  [[package]]
 
1063
 
1064
  [[package]]
1065
  name = "ruff"
1066
+ version = "0.4.7"
1067
  requires_python = ">=3.7"
1068
  summary = "An extremely fast Python linter and code formatter, written in Rust."
1069
  groups = ["dev"]
1070
  files = [
1071
+ {file = "ruff-0.4.7-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:e089371c67892a73b6bb1525608e89a2aca1b77b5440acf7a71dda5dac958f9e"},
1072
+ {file = "ruff-0.4.7-py3-none-macosx_11_0_arm64.whl", hash = "sha256:10f973d521d910e5f9c72ab27e409e839089f955be8a4c8826601a6323a89753"},
1073
+ {file = "ruff-0.4.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:59c3d110970001dfa494bcd95478e62286c751126dfb15c3c46e7915fc49694f"},
1074
+ {file = "ruff-0.4.7-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa9773c6c00f4958f73b317bc0fd125295110c3776089f6ef318f4b775f0abe4"},
1075
+ {file = "ruff-0.4.7-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:07fc80bbb61e42b3b23b10fda6a2a0f5a067f810180a3760c5ef1b456c21b9db"},
1076
+ {file = "ruff-0.4.7-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:fa4dafe3fe66d90e2e2b63fa1591dd6e3f090ca2128daa0be33db894e6c18648"},
1077
+ {file = "ruff-0.4.7-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a7c0083febdec17571455903b184a10026603a1de078428ba155e7ce9358c5f6"},
1078
+ {file = "ruff-0.4.7-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ad1b20e66a44057c326168437d680a2166c177c939346b19c0d6b08a62a37589"},
1079
+ {file = "ruff-0.4.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cbf5d818553add7511c38b05532d94a407f499d1a76ebb0cad0374e32bc67202"},
1080
+ {file = "ruff-0.4.7-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:50e9651578b629baec3d1513b2534de0ac7ed7753e1382272b8d609997e27e83"},
1081
+ {file = "ruff-0.4.7-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:8874a9df7766cb956b218a0a239e0a5d23d9e843e4da1e113ae1d27ee420877a"},
1082
+ {file = "ruff-0.4.7-py3-none-musllinux_1_2_i686.whl", hash = "sha256:b9de9a6e49f7d529decd09381c0860c3f82fa0b0ea00ea78409b785d2308a567"},
1083
+ {file = "ruff-0.4.7-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:13a1768b0691619822ae6d446132dbdfd568b700ecd3652b20d4e8bc1e498f78"},
1084
+ {file = "ruff-0.4.7-py3-none-win32.whl", hash = "sha256:769e5a51df61e07e887b81e6f039e7ed3573316ab7dd9f635c5afaa310e4030e"},
1085
+ {file = "ruff-0.4.7-py3-none-win_amd64.whl", hash = "sha256:9e3ab684ad403a9ed1226894c32c3ab9c2e0718440f6f50c7c5829932bc9e054"},
1086
+ {file = "ruff-0.4.7-py3-none-win_arm64.whl", hash = "sha256:10f2204b9a613988e3484194c2c9e96a22079206b22b787605c255f130db5ed7"},
1087
+ {file = "ruff-0.4.7.tar.gz", hash = "sha256:2331d2b051dc77a289a653fcc6a42cce357087c5975738157cd966590b18b5e1"},
1088
  ]
1089
 
1090
  [[package]]
 
1301
 
1302
  [[package]]
1303
  name = "ultralytics"
1304
+ version = "8.2.27"
1305
  requires_python = ">=3.8"
1306
  summary = "Ultralytics YOLOv8 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification."
1307
  groups = ["default"]
 
1322
  "tqdm>=4.64.0",
1323
  ]
1324
  files = [
1325
+ {file = "ultralytics-8.2.27-py3-none-any.whl", hash = "sha256:bd00d487fc68360667a906292ccf21ba1b7022604c3ac5c74369b808bcdfec87"},
1326
+ {file = "ultralytics-8.2.27.tar.gz", hash = "sha256:70cc1ce7af33a53d2f0f449ba709a0fd28edb5f2571b69f47d6fa05def458194"},
1327
  ]
1328
 
1329
  [[package]]
pyproject.toml CHANGED
@@ -9,6 +9,7 @@ dependencies = [
9
  "onnx",
10
  "onnxruntime",
11
  "onnxsim",
 
12
  ]
13
  requires-python = ">=3.11"
14
  readme = "README.md"
 
9
  "onnx",
10
  "onnxruntime",
11
  "onnxsim",
12
+ "onnxslim",
13
  ]
14
  requires-python = ">=3.11"
15
  readme = "README.md"