Shape-Guided icon indicating copy to clipboard operation
Shape-Guided copied to clipboard

What the difference between the parameter 'split' in the function of 'get_featrue'?

Open limaodaxia opened this issue 11 months ago • 0 comments

def get_feature(self, points_all, points_idx, data_id, split='test'):
    
    total_feature = None
    total_rgb_feature_indices = []
    
    for patch in range(len(points_all)):
        points = points_all[patch].reshape(-1, self.POINT_NUM, 3)
        indices = points_idx[patch].reshape(self.POINT_NUM)

        # compute the correspoding location of rgb features
        rgb_f_indices = get_relative_rgb_f_indices(indices, self.image_size, 28)
        # extract sdf features
        feature = self.sdf_model.get_feature(points.to(self.device))
        
        if patch == 0:
            total_feature = feature
        else:
            total_feature = torch.cat((total_feature, feature), 0)
            
        if split == 'test':
            total_rgb_feature_indices.append(rgb_f_indices)
        elif split == 'train':
            total_rgb_feature_indices.append(data_id * 784 + rgb_f_indices)
        else:
            return KeyError
        
    return total_feature, total_rgb_feature_indices

What the difference between the parameter 'split' in the function of 'get_featrue'? Why in the split of 'train' the total_rgb_feature_indices is added data_id * 784 ?

limaodaxia avatar Mar 04 '24 01:03 limaodaxia