/XMem_ONNX

XMem ONNX Inference

Primary LanguagePythonMIT LicenseMIT

XMem ONNX

Warning

This repogitory is work in progress.

▼ What's this?

This repository is the ONNX inference code for the XMem tracker model included in Track-Anything.

Demo Result

result

source: https://github.com/gaomingqi/Track-Anything/tree/master/test_sample


Tested Environment

name version
os windows 10
cuda 11.8
python 3.10.15
uv 0.4.20



▼ Get Started

Get Code

git clone https://github.com/5PB-3-4/XMem_ONNX.git

Check Dependency Library

Check out requirement.txt.


Prepare Converted XMem ONNX File

Please convert models before Inference.


Run Inference

# Run
cd XMem_ONNX
python eval_1object.py --encode_key export/XMem-encode_key.onnx --encode_value export/XMem-encode_value-m1.onnx --decode export/XMem-decode-m1.onnx

# Parser option
python eval_1object.py -h

Tip

Only one object can be cut from this repository. If you want to cut out multiple objects, rewrite this.

# eval_1object.py
_, best_mask = cv2.threshold(masks, 10, 255, cv2.THRESH_BINARY+cv2.THRESH_OTSU)