Spaces:
Sleeping
Sleeping
Daniel Fortunato
commited on
Commit
•
bccf42a
1
Parent(s):
09d1031
add class agnostic mapping
Browse files- PanopticQuality.py +41 -19
PanopticQuality.py
CHANGED
@@ -86,29 +86,51 @@ class PQMetric(evaluate.Metric):
|
|
86 |
(0**2, 6**2),
|
87 |
(6**2, 12**2),
|
88 |
(12**2, 1e5**2)],
|
|
|
89 |
**kwargs
|
90 |
):
|
91 |
super().__init__(**kwargs)
|
92 |
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
|
113 |
DEFAULT_STUFF = ["WATER", "SKY", "LAND", "CONSTRUCTION", "ICE", "OWN_BOAT"]
|
114 |
|
|
|
86 |
(0**2, 6**2),
|
87 |
(6**2, 12**2),
|
88 |
(12**2, 1e5**2)],
|
89 |
+
class_agnostic = False,
|
90 |
**kwargs
|
91 |
):
|
92 |
super().__init__(**kwargs)
|
93 |
|
94 |
+
if class_agnostic:
|
95 |
+
DEFAULT_LABEL2ID = {'WATER': 0,
|
96 |
+
'SKY': 1,
|
97 |
+
'LAND': 2,
|
98 |
+
'MOTORBOAT': 3,
|
99 |
+
'FAR_AWAY_OBJECT': 3,
|
100 |
+
'SAILING_BOAT_WITH_CLOSED_SAILS': 3,
|
101 |
+
'SHIP': 3,
|
102 |
+
'WATERCRAFT': 3,
|
103 |
+
'SPHERICAL_BUOY': 3,
|
104 |
+
'CONSTRUCTION': 4,
|
105 |
+
'FLOTSAM': 3,
|
106 |
+
'SAILING_BOAT_WITH_OPEN_SAILS': 3,
|
107 |
+
'CONTAINER': 3,
|
108 |
+
'PILLAR_BUOY': 3,
|
109 |
+
'AERIAL_ANIMAL': 3,
|
110 |
+
'HUMAN_IN_WATER': 3,
|
111 |
+
'OWN_BOAT': 5,
|
112 |
+
'WOODEN_LOG': 3,
|
113 |
+
'MARITIME_ANIMAL': 3}
|
114 |
+
else:
|
115 |
+
DEFAULT_LABEL2ID = {'WATER': 0,
|
116 |
+
'SKY': 1,
|
117 |
+
'LAND': 2,
|
118 |
+
'MOTORBOAT': 3,
|
119 |
+
'FAR_AWAY_OBJECT': 4,
|
120 |
+
'SAILING_BOAT_WITH_CLOSED_SAILS': 5,
|
121 |
+
'SHIP': 6,
|
122 |
+
'WATERCRAFT': 7,
|
123 |
+
'SPHERICAL_BUOY': 8,
|
124 |
+
'CONSTRUCTION': 9,
|
125 |
+
'FLOTSAM': 10,
|
126 |
+
'SAILING_BOAT_WITH_OPEN_SAILS': 11,
|
127 |
+
'CONTAINER': 12,
|
128 |
+
'PILLAR_BUOY': 13,
|
129 |
+
'AERIAL_ANIMAL': 14,
|
130 |
+
'HUMAN_IN_WATER': 15,
|
131 |
+
'OWN_BOAT': 16,
|
132 |
+
'WOODEN_LOG': 17,
|
133 |
+
'MARITIME_ANIMAL': 18}
|
134 |
|
135 |
DEFAULT_STUFF = ["WATER", "SKY", "LAND", "CONSTRUCTION", "ICE", "OWN_BOAT"]
|
136 |
|