Home

Awesome

ONNX-SAM2-Segment-Anything

!ONNX-SAM2-Segment-Anything

Important

Installation

git clone https://github.com/ibaiGorordo/ONNX-SAM2-Segment-Anything.git
cd ONNX-SAM2-Segment-Anything
pip install -r requirements.txt

ONNX Runtime

For Nvidia GPU computers: pip install onnxruntime-gpu

Otherwise: pip install onnxruntime

ONNX model

Original Semgent Anything Model 2 (SAM2)

The original SAM2 model can be found in this repository: SAM2 Repository

Examples

!ONNX-SAM2-Segment-Anything-iMAGE

Image inference:

Runs the image segmentation model on an image given some points defined in the script.

python image_segmentation.py

Usage:

!ONNX-SAM2-Segment-Anything

SAM2 Annotation App:

A minimal GUI to annotate images with the SAM2 model.

python webcam_depth_estimation.py

Annotation Controls (Video: https://youtu.be/9lW3_g1fjnA?si=X49Vz1ow45NMMYVn)

References: