ctrl+z
)c
)ctrl+s
)ctrl
to drag the zoomed imagealt
to change the brush to eraserThe code requires python>=3.8
, as well as pytorch>=1.7
and torchvision>=0.8
. Please follow the instructions here to install both PyTorch and TorchVision dependencies. Installing both PyTorch and TorchVision with CUDA support is strongly recommended.
We have tested:
Python 3.8
pytorch 2.0.0 (py3.8_cuda11.7_cudnn8.5.0_0)
torchvision 0.15.0
git clone https://github.com/derekray311511/SAM-webui.git
cd SAM-webui; pip install -e .
pip install opencv-python pycocotools matplotlib onnxruntime onnx flask flask_cors
You can download the model checkpoints here.
MODEL_TYPE: vit_h
, vit_l
, vit_b
python app.py --model_type vit_h --checkpoint ../models/sam_vit_h_4b8939.pth
If you want to run on cpu,
python app.py --model_type vit_h --checkpoint ../models/sam_vit_h_4b8939.pth --device cpu