Gil-Simas commited on
Commit
c7763c3
·
verified ·
1 Parent(s): 23749ff

update add_batch documention

Browse files
Files changed (1) hide show
  1. README.md +16 -29
README.md CHANGED
@@ -30,31 +30,26 @@ pip install evaluate git+https://github.com/SEA-AI/seametrics@develop
30
 
31
  ### Basic Usage
32
 
33
- Here's how to quickly evaluate your object detection models using SEA-AI/det-metrics:
34
 
35
  ```python
36
  import evaluate
37
 
38
  # Define your predictions and references (dict values can also by numpy arrays)
39
- predictions = [
40
- {
41
- "boxes": [[449.3, 197.75390625, 6.25, 7.03125], [334.3, 181.58203125, 11.5625, 6.85546875]],
42
- "labels": [0, 0],
43
- "scores": [0.153076171875, 0.72314453125],
44
- }
45
- ]
46
 
47
- references = [
48
- {
49
- "boxes": [[449.3, 197.75390625, 6.25, 7.03125], [334.3, 181.58203125, 11.5625, 6.85546875]],
50
- "labels": [0, 0],
51
- "area": [132.2, 83.8],
52
- }
53
- ]
54
 
55
  # Load SEA-AI/det-metrics and evaluate
56
  module = evaluate.load("SEA-AI/det-metrics")
57
- module.add(prediction=predictions, reference=references)
58
  results = module.compute()
59
 
60
  print(results)
@@ -62,19 +57,11 @@ print(results)
62
 
63
  This will output the evaluation metrics for your detection model.
64
  ```
65
- {'all': {'range': [0, 10000000000.0],
66
- 'iouThr': '0.00',
67
- 'maxDets': 100,
68
- 'tp': 2,
69
- 'fp': 0,
70
- 'fn': 0,
71
- 'duplicates': 0,
72
- 'precision': 1.0,
73
- 'recall': 1.0,
74
- 'f1': 1.0,
75
- 'support': 2,
76
- 'fpi': 0,
77
- 'nImgs': 1}
78
  ```
79
 
80
  ## FiftyOne Integration
 
30
 
31
  ### Basic Usage
32
 
33
+ Here's how to quickly evaluate your object detection models using SEA-AI/box-metrics:
34
 
35
  ```python
36
  import evaluate
37
 
38
  # Define your predictions and references (dict values can also by numpy arrays)
39
+ predictions = {
40
+ "model1": [torch.tensor[n,6], torch.tensor[n,6]],
41
+ "model2": [torch.tensor[n,6], torch.tensor[n,6]]
42
+ }
 
 
 
43
 
44
+ #predictions box format: x1, y1, x2, y2, conf, label (torch metrics format)
45
+
46
+ references = [torch.tensor[n,5], torch.tensor[n,5]]
47
+
48
+ #refernces box format: label, x1, y1, x2, y2 (torch metrics format)
 
 
49
 
50
  # Load SEA-AI/det-metrics and evaluate
51
  module = evaluate.load("SEA-AI/det-metrics")
52
+ module.add_batch(prediction=predictions, reference=references, sequence_name="sequence")
53
  results = module.compute()
54
 
55
  print(results)
 
57
 
58
  This will output the evaluation metrics for your detection model.
59
  ```
60
+ {'sequence': {'model1':
61
+ {'iou': '0.6',
62
+ 'bep': 0.5,
63
+ ...
64
+ }}}
 
 
 
 
 
 
 
 
65
  ```
66
 
67
  ## FiftyOne Integration