Spaces:
Sleeping
Sleeping
bascobasculino
commited on
Commit
•
fad4683
1
Parent(s):
0b001c5
- my_metricv2.py +12 -5
my_metricv2.py
CHANGED
@@ -72,8 +72,12 @@ class MyMetricv2(evaluate.Metric):
|
|
72 |
inputs_description=_KWARGS_DESCRIPTION,
|
73 |
# This defines the format of each prediction and reference
|
74 |
features=datasets.Features({
|
75 |
-
|
76 |
-
|
|
|
|
|
|
|
|
|
77 |
}),
|
78 |
# Homepage of the module for documentation
|
79 |
homepage="http://module.homepage",
|
@@ -94,10 +98,13 @@ class MyMetricv2(evaluate.Metric):
|
|
94 |
# <frame number>, <object id>, <bb_left>, <bb_top>, <bb_width>, <bb_height>, <confidence>, <x>, <y>, <z>
|
95 |
# predictions array de formato []
|
96 |
|
97 |
-
|
98 |
-
|
99 |
|
100 |
return {
|
101 |
-
|
|
|
|
|
|
|
102 |
}
|
103 |
|
|
|
72 |
inputs_description=_KWARGS_DESCRIPTION,
|
73 |
# This defines the format of each prediction and reference
|
74 |
features=datasets.Features({
|
75 |
+
"predictions": [
|
76 |
+
datasets.Sequence(datasets.Value("float32")),
|
77 |
+
],
|
78 |
+
"references": [
|
79 |
+
datasets.Sequence(datasets.Value("float32")),
|
80 |
+
],
|
81 |
}),
|
82 |
# Homepage of the module for documentation
|
83 |
homepage="http://module.homepage",
|
|
|
98 |
# <frame number>, <object id>, <bb_left>, <bb_top>, <bb_width>, <bb_height>, <confidence>, <x>, <y>, <z>
|
99 |
# predictions array de formato []
|
100 |
|
101 |
+
# accuracy = sum(i == j for i, j in zip(predictions, references)) / len(predictions)
|
102 |
+
|
103 |
|
104 |
return {
|
105 |
+
|
106 |
+
"predictions": predictions,
|
107 |
+
"references": references
|
108 |
+
|
109 |
}
|
110 |
|