### Run Quickstart Script Source: https://github.com/joey-s-liu/medsam3/blob/main/PROJECT_STRUCTURE.txt Execute the main quickstart script to set up the project environment. ```bash $ ./quickstart.sh ``` -------------------------------- ### Install MedSAM3 Dependencies Source: https://github.com/joey-s-liu/medsam3/blob/main/README.md Clone the MedSAM3 repository and install its dependencies. Ensure you log in to Hugging Face with your token. ```bash git clone https://github.com/Joey-S-Liu/MedSAM3.git cd MedSAM3 pip install -e . hf auth login # Paste your token when prompted ``` -------------------------------- ### Create Output Directory for Data Preparation Source: https://github.com/joey-s-liu/medsam3/blob/main/PROJECT_STRUCTURE.txt Use the prepare_data.py script to create the output directory for processed data. ```python python prepare_data.py create --output_dir data ``` -------------------------------- ### Train MedSAM3 Model Source: https://github.com/joey-s-liu/medsam3/blob/main/README.md Initiate the training process for the MedSAM3 model using a specified configuration file. ```bash python3 train_sam3_lora_native.py --config configs/full_lora_config.yaml ``` -------------------------------- ### Run Inference with LoRA Weights and Text Prompt Source: https://github.com/joey-s-liu/medsam3/blob/main/PROJECT_STRUCTURE.txt Perform inference using trained LoRA weights. Provide the path to the LoRA weights, the image to process, and a text prompt. ```python python inference.py \ --lora_weights outputs/sam3_lora/best_model/lora_weights.pt \ --image test.jpg \ --text_prompt "yellow school bus" ``` -------------------------------- ### Train MedSAM3 Model with LoRA Source: https://github.com/joey-s-liu/medsam3/blob/main/PROJECT_STRUCTURE.txt Initiate the training process for the MedSAM3 model using LoRA configuration. Specify the configuration file path. ```python python train_sam3_lora.py --config configs/base_config.yaml ``` -------------------------------- ### Run Inference with MedSAM3 Source: https://github.com/joey-s-liu/medsam3/blob/main/README.md Execute the inference script with specified configuration, image, prompt, and output settings. Adjust threshold and nms-iou for optimal results based on modality and target. ```bash python3 infer_sam.py \ --config configs/full_lora_config.yaml \ --image path/to/image.jpg \ --prompt "skin lesion" \ --threshold 0.5 \ --nms-iou 0.5 \ --output skin_lesion.png ``` -------------------------------- ### Prepare COCO JSON Data Source: https://github.com/joey-s-liu/medsam3/blob/main/PROJECT_STRUCTURE.txt Process COCO JSON annotations and images to prepare data for training. Specify the COCO JSON file, image directory, and output directory. ```python python prepare_data.py coco --coco_json annotations.json \ --images_dir images/ \ --output_dir data ``` -------------------------------- ### MedSAM3 Project Citation Source: https://github.com/joey-s-liu/medsam3/blob/main/README.md BibTeX entry for citing the MedSAM3 project. Include this in your research papers if the project is utilized. ```bibtex @misc{liu2025medsam3delvingsegmentmedical, title={MedSAM3: Delving into Segment Anything with Medical Concepts}, author={Anglin Liu and Rundong Xue and Xu R. Cao and Yifan Shen and Yi Lu and Xiang Li and Qianqian Chen and Jintai Chen}, year={2025}, eprint={2511.19046}, archivePrefix={arXiv}, primaryClass={cs.CV}, url={https://arxiv.org/abs/2511.19046}, } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.