Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yas-sim/openvino-segment-anything-interactive-demo
Segment Anything Model (SAM) interactive demo with OpenVINO
https://github.com/yas-sim/openvino-segment-anything-interactive-demo
cpu demo efficientsam interactive openvino python sam segment-anything segment-anything-model segmentation
Last synced: about 2 hours ago
JSON representation
Segment Anything Model (SAM) interactive demo with OpenVINO
- Host: GitHub
- URL: https://github.com/yas-sim/openvino-segment-anything-interactive-demo
- Owner: yas-sim
- Created: 2024-02-19T09:59:40.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-02-22T02:22:36.000Z (9 months ago)
- Last Synced: 2024-04-23T00:09:54.193Z (7 months ago)
- Topics: cpu, demo, efficientsam, interactive, openvino, python, sam, segment-anything, segment-anything-model, segmentation
- Language: Python
- Homepage:
- Size: 19.8 MB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Segment Anything Model (SAM) interactive demo with OpenVINO
## Description
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](https://github.com/yformer/EfficientSAM.git):
- efficient-sam-vitt
- efficient-sam-vits## Programs / Files
|#|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|## How to run
1. Install prerequisites
```sh
python -m venv venv
venv/Scripts/activate
python -m pip install -U pip
pip install -U setuptools wheel
pip install -r requirements.txt
```2. Download the model
```sh
python download_and_convert.py
```3. Run the demo
Point and click on the image to kick inferencing.
```sh
python efficientsam.py
or
python efficientsam.py -i
```Command line options:
```sh
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
```
## Demo
`python .\efficientsam.py -i .\trolley.jpg -n 3 -f`
![demo](./resources/demo2.gif)## Test environment
- Windows 11
- Python 3.10.3
- OpenVINO 2023.3.0