Skip to content

In 331_fine_tune_SAM_mito.ipynb, the class SAMDataset(Dataset) needs to be adjusted to have 3 bands to go into the processor #81

Open

Description

@throughthetrees

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

Activity

  1. ZoreAnuj commented on Mar 12, 2024

    @ZoreAnuj

    Thanks man!

  2. VaishnaviMudaliar commented on Mar 15, 2024

    @VaishnaviMudaliar

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

  3. RoyAn2386 commented on Mar 17, 2024

    @RoyAn2386

    Thanks man~~

  4. ajaidevanath commented on May 19, 2024

    @ajaidevanath

    Still having issues

  5. ajaidevanath commented on May 19, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions