michaelgroeger / boxshrink

This is the repository for the corresponding 2022 MICCAI-MILLanD workshop paper "BoxShrink: From Bounding Boxes to Segmentation Masks"
MIT License
22 stars 1 forks source link

Bug #1

Closed Huster-Hq closed 1 year ago

Huster-Hq commented 1 year ago

File "/data1/Huqiang/polyp-segmentation/boxshrink-main/robust_boxshrink.py", line 41, in res = generate_embedding_masks_for_dataset(dataset, TESTING_DIR, feature_extract_model, mean_f, mean_b, save_as_png=True) File "/data1/Huqiang/polyp-segmentation/boxshrink-main/scripts/embeddings.py", line 405, in generate_embedding_masks_for_dataset mean_background_embedding, File "/data1/Huqiang/polyp-segmentation/boxshrink-main/scripts/embeddings.py", line 372, in get_embedding_mask_or_box mean_background_embedding=mean_background_embedding, File "/data1/Huqiang/polyp-segmentation/boxshrink-main/scripts/embeddings.py", line 283, in create_embedding_mask model=model, File "/data1/Huqiang/polyp-segmentation/boxshrink-main/scripts/embeddings.py", line 141, in get_foreground_background_embeddings device=DEVICE, File "/data1/Huqiang/polyp-segmentation/boxshrink-main/scripts/embeddings.py", line 55, in fill_embedding_matrix smallest, largest = get_bbox_coordinates_one_box(all_superpixels_mask_tmp) File "/data1/Huqiang/polyp-segmentation/boxshrink-main/scripts/embeddings.py", line 37, in get_bbox_coordinates_one_box print(torch.max(all_x)) RuntimeError: max(): Expected reduction dim to be specified for input.numel() == 0. Specify the reduction dim with the 'dim' argument.

when superpixel = 0 , the all_superpixels_mask_tmp = 0, because of : all_superpixels_mask_tmp[all_superpixels_mask_tmp != superpixel] = 0 all_superpixels_mask_tmp[all_superpixels_mask_tmp > 0] = 1 can't get the (smallest_y, smallest_x)

Huster-Hq commented 1 year ago

The bug has been fixed, because the start_label parameter in the slic is cancelled in some versions of skimage.segmentation.