Spaces:
Sleeping
Sleeping
bascobasculino
commited on
Commit
•
e9e38c2
1
Parent(s):
04c098b
- my_metricv2.py +10 -11
- requirements.txt +1 -2
- tests.py +9 -9
my_metricv2.py
CHANGED
@@ -11,23 +11,26 @@
|
|
11 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 |
# See the License for the specific language governing permissions and
|
13 |
# limitations under the License.
|
14 |
-
"""TODO: Add a description here."""
|
15 |
|
16 |
import evaluate
|
17 |
import datasets
|
18 |
import motmetrics as mm
|
19 |
import numpy as np
|
20 |
|
21 |
-
# TODO: Add BibTeX citation
|
22 |
_CITATION = """\
|
23 |
@InProceedings{huggingface:module,
|
24 |
title = {A great new module},
|
25 |
authors={huggingface, Inc.},
|
26 |
year={2020}
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
}
|
28 |
"""
|
29 |
|
30 |
-
# TODO: Add description of the module here
|
31 |
_DESCRIPTION = """\
|
32 |
The MOT Metrics module is designed to evaluate multi-object tracking (MOT)
|
33 |
algorithms by computing various metrics based on predicted and ground truth bounding
|
@@ -35,7 +38,6 @@ boxes. It serves as a crucial tool in assessing the performance of MOT systems,
|
|
35 |
aiding in the iterative improvement of tracking algorithms."""
|
36 |
|
37 |
|
38 |
-
# TODO: Add description of the arguments of the module here
|
39 |
_KWARGS_DESCRIPTION = """
|
40 |
|
41 |
Calculates how good are predictions given some references, using certain scores
|
@@ -101,11 +103,10 @@ Examples:
|
|
101 |
|
102 |
>>> results = module._compute(predictions=predicted, references=ground_truth, max_iou=0.5)
|
103 |
>>> print(results)
|
104 |
-
{'idf1':
|
105 |
-
'
|
106 |
-
'
|
107 |
-
'
|
108 |
-
'num_transfer': {0: 0}, 'num_ascend': {0: 0}, 'num_migrate': {0: 0}}
|
109 |
"""
|
110 |
|
111 |
|
@@ -130,8 +131,6 @@ class MyMetricv2(evaluate.Metric):
|
|
130 |
datasets.Sequence(datasets.Value("float"))
|
131 |
)
|
132 |
}),
|
133 |
-
# Homepage of the module for documentation
|
134 |
-
homepage="http://module.homepage",
|
135 |
# Additional links to the codebase or references
|
136 |
codebase_urls=["http://github.com/path/to/codebase/of/new_module"],
|
137 |
reference_urls=["http://path.to.reference.url/new_module"]
|
|
|
11 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 |
# See the License for the specific language governing permissions and
|
13 |
# limitations under the License.
|
|
|
14 |
|
15 |
import evaluate
|
16 |
import datasets
|
17 |
import motmetrics as mm
|
18 |
import numpy as np
|
19 |
|
|
|
20 |
_CITATION = """\
|
21 |
@InProceedings{huggingface:module,
|
22 |
title = {A great new module},
|
23 |
authors={huggingface, Inc.},
|
24 |
year={2020}
|
25 |
+
}\
|
26 |
+
@article{milan2016mot16,
|
27 |
+
title={MOT16: A benchmark for multi-object tracking},
|
28 |
+
author={Milan, Anton and Leal-Taix{\'e}, Laura and Reid, Ian and Roth, Stefan and Schindler, Konrad},
|
29 |
+
journal={arXiv preprint arXiv:1603.00831},
|
30 |
+
year={2016}
|
31 |
}
|
32 |
"""
|
33 |
|
|
|
34 |
_DESCRIPTION = """\
|
35 |
The MOT Metrics module is designed to evaluate multi-object tracking (MOT)
|
36 |
algorithms by computing various metrics based on predicted and ground truth bounding
|
|
|
38 |
aiding in the iterative improvement of tracking algorithms."""
|
39 |
|
40 |
|
|
|
41 |
_KWARGS_DESCRIPTION = """
|
42 |
|
43 |
Calculates how good are predictions given some references, using certain scores
|
|
|
103 |
|
104 |
>>> results = module._compute(predictions=predicted, references=ground_truth, max_iou=0.5)
|
105 |
>>> print(results)
|
106 |
+
{'idf1': 0.8421052631578947, 'idp': 0.8888888888888888, 'idr': 0.8, 'recall': 0.8, 'precision': 0.8888888888888888,
|
107 |
+
'num_unique_objects': 3,'mostly_tracked': 2, 'partially_tracked': 1, 'mostly_lost': 0, 'num_false_positives': 1,
|
108 |
+
'num_misses': 2, 'num_switches': 0, 'num_fragmentations': 0, 'mota': 0.7, 'motp': 0.02981870229007634,
|
109 |
+
'num_transfer': 0, 'num_ascend': 0, 'num_migrate': 0}
|
|
|
110 |
"""
|
111 |
|
112 |
|
|
|
131 |
datasets.Sequence(datasets.Value("float"))
|
132 |
)
|
133 |
}),
|
|
|
|
|
134 |
# Additional links to the codebase or references
|
135 |
codebase_urls=["http://github.com/path/to/codebase/of/new_module"],
|
136 |
reference_urls=["http://path.to.reference.url/new_module"]
|
requirements.txt
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
git+https://github.com/huggingface/evaluate@main
|
2 |
numpy
|
3 |
-
motmetrics
|
4 |
-
scikit-learn
|
|
|
1 |
git+https://github.com/huggingface/evaluate@main
|
2 |
numpy
|
3 |
+
motmetrics
|
|
tests.py
CHANGED
@@ -24,14 +24,14 @@ test_cases = [
|
|
24 |
[5, 1, 30, 40, 50, 60],
|
25 |
[5, 2, 70, 80, 90, 100]
|
26 |
]],
|
27 |
-
"result": {'idf1':
|
28 |
-
'idr':
|
29 |
-
'num_unique_objects':
|
30 |
-
'partially_tracked':
|
31 |
-
'num_false_positives':
|
32 |
-
'num_switches':
|
33 |
-
'mota':
|
34 |
-
'num_transfer':
|
35 |
-
'num_migrate':
|
36 |
},
|
37 |
]
|
|
|
24 |
[5, 1, 30, 40, 50, 60],
|
25 |
[5, 2, 70, 80, 90, 100]
|
26 |
]],
|
27 |
+
"result": {'idf1': 0.8421052631578947, 'idp': 0.8888888888888888,
|
28 |
+
'idr': 0.8, 'recall': 0.8, 'precision': 0.8888888888888888,
|
29 |
+
'num_unique_objects': 3,'mostly_tracked': 2,
|
30 |
+
'partially_tracked': 1, 'mostly_lost': 0,
|
31 |
+
'num_false_positives': 1, 'num_misses': 2,
|
32 |
+
'num_switches': 0, 'num_fragmentations': 0,
|
33 |
+
'mota': 0.7, 'motp': 0.02981870229007634,
|
34 |
+
'num_transfer': 0, 'num_ascend': 0,
|
35 |
+
'num_migrate': 0}
|
36 |
},
|
37 |
]
|