python_for_microscopists
python_for_microscopists copied to clipboard
In 331_fine_tune_SAM_mito.ipynb, the class SAMDataset(Dataset) needs to be adjusted to have 3 bands to go into the processor
The demo no longer works.
Change this line in the class SAMDataset(Dataset)
# prepare image and prompt for the model inputs = self.processor(image, input_boxes=[[prompt]], return_tensors="pt")
to
# prepare image and prompt for the model inputs = self.processor(np.stack((image,)*3, axis=-1), input_boxes=[[prompt]], return_tensors="pt")
Thanks man!
I spent a week trying to figure this out. Thanks for the solution!
Thanks man~~
Still having issues
ERROR:"setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part"