python_for_microscopists icon indicating copy to clipboard operation
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

Open throughthetrees opened this issue 11 months ago • 5 comments

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")

throughthetrees avatar Mar 05 '24 18:03 throughthetrees

Thanks man!

ZoreAnuj avatar Mar 12 '24 19:03 ZoreAnuj

I spent a week trying to figure this out. Thanks for the solution!

VaishnaviMudaliar avatar Mar 15 '24 06:03 VaishnaviMudaliar

Thanks man~~

RoyAn2386 avatar Mar 17 '24 02:03 RoyAn2386

Still having issues

ajaidevanath avatar May 19 '24 11:05 ajaidevanath

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"

ajaidevanath avatar May 19 '24 11:05 ajaidevanath