This demo takes an image file and runs a SAM model using OpenVINO.
You can point to the input image with the mouse, and the demo program shows the segmentation result on the image.
This demo supports following models from yformer/EfficientSAM GitHub repo:
- efficient-sam-vitt
- efficient-sam-vits
# | File name | Description |
---|---|---|
1 | download_and_convert.py | Clone the EfficientSAM GitHub repo and convert the model into OpenVINO IR model. |
2 | efficientsam.py | Run the EfficientSAM interactive demo with OpenVINO |
- Install prerequisites
python -m venv venv
venv/Scripts/activate
python -m pip install -U pip
pip install -U setuptools wheel
pip install -r requirements.txt
- Download the model
python download_and_convert.py
- Run the demo Point and click on the image to kick inferencing.
python efficientsam.py
or
python efficientsam.py -i <image_file_name>
Command line options:
options:
-h, --help show this help message and exit
-i INPUT, --input INPUT
Path to an input image file
-n NUM_POINTS, --num_points NUM_POINTS
Number of points for an inference (default:1)
-f, --full_screen Full screen mode
python .\efficientsam.py -i .\trolley.jpg -n 3 -f
- Windows 11
- Python 3.10.3
- OpenVINO 2023.3.0