Spaces:
Build error
Build error
Commit
·
01520d7
1
Parent(s):
c6ea80c
DATA-231: add predicted samples and samples to result
Browse files- horizon-metrics.py +7 -2
horizon-metrics.py
CHANGED
@@ -12,6 +12,8 @@
|
|
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 numpy as np
|
@@ -110,12 +112,13 @@ class HorizonMetrics(evaluate.Metric):
|
|
110 |
"""
|
111 |
|
112 |
def __init__(self,
|
113 |
-
vertical_fov_degrees,
|
114 |
-
height,
|
115 |
roll_threshold=0.5,
|
116 |
pitch_threshold=0.1,
|
117 |
**kwargs):
|
118 |
|
|
|
119 |
super().__init__(**kwargs)
|
120 |
|
121 |
self.slope_threshold = roll_to_slope(roll_threshold)
|
@@ -203,5 +206,7 @@ class HorizonMetrics(evaluate.Metric):
|
|
203 |
|
204 |
detection_rate = detected_horizon_count / detected_gt_count
|
205 |
result['detection_rate'] = detection_rate
|
|
|
|
|
206 |
|
207 |
return result
|
|
|
12 |
# See the License for the specific language governing permissions and
|
13 |
# limitations under the License.
|
14 |
|
15 |
+
from typing import Union
|
16 |
+
|
17 |
import evaluate
|
18 |
import datasets
|
19 |
import numpy as np
|
|
|
112 |
"""
|
113 |
|
114 |
def __init__(self,
|
115 |
+
vertical_fov_degrees: Union[float, int, None],
|
116 |
+
height: float,
|
117 |
roll_threshold=0.5,
|
118 |
pitch_threshold=0.1,
|
119 |
**kwargs):
|
120 |
|
121 |
+
|
122 |
super().__init__(**kwargs)
|
123 |
|
124 |
self.slope_threshold = roll_to_slope(roll_threshold)
|
|
|
206 |
|
207 |
detection_rate = detected_horizon_count / detected_gt_count
|
208 |
result['detection_rate'] = detection_rate
|
209 |
+
result['predicted_samples'] = detected_horizon_count,
|
210 |
+
result['samples'] = detected_gt_count
|
211 |
|
212 |
return result
|