nickgkan / butd_detr

Code for the ECCV22 paper "Bottom Up Top Down Detection Transformers for Language Grounding in Images and Point Clouds"
Other
74 stars 11 forks source link

About the label ID #13

Closed Hiusam closed 1 year ago

Hiusam commented 1 year ago

Hi, thanks for your great work!

Could you please give me some hints about where self.type2class and self.nyu40ids come from? I check scannetv2-labels.combined.tsv and they seem not well aligned.

class ScannetDatasetConfig:

    def __init__(self, num_class=485, agnostic=False):
        self.num_class = num_class if not agnostic else 1  # 18
        self.num_heading_bin = 1
        self.num_size_cluster = num_class
        if num_class == 18:
            self.type2class = {'cabinet': 0, 'bed': 1, 'chair': 2, 'couch': 3, 'table': 4, 'door': 5,
                               'window': 6, 'bookshelf': 7, 'picture': 8, 'counter': 9, 'desk': 10, 'curtain': 11,
                               'refrigerator': 12, 'shower curtain': 13, 'toilet': 14, 'sink': 15, 'bathtub': 16,
                               'other furniture': 17}
        else:
            self.type2class = {'wall': 0, 'chair': 1, 'floor': 2, ...}

        self.class2type = {self.type2class[t]: t for t in self.type2class}
        if num_class == 18:
            self.nyu40ids = np.array([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 24, 28, 33, 34, 36, 39])
        else:
            # only train
            self.nyu40ids = np.array([1, 2, 3, 4, 5, 6, 7,... ])
        self.nyu40id2class = {nyu40id: i for i, nyu40id in enumerate(list(self.nyu40ids))}

Also, how did you get the cls_results.json?

nickgkan commented 1 year ago

The nyu ids come from the file you mentioned, but if you notice in joint_dataset.py we handle the 18 and the 485 cases differently, i.e., use different id column.

The cls_results.json contains predicted classes from a pointnet++ we trained.