Skip to content

This project focuses on image segmentation using the Segment Anything Model (SAM), with points and bounding boxes as prompt encoders.

License

Notifications You must be signed in to change notification settings

wicaksonohanif/image_segmentation_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🖼️ Image Segmentation Application Using Segment Anything Model (SAM)

Alt Text

🔎 About

This project focuses on image segmentation using the Segment Anything Model (SAM), with points and bounding boxes as prompt encoders.

Project languages:

  • en

📦 Dependencies

Name Version
streamlit 1.32.2
streamlit-plotly-events 0.0.6
numpy 1.26.4
opencv-python 4.12.0.88
pillow 10.4.0
torch 2.8.0+cu126
plotly 6.3.0
segment_anything 1.0
matplotlib 3.10.5
onnx 1.18.0
pycocotools 2.0.10
onnxruntime 1.22.1

🖥️ Requirements

  • Operating System (OS): Windows 10, Mac, Linux.
  • python>=3.8, pytorch>=1.7 and torchvision>=0.8
  • Integrated Development Environment (IDE): VSCode.
  • Web Browser: Google Chrome, Microsoft Edge, Firefox, Safari.

⬇️ Installation

Make a directory

mkdir img_segmentation_app
cd img_segmentation_app

Create and activate environment

python -m venv venv
venv\Scripts\activate 

Install dependencies

pip install --upgrade typing-extensions

for CUDA compute platform:

pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu126

for CPU only:

pip3 install torch torchvision

pip install git+https://github.com/facebookresearch/segment-anything.git
pip install streamlit==1.32.2 streamlit-drawable-canvas opencv-python pillow numpy matplotlib pycocotools onnxruntime onnx 

Download model

wget https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth -O sam_vit_b.pth

Clone Repository

git clone https://github.com/wicaksonohanif/image_segmentation_project.git

Run App.

streamlit run app4.py

🥼 Author(s) / Contributor(s)

  • Wicaksono Hanif Supriyanto

📚 References

  • Kirillov, A., Mintun, E., Ravi, N., Mao, H., Rolland, C., Gustafson, L., Xiao, T., Whitehead, S., Berg, A. C., Lo, W.-Y., Dollár, P., & Girshick, R. (2023). Segment Anything. arXiv. https://arxiv.org/abs/2304.02643

About

This project focuses on image segmentation using the Segment Anything Model (SAM), with points and bounding boxes as prompt encoders.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages