MinkowskiEngine icon indicating copy to clipboard operation
MinkowskiEngine copied to clipboard

Quantization handles conflicting labels incorrectly

Open asbe opened this issue 1 year ago • 0 comments

Fixes a bug where conflicting labels are handled incorrectly.

Minimal script for reproducing bug

import MinkowskiEngine as ME import numpy as np #-----Dummy inputs #(Other examples without conflicting labels, and with one point at a time behaves as expected) #Case 0: 2 pairs of redundant points, 1) with same labels 2) with different labels. #Expected behaviour: coords_aug_new = [1, 0, 0], labels_new = [11, 255], feats = [0,0,101], return_index = [0, 2], return_mapping = [0, 0, ] #Result: one ignore label, but in the wrong position. coords_aug = np.float32(np.array([ [1, 0, 0],[1, 0, 0], [2, 0, 0], [2, 0, 0] ])) labels = np.array([ 11,11, 20,21, ]) feats = np.array([ [0, 0, 101],[0, 0, 101], [0, 0, 101], [0, 0, 101] ]) return_args_tmp = ME.utils.sparse_quantize( coords_aug, feats, labels=labels.astype(np.int32), ignore_label=255, return_index = True, return_inverse = True), #quantization_size=1) (coords_aug_new,feats_new,labels_new,voxel_return_index, voxel_return_mapping)=return_args_tmp[0] print("New labels: ", labels_new) print("New coords: ", coords_aug_new) print("Return index", voxel_return_index) print("Return mapping", voxel_return_mapping)

asbe avatar Nov 06 '24 13:11 asbe