Skip to content

Add dtype argument to fix Nan in padding

Usman Rafique requested to merge usman.rafique/ndsampler:fix_padding into dev/0.6.6

The problem: currently, the sampler crashes when there are integer NaNs.

The fix: an option of dtype is added in load_sample (at https://gitlab.kitware.com/usman.rafique/ndsampler/-/blob/fix_padding/ndsampler/coco_sampler.py#L451).

def load_sample(self, tr, with_annots=True, visible_thresh=0.0, pad=None,
                    padkw={'mode': 'constant'}, dtype=None, **kw):

If there are int Nans, load_sample should be called with dtype=np.float64.

Merge request reports

Loading