evaluate-bot commited on
Commit
216ee17
1 Parent(s): 2280922

Update Space (evaluate main: edb83af9)

Browse files
Files changed (3) hide show
  1. README.md +2 -2
  2. mean_iou.py +2 -3
  3. requirements.txt +1 -1
README.md CHANGED
@@ -27,13 +27,13 @@ For binary (two classes) or multi-class segmentation, the *mean IoU* of the imag
27
 
28
  ## How to Use
29
 
30
- The Mean IoU metric takes two numeric arrays as input corresponding to the predicted and ground truth segmentations:
31
  ```python
32
  >>> import numpy as np
33
  >>> mean_iou = evaluate.load("mean_iou")
34
  >>> predicted = np.array([[2, 2, 3], [8, 2, 4], [3, 255, 2]])
35
  >>> ground_truth = np.array([[1, 2, 2], [8, 2, 1], [3, 255, 1]])
36
- >>> results = mean_iou.compute(predictions=predicted, references=ground_truth, num_labels=10, ignore_index=255)
37
  ```
38
 
39
  ### Inputs
 
27
 
28
  ## How to Use
29
 
30
+ The Mean IoU metric takes two lists of numeric 2D arrays as input corresponding to the predicted and ground truth segmentations:
31
  ```python
32
  >>> import numpy as np
33
  >>> mean_iou = evaluate.load("mean_iou")
34
  >>> predicted = np.array([[2, 2, 3], [8, 2, 4], [3, 255, 2]])
35
  >>> ground_truth = np.array([[1, 2, 2], [8, 2, 1], [3, 255, 1]])
36
+ >>> results = mean_iou.compute(predictions=[predicted], references=[ground_truth], num_labels=10, ignore_index=255)
37
  ```
38
 
39
  ### Inputs
mean_iou.py CHANGED
@@ -281,10 +281,9 @@ class MeanIoU(evaluate.Metric):
281
  citation=_CITATION,
282
  inputs_description=_KWARGS_DESCRIPTION,
283
  features=datasets.Features(
284
- # 1st Seq - height dim, 2nd - width dim
285
  {
286
- "predictions": datasets.Sequence(datasets.Sequence(datasets.Value("uint16"))),
287
- "references": datasets.Sequence(datasets.Sequence(datasets.Value("uint16"))),
288
  }
289
  ),
290
  reference_urls=[
 
281
  citation=_CITATION,
282
  inputs_description=_KWARGS_DESCRIPTION,
283
  features=datasets.Features(
 
284
  {
285
+ "predictions": datasets.Image(),
286
+ "references": datasets.Image(),
287
  }
288
  ),
289
  reference_urls=[
requirements.txt CHANGED
@@ -1 +1 @@
1
- git+https://github.com/huggingface/evaluate@04c7588c84a1ecc591161d148150d38c72a41235
 
1
+ git+https://github.com/huggingface/evaluate@edb83af92486a64c95b3ca996ccd47c87c4e28a1