Spaces:
Runtime error
Runtime error
Fix index out of bounds error
#4
by
hysts
HF staff
- opened
- label_prettify.py +1 -1
label_prettify.py
CHANGED
@@ -66,7 +66,7 @@ def seg_prettify(rgb_path, file_name):
|
|
66 |
|
67 |
for i in np.unique(seg_labels):
|
68 |
obj_idx_all = np.where(seg_labels == i)
|
69 |
-
obj_idx = random.randint(0, len(obj_idx_all[0] - 1)
|
70 |
x, y = obj_idx_all[1][obj_idx], obj_idx_all[0][obj_idx]
|
71 |
obj_name = coco_label_map[int(i * 255)]
|
72 |
obj_name = obj_name.split(',')[0]
|
|
|
66 |
|
67 |
for i in np.unique(seg_labels):
|
68 |
obj_idx_all = np.where(seg_labels == i)
|
69 |
+
obj_idx = random.randint(0, len(obj_idx_all[0]) - 1)
|
70 |
x, y = obj_idx_all[1][obj_idx], obj_idx_all[0][obj_idx]
|
71 |
obj_name = coco_label_map[int(i * 255)]
|
72 |
obj_name = obj_name.split(',')[0]
|