Views
No views yet
.pth file.
There are three types of model. They are, from the biggest to the smallest, vit_h, vit_l and vit_b.
It is advised to use vit_b as it is smaller and faster, at the cost of a lower quality segmentation.checkpoint.pth model downloaded in the previous step.1mkdir temp
2cd temp1git clone git@github.com:vietanhdev/samexporter.git
2git clone git@github.com:facebookresearch/segment-anything.git1pip install -e ./segment-anything
2pip install torchvision==0.16.1 onnx==1.15.0 onnxruntime==1.15.1 timm==0.9.121cd samexporter
2python -m samexporter.export_encoder --checkpoint ../checkpoint.pth --output ../encoder.onnx --model-type vit_b
3python -m samexporter.export_decoder --checkpoint ../checkpoint.pth --output ../decoder.onnx --model-type vit_b --return-single-maskvit_b)1cd $NIMUS_IMAGE_DIR
2cp encoder.onnx public/onnx-models/sam/$MODEL_NAME
3cp decoder.onnx public/onnx-models/sam/$MODEL_NAME