-
Clone the repository:
git clone https://github.com/m15kh/SAM.git
-
Navigate to the
sam-v1
directory:cd sam-v1
-
Clone the Segment Anything repository and install it:
git clone [email protected]:facebookresearch/segment-anything.git cd segment-anything pip install -e .
-
Install the required Python packages:
pip install opencv-python pycocotools matplotlib onnxruntime onnx
-
Navigate to the
sam-v1/checkpoint
directory:cd ../checkpoint
-
Download the checkpoint file:
wget https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth
-
Ensure your input image is placed in the
img
directory and update theconfig.json
file with the correctinput_image_path
. -
Run the pipeline:
python pipeline.py
-
The output will be saved in the
output
directory.