Spaces:
Sleeping
Sleeping
Commit
·
c921506
1
Parent(s):
d705d80
updated docs
Browse files- README.md +1 -1
- det-metrics.py +3 -2
README.md
CHANGED
|
@@ -84,7 +84,7 @@ Integrate SEA-AI/det-metrics with FiftyOne datasets for enhanced analysis and vi
|
|
| 84 |
```python
|
| 85 |
import evaluate
|
| 86 |
import logging
|
| 87 |
-
from seametrics.payload import PayloadProcessor
|
| 88 |
|
| 89 |
logging.basicConfig(level=logging.WARNING)
|
| 90 |
|
|
|
|
| 84 |
```python
|
| 85 |
import evaluate
|
| 86 |
import logging
|
| 87 |
+
from seametrics.payload.processor import PayloadProcessor
|
| 88 |
|
| 89 |
logging.basicConfig(level=logging.WARNING)
|
| 90 |
|
det-metrics.py
CHANGED
|
@@ -21,6 +21,7 @@ import datasets
|
|
| 21 |
import numpy as np
|
| 22 |
|
| 23 |
from seametrics.detection import PrecisionRecallF1Support
|
|
|
|
| 24 |
|
| 25 |
_CITATION = """\
|
| 26 |
@InProceedings{coco:2020,
|
|
@@ -193,7 +194,7 @@ class DetectionMetric(evaluate.Metric):
|
|
| 193 |
)
|
| 194 |
|
| 195 |
@deprecated(reason="Use `module.from_payload` instead")
|
| 196 |
-
def add_batch(self, payload, model_name: str = None):
|
| 197 |
"""Takes as input a payload and adds the batch to the metric"""
|
| 198 |
self.add_payload(payload, model_name)
|
| 199 |
|
|
@@ -201,7 +202,7 @@ class DetectionMetric(evaluate.Metric):
|
|
| 201 |
"""Called within the evaluate.Metric.compute() method"""
|
| 202 |
return self.coco_metric.compute()["metrics"]
|
| 203 |
|
| 204 |
-
def add_payload(self, payload, model_name: str = None):
|
| 205 |
"""Converts the payload to the format expected by the metric"""
|
| 206 |
# import only if needed since fiftyone is not a direct dependency
|
| 207 |
from seametrics.detection.utils import payload_to_det_metric
|
|
|
|
| 21 |
import numpy as np
|
| 22 |
|
| 23 |
from seametrics.detection import PrecisionRecallF1Support
|
| 24 |
+
from seametrics.payload import Payload
|
| 25 |
|
| 26 |
_CITATION = """\
|
| 27 |
@InProceedings{coco:2020,
|
|
|
|
| 194 |
)
|
| 195 |
|
| 196 |
@deprecated(reason="Use `module.from_payload` instead")
|
| 197 |
+
def add_batch(self, payload: Payload, model_name: str = None):
|
| 198 |
"""Takes as input a payload and adds the batch to the metric"""
|
| 199 |
self.add_payload(payload, model_name)
|
| 200 |
|
|
|
|
| 202 |
"""Called within the evaluate.Metric.compute() method"""
|
| 203 |
return self.coco_metric.compute()["metrics"]
|
| 204 |
|
| 205 |
+
def add_payload(self, payload: Payload, model_name: str = None):
|
| 206 |
"""Converts the payload to the format expected by the metric"""
|
| 207 |
# import only if needed since fiftyone is not a direct dependency
|
| 208 |
from seametrics.detection.utils import payload_to_det_metric
|