Giter Site home page Giter Site logo

worktimer / litemedsam_quantization Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bowang-lab/medsam

1.0 0.0 0.0 57.79 MB

Segment Anything in Medical Images

Home Page: https://www.nature.com/articles/s41467-024-44824-z

License: Apache License 2.0

Shell 0.32% Python 99.55% Dockerfile 0.13%

litemedsam_quantization's Introduction

LLiteMedSAM Quantization

LiteMedSAM Quantization is an optimized version based on the original MedSAM library. The original repository can be found here: MedSAM GitHub Repository. The quantized version of LiteMedSAM has been deployed as a WEB application, accessible at: LiteMedSAM WEB Application: https://medsam.senma.xyz/. This application allows users to upload two-dimensional medical imaging pictures (in PNG, JPG, JPEG formats) and process them using the quantized version of LiteMedSAM for image segmentation masking.

Medsam.mp4

Installation Guide

Cloning and Installing Dependencies

  1. Clone the repository of the quantized version of LiteMedSAM:
git clone https://github.com/WorkTimer/LiteMedSAM_Quantization/
cd LiteMedSAM_Quantization
  1. Install necessary libraries:
sudo apt-get install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libxi6 libxtst6
  1. Install conda, refer to the link: Conda Installation Guide.

Creating a Virtual Environment

  1. Create a conda virtual environment named medsam:
conda create -n medsam python=3.10 -y
conda activate medsam
  1. Install Pytorch and related dependencies:
conda install pytorch torchvision -c pytorch
pip install streamlit pandas opencv-python numpy matplotlib pillow pyarrow
pip install -e .

Installing Pytorch 2.0

  1. Enter the MedSAM folder:
cd MedSAM
  1. Run the installation command:
pip install -e .

Downloading Necessary Files

  1. Download the LiteMedSAM checkpoint file lite_medsam.pth and place it in the work_dir/LiteMedSAM directory. Download link: Google Drive.
  2. Download the demo data and place it in the test_demo/ directory. Download link: Google Drive.

Model Testing

Running Test Commands

  1. Test using the original model:
python "CVPR24_LiteMedSAM_infer.py" -i test_demo/imgs/ -o test_demo/segs
  1. Test using the quantized model for accelerated performance:
python "CVPR24_LiteMedSAM_infer_accelerating.py" -i test_demo/imgs/ -o test_demo/segs

WEB Application Operation

Starting and Accessing

  1. Run the following command in the terminal to start the WEB application:
streamlit run /home/scchat/MedSAM/app_streamlit.py --server.port=8501
  1. Access the application in a browser: http://<Server_IP>:8501

Please replace <Server_IP> with your actual server IP address. This document provides a basic guide for the installation, configuration, and usage of the quantized version of LiteMedSAM.

litemedsam_quantization's People

Contributors

ajinkya-kulkarni avatar ctrlaltf2 avatar frexg avatar joseangelgarciasanchez avatar junma11 avatar linhandev avatar sarrabenyahia avatar worktimer avatar

Stargazers

 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.