|
1 | | -from __future__ import annotations |
2 | | - |
3 | 1 | from typing import Dict, Optional, List, Any |
4 | 2 | from .annotation import ( |
5 | 3 | BoxAnnotation, |
@@ -30,7 +28,7 @@ class SegmentationPrediction(SegmentationAnnotation): |
30 | 28 | # No need to define init or to_payload methods because |
31 | 29 | # we default to functions defined in the parent class |
32 | 30 | @classmethod |
33 | | - def from_json(cls, payload: dict) -> SegmentationPrediction: |
| 31 | + def from_json(cls, payload: dict): |
34 | 32 | return cls( |
35 | 33 | mask_url=payload[MASK_URL_KEY], |
36 | 34 | annotations=[ |
@@ -78,7 +76,7 @@ def to_payload(self) -> dict: |
78 | 76 | return payload |
79 | 77 |
|
80 | 78 | @classmethod |
81 | | - def from_json(cls, payload: dict) -> BoxPrediction: |
| 79 | + def from_json(cls, payload: dict): |
82 | 80 | geometry = payload.get(GEOMETRY_KEY, {}) |
83 | 81 | return cls( |
84 | 82 | label=payload.get(LABEL_KEY, 0), |
@@ -123,7 +121,7 @@ def to_payload(self) -> dict: |
123 | 121 | return payload |
124 | 122 |
|
125 | 123 | @classmethod |
126 | | - def from_json(cls, payload: dict) -> PolygonPrediction: |
| 124 | + def from_json(cls, payload: dict): |
127 | 125 | geometry = payload.get(GEOMETRY_KEY, {}) |
128 | 126 | return cls( |
129 | 127 | label=payload.get(LABEL_KEY, 0), |
|
0 commit comments