{"id":22067880,"url":"https://github.com/DeepMed-Lab-ECNU/FS_MedSAM2","last_synced_at":"2025-07-24T05:31:09.070Z","repository":{"id":255669536,"uuid":"853147182","full_name":"DeepMed-Lab-ECNU/FS_MedSAM2","owner":"DeepMed-Lab-ECNU","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-20T06:05:32.000Z","size":6707,"stargazers_count":30,"open_issues_count":3,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-11-30T20:04:33.861Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DeepMed-Lab-ECNU.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-09-06T04:45:09.000Z","updated_at":"2024-11-22T07:41:13.000Z","dependencies_parsed_at":"2024-09-11T23:31:45.725Z","dependency_job_id":"8246ea93-fdf8-4c09-978b-284099554664","html_url":"https://github.com/DeepMed-Lab-ECNU/FS_MedSAM2","commit_stats":null,"previous_names":["deepmed-lab-ecnu/fs_medsam2"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DeepMed-Lab-ECNU/FS_MedSAM2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepMed-Lab-ECNU%2FFS_MedSAM2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepMed-Lab-ECNU%2FFS_MedSAM2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepMed-Lab-ECNU%2FFS_MedSAM2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepMed-Lab-ECNU%2FFS_MedSAM2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeepMed-Lab-ECNU","download_url":"https://codeload.github.com/DeepMed-Lab-ECNU/FS_MedSAM2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepMed-Lab-ECNU%2FFS_MedSAM2/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":[],"created_at":"2024-11-30T20:03:35.311Z","updated_at":"2025-07-24T05:31:06.769Z","avatar_url":"https://github.com/DeepMed-Lab-ECNU.png","language":"Python","funding_links":[],"categories":["Paper List"],"sub_categories":["Follow-up Papers"],"readme":"# FS_MedSAM2: Exploring the Potential of SAM2 for Few-Shot Medical Image Segmentation without Fine-tuning\n\n[arxiv](https://arxiv.org/abs/2409.04298)\n\n## News\n\nWe provide `example_data` folder, which contains some example data for anyone who want to try this code.\n\n\n## Getting Strated\n\n### Data preparation\n\nYou can obtain the data by following steps, or directly obtain the data by [Baidu Cloud](https://pan.baidu.com/s/1DPqK3Qps0h5ZU2EzD1kSwg?pwd=t9vu) (password: t9vu).\n\n1. Follow [SSL_ALPNet](https://github.com/cheng-01037/Self-supervised-Fewshot-Medical-Image-Segmentation/tree/2f2a22b74890cb9ad5e56ac234ea02b9f1c7a535) to create SSL_ALPNet project at  `/path/to/SSL_ALPNet`;\n2. Process Synapse-CT and CHAOS-MRI datasets follow SSL_ALPNet;\n3. Place `validation_wopred.py` in the `/path/to/SSL_ALPNet` directory, update the `saved_npz_path = '/path/to/saved_npz'`, and run it using either `/path/to/SSL_ALPNet/test_ssl_abdominal_ct.sh` or `/path/to/SSL_ALPNet/test_ssl_abdominal_mri.sh`.\n\n### Experiments Reproduction\n\n1. Based on the official repository of [SAM2](https://github.com/facebookresearch/segment-anything-2), deploy SAM2 locally at `/path/to/SAM2`;\n2. Move the files and folders from this repository, `/sam2` and those under `/notebooks`, to the corresponding folder at `/path/to/SAM2/sam2` and `/path/to/SAM2/notebooks`. e.g, move `/FS_MedSAM2/sam2/build_fsmedsam2.py` under `/path/to/SAM2/sam2/build_fsmedsam2.py`.\n3. After changing the `saved_npz_path = '/path/to/saved_npz'` and `ckpt_path = '/path/to/ckpt'`, eval FS_MedSAM2:\n```\ncd /path/to/SAM2/notebooks\npython infer_fsmedsam2_by_slice.py # infer 1S1Q\npython infer_fsmedsam2_by_volume.py # infer S1SFQ from top\npython infer_fsmedsam2_by_volume_from_middle.py # infer S1SFQ from middle\n```\n\n## Citation\n\nIf you find these projects useful, please consider citing:\n\n```bibtex\n@misc{bai2024fsmedsam2exploringpotentialsam2,\n      title={FS-MedSAM2: Exploring the Potential of SAM2 for Few-Shot Medical Image Segmentation without Fine-tuning}, \n      author={Yunhao Bai and Qinji Yu and Boxiang Yun and Dakai Jin and Yingda Xia and Yan Wang},\n      year={2024},\n      eprint={2409.04298},\n      archivePrefix={arXiv},\n      primaryClass={cs.CV},\n      url={https://arxiv.org/abs/2409.04298}, \n}\n\n```\n\n\n## Questions\nIf you have any questions, welcome contact me at 'yhbai@stu.ecnu.edu.cn'\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDeepMed-Lab-ECNU%2FFS_MedSAM2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDeepMed-Lab-ECNU%2FFS_MedSAM2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDeepMed-Lab-ECNU%2FFS_MedSAM2/lists"}