Tobias Cornille
commited on
Commit
•
c1fc6a3
1
Parent(s):
aff1539
Fix annotations
Browse files
app.py
CHANGED
@@ -258,12 +258,17 @@ def sam_mask_from_points(predictor, image_array, points):
|
|
258 |
return upsampled_pred
|
259 |
|
260 |
|
261 |
-
def inds_to_segments_format(
|
|
|
|
|
262 |
panoptic_inds_array = panoptic_inds.numpy().astype(np.uint32)
|
263 |
bitmap_file = bitmap2file(panoptic_inds_array, is_segmentation_bitmap=True)
|
264 |
segmentation_bitmap = Image.open(bitmap_file)
|
265 |
|
266 |
-
stuff_category_ids = [
|
|
|
|
|
|
|
267 |
|
268 |
unique_inds = np.unique(panoptic_inds_array)
|
269 |
stuff_annotations = [
|
|
|
258 |
return upsampled_pred
|
259 |
|
260 |
|
261 |
+
def inds_to_segments_format(
|
262 |
+
panoptic_inds, thing_category_ids, stuff_category_names, category_name_to_id
|
263 |
+
):
|
264 |
panoptic_inds_array = panoptic_inds.numpy().astype(np.uint32)
|
265 |
bitmap_file = bitmap2file(panoptic_inds_array, is_segmentation_bitmap=True)
|
266 |
segmentation_bitmap = Image.open(bitmap_file)
|
267 |
|
268 |
+
stuff_category_ids = [
|
269 |
+
category_name_to_id[stuff_category_name]
|
270 |
+
for stuff_category_name in stuff_category_names
|
271 |
+
]
|
272 |
|
273 |
unique_inds = np.unique(panoptic_inds_array)
|
274 |
stuff_annotations = [
|