Upload folder using huggingface_hub
Browse files- miner.py +5 -5
- weights.onnx +2 -2
miner.py
CHANGED
|
@@ -34,7 +34,7 @@ class Miner:
|
|
| 34 |
# (ships inside weights.onnx), so a retrained model with a different class
|
| 35 |
# order is remapped correctly without code changes. This static list is used
|
| 36 |
# only when that metadata is missing or unparsable.
|
| 37 |
-
model_class_names = ["balaclava", "
|
| 38 |
|
| 39 |
input_size = 1280
|
| 40 |
|
|
@@ -50,13 +50,14 @@ class Miner:
|
|
| 50 |
max_det = 150
|
| 51 |
|
| 52 |
_conf_thres_array = np.array(
|
| 53 |
-
[0.
|
| 54 |
)
|
| 55 |
_bonus_array = np.array(
|
| 56 |
-
[0.
|
| 57 |
)
|
| 58 |
-
|
| 59 |
def __init__(self, path_hf_repo: Path) -> None:
|
|
|
|
| 60 |
model_path = path_hf_repo / "weights.onnx"
|
| 61 |
print("ORT version:", ort.__version__)
|
| 62 |
|
|
@@ -141,7 +142,6 @@ class Miner:
|
|
| 141 |
|
| 142 |
def _read_model_class_order(self) -> "list[str] | None":
|
| 143 |
"""Read the model's class order from Ultralytics ONNX metadata.
|
| 144 |
-
|
| 145 |
Returns the class names ordered by model-emit index, or None when the
|
| 146 |
metadata is missing/unparsable or doesn't match `class_names` as a set
|
| 147 |
(in which case the static model_class_names fallback is used)."""
|
|
|
|
| 34 |
# (ships inside weights.onnx), so a retrained model with a different class
|
| 35 |
# order is remapped correctly without code changes. This static list is used
|
| 36 |
# only when that metadata is missing or unparsable.
|
| 37 |
+
model_class_names = ["balaclava", "bat", "glove", "graffiti", "hoodie", "spray paint"]
|
| 38 |
|
| 39 |
input_size = 1280
|
| 40 |
|
|
|
|
| 50 |
max_det = 150
|
| 51 |
|
| 52 |
_conf_thres_array = np.array(
|
| 53 |
+
[0.38, 0.42, 0.22, 0.12, 0.33, 0.20], dtype=np.float32,
|
| 54 |
)
|
| 55 |
_bonus_array = np.array(
|
| 56 |
+
[0.2, 0.25, 0.12, 0.09, 0.21, 0.06], dtype=np.float32,
|
| 57 |
)
|
| 58 |
+
|
| 59 |
def __init__(self, path_hf_repo: Path) -> None:
|
| 60 |
+
# model_path = path_hf_repo / "weights-all.onnx"
|
| 61 |
model_path = path_hf_repo / "weights.onnx"
|
| 62 |
print("ORT version:", ort.__version__)
|
| 63 |
|
|
|
|
| 142 |
|
| 143 |
def _read_model_class_order(self) -> "list[str] | None":
|
| 144 |
"""Read the model's class order from Ultralytics ONNX metadata.
|
|
|
|
| 145 |
Returns the class names ordered by model-emit index, or None when the
|
| 146 |
metadata is missing/unparsable or doesn't match `class_names` as a set
|
| 147 |
(in which case the static model_class_names fallback is used)."""
|
weights.onnx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a9705e464e581151416bd2dffc5b4dc7ff1cc4f3b899fee82aeb692a004a9e2e
|
| 3 |
+
size 9809235
|