Code Monkey home page Code Monkey logo

Comments (3)

JunMa11 avatar JunMa11 commented on August 17, 2024

Hi @ngctnnnn ,

Thanks for your interest.

  1. How do you run the experiments? I just tested the model and re-computed the metrics and confirmed that the reported DSC is right. The segmentation results and trained model have been available on the readme page.
  2. We didn't have specific configurations for DRIVE dataset. All the trained datasets are merged together for training and you can find the training data on the readme page as well.

from medsam.

ngctnnnn avatar ngctnnnn commented on August 17, 2024

please correct me if i'm wrong, when I use this code on test 20 images for 20 batches (1 image per batch), my output dice score is 3.5 instead of less than 1. Does this problem occur to you also or just me. Thanks

sam_model = sam_model.to("cuda:3")
        mask_segmentation, iou_predictions = sam_model.mask_decoder(
            image_embeddings=image_embedding.to("cuda:3"), # (B, 256, 64, 64)
            image_pe=sam_model.prompt_encoder.get_dense_pe(), # (1, 256, 64, 64)
            sparse_prompt_embeddings=sparse_embeddings, # (B, 2, 256)
            dense_prompt_embeddings=dense_embeddings, # (B, 256, 64, 64)
            multimask_output=False,
        )
        medsam_seg_prob = torch.sigmoid(mask_segmentation)
        # convert soft mask to hard mask
        medsam_seg_prob = medsam_seg_prob.cpu().numpy().squeeze()
        medsam_seg = (medsam_seg_prob > 0.5).astype(np.uint8)
        all_masks_segmentation.append(medsam_seg)
        all_gt2d.append(gt2D)
            
    all_masks_segmentation = np.stack(all_masks_segmentation, axis = 0)
    all_gt2d = np.stack(all_gt2d, axis =0)
    dice_score = compute_dice_coefficient(all_gt2d>0, all_masks_segmentation>0)

from medsam.

JunMa11 avatar JunMa11 commented on August 17, 2024

Hi @ngctnnnn ,

The testing images and code are also available on the read me page. I didn't have this issue.

from medsam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.