{"id":22068019,"url":"https://github.com/SuperMedIntel/Medical-SAM2","last_synced_at":"2025-07-24T05:31:26.405Z","repository":{"id":250978624,"uuid":"835557058","full_name":"SuperMedIntel/Medical-SAM2","owner":"SuperMedIntel","description":"Medical SAM 2: Segment Medical Images As Video Via Segment Anything Model 2","archived":false,"fork":false,"pushed_at":"2025-01-06T13:20:04.000Z","size":24153,"stargazers_count":530,"open_issues_count":31,"forks_count":66,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-01-06T14:28:27.559Z","etag":null,"topics":["deep-learning","medical","medical-imaging","segment-anything","segment-anything-2","segment-anything-model","segmentation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SuperMedIntel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-30T04:49:37.000Z","updated_at":"2025-01-06T13:20:07.000Z","dependencies_parsed_at":"2024-08-15T14:52:57.979Z","dependency_job_id":"8c021096-3fbb-45bd-80a8-f7f54841473c","html_url":"https://github.com/SuperMedIntel/Medical-SAM2","commit_stats":null,"previous_names":["medicinetoken/medical-sam2","supermedintel/medical-sam2"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SuperMedIntel/Medical-SAM2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperMedIntel%2FMedical-SAM2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperMedIntel%2FMedical-SAM2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperMedIntel%2FMedical-SAM2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperMedIntel%2FMedical-SAM2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SuperMedIntel","download_url":"https://codeload.github.com/SuperMedIntel/Medical-SAM2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperMedIntel%2FMedical-SAM2/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266796832,"owners_count":23985483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","medical","medical-imaging","segment-anything","segment-anything-2","segment-anything-model","segmentation"],"created_at":"2024-11-30T20:03:42.349Z","updated_at":"2025-07-24T05:31:26.395Z","avatar_url":"https://github.com/SuperMedIntel.png","language":"Python","funding_links":[],"categories":["Paper List"],"sub_categories":["Follow-up Papers"],"readme":"\u003ch1 align=\"center\"\u003e● Medical SAM 2: Segment Medical Images As Video Via Segment Anything Model 2\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://discord.gg/DN4rvk95CC\"\u003e\n        \u003cimg alt=\"Discord\" src=\"https://img.shields.io/discord/1146610656779440188?logo=discord\u0026style=flat\u0026logoColor=white\"/\u003e\u003c/a\u003e\n    \u003cimg src=\"https://img.shields.io/static/v1?label=license\u0026message=GPL\u0026color=white\u0026style=flat\" alt=\"License\"/\u003e\n\u003c/p\u003e\n\nMedical SAM 2, or say MedSAM-2, is an advanced segmentation model that utilizes the [SAM 2](https://github.com/facebookresearch/segment-anything-2) framework to address both 2D and 3D medical\nimage segmentation tasks. This method is elaborated on the paper [Medical SAM 2: Segment Medical Images As Video Via Segment Anything Model 2](https://arxiv.org/abs/2408.00874) and [Medical SAM 2 Webpage](https://supermedintel.github.io/Medical-SAM2/).\n\n## 🔥 A Quick Overview \n \u003cdiv align=\"center\"\u003e\u003cimg width=\"880\" height=\"350\" src=\"https://github.com/MedicineToken/Medical-SAM2/blob/main/vis/framework.png\"\u003e\u003c/div\u003e\n \n## 🩻 3D Abdomen Segmentation Visualisation\n \u003cdiv align=\"center\"\u003e\u003cimg width=\"420\" height=\"420\" src=\"https://github.com/MedicineToken/Medical-SAM2/blob/main/vis/example.gif\"\u003e\u003c/div\u003e\n\n## Pre-trained weight\n\nWe released our pretrain weight [here](https://huggingface.co/jiayuanz3/MedSAM2_pretrain/tree/main)\n\n## 🧐 Requirement\n\n Install the environment:\n\n ``conda env create -f environment.yml``\n\n ``conda activate medsam2``\n\n You can download SAM2 checkpoint from checkpoints folder:\n \n ``bash download_ckpts.sh``\n\n Further Note: We tested on the following system environment and you may have to handle some issue due to system difference.\n```\nOperating System: Ubuntu 22.04\nConda Version: 23.7.4\nPython Version: 3.12.4\n```\n\n ## 🎯 Example Cases\n #### Download REFUGE or BCTV or your own dataset and put in the ``data`` folder, create the folder if it does not exist ⚒️\n \n ### 2D case - REFUGE Optic-cup Segmentation from Fundus Images\n\n**Step1:** Download pre-processed [REFUGE](https://refuge.grand-challenge.org/) dataset manually from [here](https://huggingface.co/datasets/jiayuanz3/REFUGE/tree/main), or using command lines:\n\n ``wget https://huggingface.co/datasets/jiayuanz3/REFUGE/resolve/main/REFUGE.zip``\n\n ``unzip REFUGE.zip``\n\n **Step2:** Run the training and validation by:\n \n``python train_2d.py -net sam2 -exp_name REFUGE_MedSAM2 -vis 1 -sam_ckpt ./checkpoints/sam2_hiera_small.pt -sam_config sam2_hiera_s -image_size 1024 -out_size 1024 -b 4 -val_freq 1 -dataset REFUGE -data_path ./data/REFUGE``\n\n ### 3D case - Abdominal Multiple Organs Segmentation\n \n **Step1:** Download pre-processed [BTCV](https://www.synapse.org/#!Synapse:syn3193805/wiki/217752) dataset manually from [here](https://huggingface.co/datasets/jiayuanz3/btcv/tree/main), or using command lines:\n\n ``wget https://huggingface.co/datasets/jiayuanz3/btcv/resolve/main/btcv.zip``\n\n ``unzip btcv.zip``\n\n**Step2:** Run the training and validation by:\n\n\n ``python train_3d.py -net sam2 -exp_name BTCV_MedSAM2 -sam_ckpt ./checkpoints/sam2_hiera_small.pt -sam_config sam2_hiera_s -image_size 1024 -val_freq 1 -prompt bbox -prompt_freq 2 -dataset btcv -data_path ./data/btcv``\n\n\n## 🚨 News\n- 24-12-04. Our Medical SAM 2 paper was updated on Arxiv with new insights and results\n- 24-08-05. Our Medical SAM 2 paper **ranked #1 Paper of the day** collected by AK on Hugging Face 🤗\n- 24-08-05. Update 3D example details and pre-processed BTCV dataset download link 🔗\n- 24-08-05. Update 2D example details and pre-processed REFUGE dataset download link 🔗\n- 24-08-05. Our Medical SAM 2 paper was available online 🥳\n- 24-08-05. Our Medical SAM 2 code was available on Github 🥳\n- 24-07-30. The SAM 2 model was released 🤩\n\n## 📝 Cite\n ~~~\n@misc{zhu2024medical,\n    title={Medical SAM 2: Segment medical images as video via Segment Anything Model 2},\n    author={Jiayuan Zhu and Abdullah Hamdi and Yunli Qi and Yueming Jin and Junde Wu},\n    year={2024},\n    eprint={2408.00874},\n    archivePrefix={arXiv},\n    primaryClass={cs.CV}\n}\n ~~~\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSuperMedIntel%2FMedical-SAM2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSuperMedIntel%2FMedical-SAM2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSuperMedIntel%2FMedical-SAM2/lists"}