Victoria Oberascher commited on
Commit
576a9f6
1 Parent(s): cc786f1

update readme

Browse files
Files changed (1) hide show
  1. README.md +12 -6
README.md CHANGED
@@ -33,10 +33,9 @@ To get started with horizon-metrics, make sure you have the necessary dependenci
33
 
34
  This is how you can quickly evaluate your horizon prediction models using SEA-AI/horizon-metrics:
35
 
36
- ```python
37
- import evaluate
38
 
39
- #Use artificial data for testing or
40
  ground_truth_points = [[[0.0, 0.5384765625], [1.0, 0.4931640625]],
41
  [[0.0, 0.53796875], [1.0, 0.4928515625]],
42
  [[0.0, 0.5374609375], [1.0, 0.4925390625]],
@@ -48,27 +47,34 @@ prediction_points = [[[0.0, 0.5428930956049597], [1.0, 0.4642497615378973]],
48
  [[0.0, 0.523573113510805], [1.0, 0.47642688648919496]],
49
  [[0.0, 0.5200016849393765], [1.0, 0.4728554579177664]],
50
  [[0.0, 0.523573113510805], [1.0, 0.47642688648919496]]]
 
 
 
51
 
52
- #Load data from fiftyone
53
  sequence = "Sentry_2023_02_Portugal_2023_01_24_19_15_17"
54
  dataset_name = "SENTRY_VIDEOS_DATASET_QA"
55
  sequence_view = fo.load_dataset(dataset_name).match(F("sequence") == sequence)
56
  sequence_view = sequence_view.select_group_slices("thermal_wide")
57
 
58
- #Get the ground truth points
59
  polylines_gt = sequence_view.values("frames.ground_truth_pl")
60
  ground_truth_points = [
61
  line["polylines"][0]["points"][0] for line in polylines_gt[0]
62
  if line is not None
63
  ]
64
 
65
- #Get the predicted points
66
  polylines_pred = sequence_view.values(
67
  "frames.ahoy-IR-b2-whales__XAVIER-AGX-JP46_pl")
68
  prediction_points = [
69
  line["polylines"][0]["points"][0] for line in polylines_pred[0]
70
  if line is not None
71
  ]
 
 
 
 
 
 
72
 
73
  module = evaluate.load("SEA-AI/horizon-metrics")
74
  module.add(predictions=ground_truth_points, references=prediction_points)
 
33
 
34
  This is how you can quickly evaluate your horizon prediction models using SEA-AI/horizon-metrics:
35
 
36
+ ##### Use artifical data for testing
 
37
 
38
+ ```python
39
  ground_truth_points = [[[0.0, 0.5384765625], [1.0, 0.4931640625]],
40
  [[0.0, 0.53796875], [1.0, 0.4928515625]],
41
  [[0.0, 0.5374609375], [1.0, 0.4925390625]],
 
47
  [[0.0, 0.523573113510805], [1.0, 0.47642688648919496]],
48
  [[0.0, 0.5200016849393765], [1.0, 0.4728554579177664]],
49
  [[0.0, 0.523573113510805], [1.0, 0.47642688648919496]]]
50
+ ```
51
+
52
+ ##### Load data from fiftyone
53
 
54
+ ```python
55
  sequence = "Sentry_2023_02_Portugal_2023_01_24_19_15_17"
56
  dataset_name = "SENTRY_VIDEOS_DATASET_QA"
57
  sequence_view = fo.load_dataset(dataset_name).match(F("sequence") == sequence)
58
  sequence_view = sequence_view.select_group_slices("thermal_wide")
59
 
 
60
  polylines_gt = sequence_view.values("frames.ground_truth_pl")
61
  ground_truth_points = [
62
  line["polylines"][0]["points"][0] for line in polylines_gt[0]
63
  if line is not None
64
  ]
65
 
 
66
  polylines_pred = sequence_view.values(
67
  "frames.ahoy-IR-b2-whales__XAVIER-AGX-JP46_pl")
68
  prediction_points = [
69
  line["polylines"][0]["points"][0] for line in polylines_pred[0]
70
  if line is not None
71
  ]
72
+ ```
73
+
74
+ ##### Calculate horizon metrics
75
+
76
+ ```python
77
+ import evaluate
78
 
79
  module = evaluate.load("SEA-AI/horizon-metrics")
80
  module.add(predictions=ground_truth_points, references=prediction_points)