|
16 | 16 | from PIL import Image |
17 | 17 |
|
18 | 18 | EVAL_LABELS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 24, 28, 33, 34, 36, 39] |
| 19 | +EVAL_LABEL_NAMES = ["wall", "floor", "cabinet", "bed", "chair", "sofa", "table", "door", "window", "bookshelf", "picture", "counter", "desk", "curtain", "refrigerator", "shower curtain", "toilet", "sink", "bathtub", "otherfurniture"] |
| 20 | +EVAL_LABEL_CATS = ["indoor", "indoor", "furniture", "furniture", "furniture", "furniture", "furniture", "furniture", "furniture", "furniture", "furniture", "furniture", "furniture", "furniture", "appliance", "furniture", "furniture", "appliance", "furniture", "furniture"] |
| 21 | +EVAL_LABEL_COLORS = [(174, 199, 232), (152, 223, 138), (31, 119, 180), (255, 187, 120), (188, 189, 34), (140, 86, 75), (255, 152, 150), (214, 39, 40), (197, 176, 213), (148, 103, 189), (196, 156, 148), (23, 190, 207), (247, 182, 210), (219, 219, 141), (255, 127, 14), (158, 218, 229), (44, 160, 44), (112, 128, 144), (227, 119, 194), (82, 84, 163)] |
19 | 22 |
|
20 | 23 | def splitall(path): |
21 | 24 | allparts = [] |
@@ -60,6 +63,19 @@ def convert2panoptic(scannetPath, outputFolder=None): |
60 | 63 | os.mkdir(panopticFolder) |
61 | 64 | print("Corresponding segmentations in .png format will be saved in {}".format(panopticFolder)) |
62 | 65 |
|
| 66 | + categories = [] |
| 67 | + for idx in range(len(EVAL_LABELS)): |
| 68 | + label = EVAL_LABELS[idx] |
| 69 | + name = EVAL_LABEL_NAMES[idx] |
| 70 | + cat = EVAL_LABEL_CATS[idx] |
| 71 | + color = EVAL_LABEL_COLORS[idx] |
| 72 | + isthing = label > 2 |
| 73 | + categories.append({'id': int(label), |
| 74 | + 'name': name, |
| 75 | + 'color': color, |
| 76 | + 'supercategory': cat, |
| 77 | + 'isthing': isthing}) |
| 78 | + |
63 | 79 | images = [] |
64 | 80 | annotations = [] |
65 | 81 | for progress, f in enumerate(files): |
@@ -136,7 +152,7 @@ def main(): |
136 | 152 | parser = argparse.ArgumentParser() |
137 | 153 | parser.add_argument("--dataset-folder", |
138 | 154 | dest="scannetPath", |
139 | | - help="path to the ScanNet data 'scenes_all' folder", |
| 155 | + help="path to the ScanNet data 'scannet_frames_25k' folder", |
140 | 156 | required=True, |
141 | 157 | type=str) |
142 | 158 | parser.add_argument("--output-folder", |
|
0 commit comments