subnet_bridge: copy winning miner repo into library
Browse files- README.md +1 -8
- benchmark/synthetic/f2b3a0a0-3c7a-40c2-82e7-86005ced7e92.json +0 -147
- benchmark/synthetic/index.json +0 -16
- benchmark/synthetic/latest.json +0 -147
- main.py +17 -53
- pyproject.toml +1 -1
README.md
CHANGED
|
@@ -4,19 +4,12 @@ tags:
|
|
| 4 |
- model:ultralytics-yolo
|
| 5 |
- subnet:winner
|
| 6 |
- object:person
|
|
|
|
| 7 |
manako:
|
| 8 |
source: winner_fetch
|
| 9 |
manifest_element_name: manak0/Detect-Person
|
| 10 |
winner_repo_id: beketov027/ScoreVision2
|
| 11 |
winner_revision: a45e30524d27706f624880d0910246d9c63f21c1
|
| 12 |
-
score:
|
| 13 |
-
size_mb: 9.850342
|
| 14 |
-
performance_map50: 0.7215138820273345
|
| 15 |
-
E: 0.07324759709128216
|
| 16 |
-
last_benchmark:
|
| 17 |
-
type: synthetic_fixed
|
| 18 |
-
ran_at: '2026-10-19T16:31:25.140691Z'
|
| 19 |
-
result_path: benchmark/synthetic/f2b3a0a0-3c7a-40c2-82e7-86005ced7e92.json
|
| 20 |
---
|
| 21 |
|
| 22 |
# Detect-Person-winner
|
|
|
|
| 4 |
- model:ultralytics-yolo
|
| 5 |
- subnet:winner
|
| 6 |
- object:person
|
| 7 |
+
|
| 8 |
manako:
|
| 9 |
source: winner_fetch
|
| 10 |
manifest_element_name: manak0/Detect-Person
|
| 11 |
winner_repo_id: beketov027/ScoreVision2
|
| 12 |
winner_revision: a45e30524d27706f624880d0910246d9c63f21c1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
---
|
| 14 |
|
| 15 |
# Detect-Person-winner
|
benchmark/synthetic/f2b3a0a0-3c7a-40c2-82e7-86005ced7e92.json
DELETED
|
@@ -1,147 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"meta": {
|
| 3 |
-
"element_id": "manako/Detect-Person-winner",
|
| 4 |
-
"run_id": "f2b3a0a0-3c7a-40c2-82e7-86005ced7e92",
|
| 5 |
-
"benchmark_type": "synthetic_fixed",
|
| 6 |
-
"saved_at": "2026-10-19T16:31:25.140691Z",
|
| 7 |
-
"result_path": "benchmark/synthetic/f2b3a0a0-3c7a-40c2-82e7-86005ced7e92.json",
|
| 8 |
-
"split_ref": "private_final"
|
| 9 |
-
},
|
| 10 |
-
"results": {
|
| 11 |
-
"overall_iou": 0.8069316190218553,
|
| 12 |
-
"per_class_iou": {
|
| 13 |
-
"person": 0.8069316190218553
|
| 14 |
-
},
|
| 15 |
-
"map_50": 0.7215138820273345,
|
| 16 |
-
"map_50_90": 0.6054387100686015,
|
| 17 |
-
"precision": 0.9402942024805307,
|
| 18 |
-
"recall": 0.7314336997980705,
|
| 19 |
-
"per_class_map_50": {
|
| 20 |
-
"person": 0.7215138820273345
|
| 21 |
-
},
|
| 22 |
-
"per_class_map_50_90": {
|
| 23 |
-
"person": 0.6054387100686015
|
| 24 |
-
},
|
| 25 |
-
"per_class_precision": {
|
| 26 |
-
"person": 0.9402942024805307
|
| 27 |
-
},
|
| 28 |
-
"per_class_recall": {
|
| 29 |
-
"person": 0.7314336997980705
|
| 30 |
-
},
|
| 31 |
-
"adaptive_map_50": 0.7286559727737668,
|
| 32 |
-
"ffpi": 1.945054945054945,
|
| 33 |
-
"false_positive_score": 0.8054945054945055,
|
| 34 |
-
"foundry_score": 0.7593913858620623,
|
| 35 |
-
"composite_score": 0.7593913858620623,
|
| 36 |
-
"scoring_policy": "subnet-style-composite-v1",
|
| 37 |
-
"matched_images": 91,
|
| 38 |
-
"gt_count": 4457,
|
| 39 |
-
"pred_count": 3467,
|
| 40 |
-
"classes": [
|
| 41 |
-
"person"
|
| 42 |
-
],
|
| 43 |
-
"evaluated_element_revision": null,
|
| 44 |
-
"dataset_id": "bdf4d5b4-7dec-4b72-8747-ab005ca92b3b",
|
| 45 |
-
"dataset_version_id": "f2b3a0a0-3c7a-40c2-82e7-86005ced7e92",
|
| 46 |
-
"run_id": "f2b3a0a0-3c7a-40c2-82e7-86005ced7e92",
|
| 47 |
-
"split_ref": "private_final",
|
| 48 |
-
"selected_frame_count": 91,
|
| 49 |
-
"selected_frame_indices": [
|
| 50 |
-
5,
|
| 51 |
-
11,
|
| 52 |
-
16,
|
| 53 |
-
20,
|
| 54 |
-
24,
|
| 55 |
-
26,
|
| 56 |
-
28,
|
| 57 |
-
32,
|
| 58 |
-
41,
|
| 59 |
-
49,
|
| 60 |
-
55,
|
| 61 |
-
59,
|
| 62 |
-
63,
|
| 63 |
-
67,
|
| 64 |
-
70,
|
| 65 |
-
73,
|
| 66 |
-
79,
|
| 67 |
-
80,
|
| 68 |
-
81,
|
| 69 |
-
84,
|
| 70 |
-
86,
|
| 71 |
-
95,
|
| 72 |
-
103,
|
| 73 |
-
104,
|
| 74 |
-
110,
|
| 75 |
-
116,
|
| 76 |
-
118,
|
| 77 |
-
120,
|
| 78 |
-
121,
|
| 79 |
-
129,
|
| 80 |
-
130,
|
| 81 |
-
138,
|
| 82 |
-
139,
|
| 83 |
-
146,
|
| 84 |
-
151,
|
| 85 |
-
156,
|
| 86 |
-
173,
|
| 87 |
-
175,
|
| 88 |
-
183,
|
| 89 |
-
184,
|
| 90 |
-
185,
|
| 91 |
-
187,
|
| 92 |
-
193,
|
| 93 |
-
197,
|
| 94 |
-
200,
|
| 95 |
-
201,
|
| 96 |
-
205,
|
| 97 |
-
206,
|
| 98 |
-
218,
|
| 99 |
-
222,
|
| 100 |
-
223,
|
| 101 |
-
226,
|
| 102 |
-
227,
|
| 103 |
-
234,
|
| 104 |
-
235,
|
| 105 |
-
241,
|
| 106 |
-
242,
|
| 107 |
-
244,
|
| 108 |
-
247,
|
| 109 |
-
249,
|
| 110 |
-
250,
|
| 111 |
-
251,
|
| 112 |
-
257,
|
| 113 |
-
259,
|
| 114 |
-
262,
|
| 115 |
-
266,
|
| 116 |
-
267,
|
| 117 |
-
282,
|
| 118 |
-
296,
|
| 119 |
-
302,
|
| 120 |
-
307,
|
| 121 |
-
314,
|
| 122 |
-
315,
|
| 123 |
-
331,
|
| 124 |
-
333,
|
| 125 |
-
341,
|
| 126 |
-
345,
|
| 127 |
-
346,
|
| 128 |
-
354,
|
| 129 |
-
357,
|
| 130 |
-
361,
|
| 131 |
-
363,
|
| 132 |
-
364,
|
| 133 |
-
367,
|
| 134 |
-
370,
|
| 135 |
-
374,
|
| 136 |
-
377,
|
| 137 |
-
382,
|
| 138 |
-
383,
|
| 139 |
-
387,
|
| 140 |
-
399
|
| 141 |
-
],
|
| 142 |
-
"evaluated_version_ids": [
|
| 143 |
-
"f2b3a0a0-3c7a-40c2-82e7-86005ced7e92"
|
| 144 |
-
],
|
| 145 |
-
"skipped_missing_pairs": 0
|
| 146 |
-
}
|
| 147 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
benchmark/synthetic/index.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
| 1 |
-
[
|
| 2 |
-
{
|
| 3 |
-
"run_id": "f2b3a0a0-3c7a-40c2-82e7-86005ced7e92",
|
| 4 |
-
"saved_at": "2026-10-19T16:31:25.140691Z",
|
| 5 |
-
"result_path": "benchmark/synthetic/f2b3a0a0-3c7a-40c2-82e7-86005ced7e92.json",
|
| 6 |
-
"overall_iou": 0.8069316190218553,
|
| 7 |
-
"map_50": 0.7215138820273345,
|
| 8 |
-
"map_50_90": 0.6054387100686015,
|
| 9 |
-
"precision": 0.9402942024805307,
|
| 10 |
-
"recall": 0.7314336997980705,
|
| 11 |
-
"matched_images": 91,
|
| 12 |
-
"gt_count": 4457,
|
| 13 |
-
"pred_count": 3467,
|
| 14 |
-
"split_ref": "private_final"
|
| 15 |
-
}
|
| 16 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
benchmark/synthetic/latest.json
DELETED
|
@@ -1,147 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"meta": {
|
| 3 |
-
"element_id": "manako/Detect-Person-winner",
|
| 4 |
-
"run_id": "f2b3a0a0-3c7a-40c2-82e7-86005ced7e92",
|
| 5 |
-
"benchmark_type": "synthetic_fixed",
|
| 6 |
-
"saved_at": "2026-10-19T16:31:25.140691Z",
|
| 7 |
-
"result_path": "benchmark/synthetic/f2b3a0a0-3c7a-40c2-82e7-86005ced7e92.json",
|
| 8 |
-
"split_ref": "private_final"
|
| 9 |
-
},
|
| 10 |
-
"results": {
|
| 11 |
-
"overall_iou": 0.8069316190218553,
|
| 12 |
-
"per_class_iou": {
|
| 13 |
-
"person": 0.8069316190218553
|
| 14 |
-
},
|
| 15 |
-
"map_50": 0.7215138820273345,
|
| 16 |
-
"map_50_90": 0.6054387100686015,
|
| 17 |
-
"precision": 0.9402942024805307,
|
| 18 |
-
"recall": 0.7314336997980705,
|
| 19 |
-
"per_class_map_50": {
|
| 20 |
-
"person": 0.7215138820273345
|
| 21 |
-
},
|
| 22 |
-
"per_class_map_50_90": {
|
| 23 |
-
"person": 0.6054387100686015
|
| 24 |
-
},
|
| 25 |
-
"per_class_precision": {
|
| 26 |
-
"person": 0.9402942024805307
|
| 27 |
-
},
|
| 28 |
-
"per_class_recall": {
|
| 29 |
-
"person": 0.7314336997980705
|
| 30 |
-
},
|
| 31 |
-
"adaptive_map_50": 0.7286559727737668,
|
| 32 |
-
"ffpi": 1.945054945054945,
|
| 33 |
-
"false_positive_score": 0.8054945054945055,
|
| 34 |
-
"foundry_score": 0.7593913858620623,
|
| 35 |
-
"composite_score": 0.7593913858620623,
|
| 36 |
-
"scoring_policy": "subnet-style-composite-v1",
|
| 37 |
-
"matched_images": 91,
|
| 38 |
-
"gt_count": 4457,
|
| 39 |
-
"pred_count": 3467,
|
| 40 |
-
"classes": [
|
| 41 |
-
"person"
|
| 42 |
-
],
|
| 43 |
-
"evaluated_element_revision": null,
|
| 44 |
-
"dataset_id": "bdf4d5b4-7dec-4b72-8747-ab005ca92b3b",
|
| 45 |
-
"dataset_version_id": "f2b3a0a0-3c7a-40c2-82e7-86005ced7e92",
|
| 46 |
-
"run_id": "f2b3a0a0-3c7a-40c2-82e7-86005ced7e92",
|
| 47 |
-
"split_ref": "private_final",
|
| 48 |
-
"selected_frame_count": 91,
|
| 49 |
-
"selected_frame_indices": [
|
| 50 |
-
5,
|
| 51 |
-
11,
|
| 52 |
-
16,
|
| 53 |
-
20,
|
| 54 |
-
24,
|
| 55 |
-
26,
|
| 56 |
-
28,
|
| 57 |
-
32,
|
| 58 |
-
41,
|
| 59 |
-
49,
|
| 60 |
-
55,
|
| 61 |
-
59,
|
| 62 |
-
63,
|
| 63 |
-
67,
|
| 64 |
-
70,
|
| 65 |
-
73,
|
| 66 |
-
79,
|
| 67 |
-
80,
|
| 68 |
-
81,
|
| 69 |
-
84,
|
| 70 |
-
86,
|
| 71 |
-
95,
|
| 72 |
-
103,
|
| 73 |
-
104,
|
| 74 |
-
110,
|
| 75 |
-
116,
|
| 76 |
-
118,
|
| 77 |
-
120,
|
| 78 |
-
121,
|
| 79 |
-
129,
|
| 80 |
-
130,
|
| 81 |
-
138,
|
| 82 |
-
139,
|
| 83 |
-
146,
|
| 84 |
-
151,
|
| 85 |
-
156,
|
| 86 |
-
173,
|
| 87 |
-
175,
|
| 88 |
-
183,
|
| 89 |
-
184,
|
| 90 |
-
185,
|
| 91 |
-
187,
|
| 92 |
-
193,
|
| 93 |
-
197,
|
| 94 |
-
200,
|
| 95 |
-
201,
|
| 96 |
-
205,
|
| 97 |
-
206,
|
| 98 |
-
218,
|
| 99 |
-
222,
|
| 100 |
-
223,
|
| 101 |
-
226,
|
| 102 |
-
227,
|
| 103 |
-
234,
|
| 104 |
-
235,
|
| 105 |
-
241,
|
| 106 |
-
242,
|
| 107 |
-
244,
|
| 108 |
-
247,
|
| 109 |
-
249,
|
| 110 |
-
250,
|
| 111 |
-
251,
|
| 112 |
-
257,
|
| 113 |
-
259,
|
| 114 |
-
262,
|
| 115 |
-
266,
|
| 116 |
-
267,
|
| 117 |
-
282,
|
| 118 |
-
296,
|
| 119 |
-
302,
|
| 120 |
-
307,
|
| 121 |
-
314,
|
| 122 |
-
315,
|
| 123 |
-
331,
|
| 124 |
-
333,
|
| 125 |
-
341,
|
| 126 |
-
345,
|
| 127 |
-
346,
|
| 128 |
-
354,
|
| 129 |
-
357,
|
| 130 |
-
361,
|
| 131 |
-
363,
|
| 132 |
-
364,
|
| 133 |
-
367,
|
| 134 |
-
370,
|
| 135 |
-
374,
|
| 136 |
-
377,
|
| 137 |
-
382,
|
| 138 |
-
383,
|
| 139 |
-
387,
|
| 140 |
-
399
|
| 141 |
-
],
|
| 142 |
-
"evaluated_version_ids": [
|
| 143 |
-
"f2b3a0a0-3c7a-40c2-82e7-86005ced7e92"
|
| 144 |
-
],
|
| 145 |
-
"skipped_missing_pairs": 0
|
| 146 |
-
}
|
| 147 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
main.py
CHANGED
|
@@ -146,32 +146,16 @@ def _to_detection(box: Any, class_names: list[str]) -> dict[str, Any]:
|
|
| 146 |
return detection
|
| 147 |
|
| 148 |
|
| 149 |
-
def
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
return image
|
| 160 |
-
if hasattr(image, "convert") and callable(image.convert):
|
| 161 |
-
try:
|
| 162 |
-
rgb = image.convert("RGB")
|
| 163 |
-
array = np.array(rgb)
|
| 164 |
-
if getattr(array, "ndim", 0) == 3 and array.shape[-1] == 3:
|
| 165 |
-
return cv2.cvtColor(array, cv2.COLOR_RGB2BGR)
|
| 166 |
-
return array
|
| 167 |
-
except Exception:
|
| 168 |
-
return image
|
| 169 |
-
try:
|
| 170 |
-
array = np.asarray(image)
|
| 171 |
-
if getattr(array, "shape", None):
|
| 172 |
-
return array
|
| 173 |
-
except Exception:
|
| 174 |
-
return image
|
| 175 |
return image
|
| 176 |
|
| 177 |
|
|
@@ -187,34 +171,14 @@ def load_model(onnx_path: str | None = None, data_dir: str | None = None):
|
|
| 187 |
}
|
| 188 |
|
| 189 |
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
value = getattr(miner, attr, None)
|
| 194 |
-
if isinstance(value, int) and value > 0:
|
| 195 |
-
counts.append(value)
|
| 196 |
-
counts.append(32)
|
| 197 |
-
|
| 198 |
-
seen: set[int] = set()
|
| 199 |
-
ordered: list[int] = []
|
| 200 |
-
for count in counts:
|
| 201 |
-
if count in seen:
|
| 202 |
-
continue
|
| 203 |
-
seen.add(count)
|
| 204 |
-
ordered.append(count)
|
| 205 |
-
return ordered
|
| 206 |
|
| 207 |
|
| 208 |
-
def
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
for n_keypoints in _candidate_keypoint_counts(miner):
|
| 212 |
-
try:
|
| 213 |
-
return miner.predict_batch([normalized_image], offset=0, n_keypoints=n_keypoints)
|
| 214 |
-
except Exception as exc:
|
| 215 |
-
errors.append(f"n_keypoints={n_keypoints} -> {exc}")
|
| 216 |
-
continue
|
| 217 |
-
raise RuntimeError("predict_batch failed for all keypoint candidates: " + " | ".join(errors))
|
| 218 |
|
| 219 |
|
| 220 |
def run_model(model: Any, image: Any = None, onnx_path: str | None = None, data_dir: str | None = None):
|
|
@@ -226,7 +190,7 @@ def run_model(model: Any, image: Any = None, onnx_path: str | None = None, data_
|
|
| 226 |
class_names = model.get("class_names")
|
| 227 |
if not isinstance(class_names, list):
|
| 228 |
class_names = list(CLASS_NAMES)
|
| 229 |
-
results =
|
| 230 |
if not results:
|
| 231 |
return [[]]
|
| 232 |
frame_boxes = _extract_boxes(results[0])
|
|
|
|
| 146 |
return detection
|
| 147 |
|
| 148 |
|
| 149 |
+
def _require_bgr_frame(image: Any) -> Any:
|
| 150 |
+
# Same frame the turbovision validator hands predict_batch: cv2.imdecode(...,
|
| 151 |
+
# IMREAD_COLOR) -> BGR uint8 HWC with 3 channels. Anything else is a harness
|
| 152 |
+
# bug and must fail loudly rather than be coerced.
|
| 153 |
+
if not isinstance(image, np.ndarray):
|
| 154 |
+
raise TypeError(f"frame must be a numpy.ndarray (BGR uint8 HWC), got {type(image).__name__}")
|
| 155 |
+
if image.dtype != np.uint8:
|
| 156 |
+
raise TypeError(f"frame dtype must be uint8, got {image.dtype}")
|
| 157 |
+
if image.ndim != 3 or image.shape[2] != 3:
|
| 158 |
+
raise TypeError(f"frame must be HWC with 3 channels (BGR), got shape {image.shape}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
return image
|
| 160 |
|
| 161 |
|
|
|
|
| 171 |
}
|
| 172 |
|
| 173 |
|
| 174 |
+
# Validator chute: predict_batch(batch_images=..., offset=0, n_keypoints=32)
|
| 175 |
+
# (turbovision chute_template :376-380; scorevision/utils/challenges.py:412).
|
| 176 |
+
VALIDATOR_N_KEYPOINTS = 32
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
|
| 178 |
|
| 179 |
+
def _predict_frame(miner: Any, image: Any) -> list[Any]:
|
| 180 |
+
frame = _require_bgr_frame(image)
|
| 181 |
+
return miner.predict_batch(batch_images=[frame], offset=0, n_keypoints=VALIDATOR_N_KEYPOINTS)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
|
| 183 |
|
| 184 |
def run_model(model: Any, image: Any = None, onnx_path: str | None = None, data_dir: str | None = None):
|
|
|
|
| 190 |
class_names = model.get("class_names")
|
| 191 |
if not isinstance(class_names, list):
|
| 192 |
class_names = list(CLASS_NAMES)
|
| 193 |
+
results = _predict_frame(miner, image)
|
| 194 |
if not results:
|
| 195 |
return [[]]
|
| 196 |
frame_boxes = _extract_boxes(results[0])
|
pyproject.toml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
[project]
|
| 2 |
name = "miner-element-adapter"
|
| 3 |
version = "0.1.0"
|
| 4 |
-
requires-python = ">=3.
|
| 5 |
|
| 6 |
dependencies = [
|
| 7 |
"numpy>=1.23",
|
|
|
|
| 1 |
[project]
|
| 2 |
name = "miner-element-adapter"
|
| 3 |
version = "0.1.0"
|
| 4 |
+
requires-python = ">=3.12"
|
| 5 |
|
| 6 |
dependencies = [
|
| 7 |
"numpy>=1.23",
|