-
set up a virtual environment.
git clone https://github.com/PramaLLC/BEN2.git cd BEN2 conda create -n ben2 -y python=3.11 conda activate ben2 pip install git+https://github.com/PramaLLC/BEN2.git pip install onnxsim pip install onnx pip install onnxscript pip install opencv-python -
download checkpoint
mkdir -p checkpoint wget https://huggingface.co/PramaLLC/BEN2/resolve/main/BEN2_Base.pth -P checkpoint -
check pytorch model inference
cd .. python infer.py
-
generate onnx file
python onnx_export.py -
generate tensorrt model
python onnx2trt.py
-
input size : 512
- [TRT_E] 100 iterations time: 3.6876 [sec]
- [TRT_E] Average FPS: 27.12 [fps]
- [TRT_E] Average inference time: 36.88 [msec]
-
input size : 1024
- [TRT_E] 100 iterations time: 11.9791 [sec]
- [TRT_E] Average FPS: 8.35 [fps]
- [TRT_E] Average inference time: 119.79 [msec]
-
BEN: Using Confidence-Guided Matting for Dichotomous Image Segmentation