Spaces:
Sleeping
Sleeping
franzi2505
commited on
Commit
•
5b34f1e
1
Parent(s):
88af9ca
change to new payload structure
Browse files- PanopticQuality.py +5 -4
- README.md +3 -3
PanopticQuality.py
CHANGED
@@ -19,6 +19,7 @@ import datasets
|
|
19 |
import numpy as np
|
20 |
|
21 |
from seametrics.segmentation import PanopticQuality
|
|
|
22 |
|
23 |
_CITATION = """\
|
24 |
@inproceedings{DBLP:conf/cvpr/KirillovHGRD19,
|
@@ -56,13 +57,13 @@ Returns:
|
|
56 |
1 is perfect panoptic segmentation, 0 is worst possible panoptic segmentation.
|
57 |
Examples:
|
58 |
>>> import evaluate
|
59 |
-
>>> from seametrics.
|
60 |
>>> MODEL_FIELD = ["maskformer-27k-100ep"]
|
61 |
-
>>> payload =
|
62 |
>>> gt_field="ground_truth_det",
|
63 |
>>> models=MODEL_FIELD,
|
64 |
>>> sequence_list=["Trip_55_Seq_2", "Trip_197_Seq_1", "Trip_197_Seq_68"],
|
65 |
-
>>> excluded_classes=[""])
|
66 |
>>> module = evaluate.load("SEA-AI/PanopticQuality")
|
67 |
>>> module.add_payload(payload, model_name=MODEL_FIELD[0])
|
68 |
>>> module.compute()
|
@@ -162,7 +163,7 @@ class PQMetric(evaluate.Metric):
|
|
162 |
"""Called within the evaluate.Metric.compute() method"""
|
163 |
return self.pq_metric.compute()
|
164 |
|
165 |
-
def add_payload(self, payload:
|
166 |
"""Converts the payload to the format expected by the metric"""
|
167 |
# import only if needed since fiftyone is not a direct dependency
|
168 |
from seametrics.segmentation.utils import payload_to_seg_metric
|
|
|
19 |
import numpy as np
|
20 |
|
21 |
from seametrics.segmentation import PanopticQuality
|
22 |
+
from seametrics.payload import Payload
|
23 |
|
24 |
_CITATION = """\
|
25 |
@inproceedings{DBLP:conf/cvpr/KirillovHGRD19,
|
|
|
57 |
1 is perfect panoptic segmentation, 0 is worst possible panoptic segmentation.
|
58 |
Examples:
|
59 |
>>> import evaluate
|
60 |
+
>>> from seametrics.payload.processor import PayloadProcessor
|
61 |
>>> MODEL_FIELD = ["maskformer-27k-100ep"]
|
62 |
+
>>> payload = PayloadProcessor("SAILING_PANOPTIC_DATASET_QA",
|
63 |
>>> gt_field="ground_truth_det",
|
64 |
>>> models=MODEL_FIELD,
|
65 |
>>> sequence_list=["Trip_55_Seq_2", "Trip_197_Seq_1", "Trip_197_Seq_68"],
|
66 |
+
>>> excluded_classes=[""]).payload
|
67 |
>>> module = evaluate.load("SEA-AI/PanopticQuality")
|
68 |
>>> module.add_payload(payload, model_name=MODEL_FIELD[0])
|
69 |
>>> module.compute()
|
|
|
163 |
"""Called within the evaluate.Metric.compute() method"""
|
164 |
return self.pq_metric.compute()
|
165 |
|
166 |
+
def add_payload(self, payload: Payload, model_name: str = None):
|
167 |
"""Converts the payload to the format expected by the metric"""
|
168 |
# import only if needed since fiftyone is not a direct dependency
|
169 |
from seametrics.segmentation.utils import payload_to_seg_metric
|
README.md
CHANGED
@@ -23,13 +23,13 @@ To get started with PanopticQuality, make sure you have the necessary dependenci
|
|
23 |
### Basic Usage
|
24 |
```python
|
25 |
>>> import evaluate
|
26 |
-
>>> from seametrics.
|
27 |
>>> MODEL_FIELD = ["maskformer-27k-100ep"]
|
28 |
-
>>> payload =
|
29 |
>>> gt_field="ground_truth_det",
|
30 |
>>> models=MODEL_FIELD,
|
31 |
>>> sequence_list=["Trip_55_Seq_2", "Trip_197_Seq_1", "Trip_197_Seq_68"],
|
32 |
-
>>> excluded_classes=[""])
|
33 |
>>> module = evaluate.load("SEA-AI/PanopticQuality")
|
34 |
>>> module.add_payload(payload, model_name=MODEL_FIELD[0])
|
35 |
>>> module.compute()
|
|
|
23 |
### Basic Usage
|
24 |
```python
|
25 |
>>> import evaluate
|
26 |
+
>>> from seametrics.payload.processor import PayloadProcessor
|
27 |
>>> MODEL_FIELD = ["maskformer-27k-100ep"]
|
28 |
+
>>> payload = PayloadProcessor("SAILING_PANOPTIC_DATASET_QA",
|
29 |
>>> gt_field="ground_truth_det",
|
30 |
>>> models=MODEL_FIELD,
|
31 |
>>> sequence_list=["Trip_55_Seq_2", "Trip_197_Seq_1", "Trip_197_Seq_68"],
|
32 |
+
>>> excluded_classes=[""]).payload
|
33 |
>>> module = evaluate.load("SEA-AI/PanopticQuality")
|
34 |
>>> module.add_payload(payload, model_name=MODEL_FIELD[0])
|
35 |
>>> module.compute()
|