Giter Site home page Giter Site logo

shengshanbai / learnablepromptsam Goto Github PK

View Code? Open in Web Editor NEW

This project forked from qsingle/learnablepromptsam

0.0 0.0 0.0 13.7 MB

Try to use the SAM-ViT as the backbone to create the learnable prompt for semantic segmentation

License: Apache License 2.0

Python 100.00%

learnablepromptsam's Introduction

LearnablePromptSAM

Try to use the SAM-ViT as the backbone to create the visual prompt tuning model for semantic segmentation. More of the details can be seen at the technical report at link

Motivation

As the original SAM can not be used at the optical images like color fundus and OCT (As the following image shows.), thus we introduce the learnable prompt layer (Adapter) to fine-tune the SAM.

Intro

Structure

structure

Experiments Results

  • The results of the one-shot learning:

    One-shot

  • Results for the zero-shot after tuned.

    zero-shot

Usage

  • Clone the code to your PC.

    git clone https://github.com/Qsingle/LearnablePromptSAM.git
  • Download the weights from original repository.

  • Fine-tune the model with our code (In our experiments, we found that lr=0.05 can get a better results. You can change it.).

    python train_learnable_sam.py --image /path/to/the/image \
                                  --mask_path /path/to/the/mask \
                                  --model_name vit_h \
                                  --checkpoint /path/to/the/pretrained/weights \
                                  --save_path /path/to/store/the/weights \
                                  --lr 0.05 \
                                  --mix_precision \
                                  --optimizer sgd

2023.08.15

  • Fix the dtype error in train_learnable_sam.py
  • We merge this reposity to imed_vision and add the implementation for the DPT at the new version.

2023.04.27

  • Update README
  • Update code.

2023.04.13

  • Upload the sample code for the model.
  • Update the README
  • Given the sample for the one-shot learning.

TODO

  • Dynamic Head for segmentation.

  • Optimize the training process.

  • Support for the training of few-shot learning.

  • Improving the performance of the model.

Reference

Segment-Anything

IDRiD

ROSE

AROI

FIVES

learnablepromptsam's People

Contributors

qsingle avatar

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.