Skip to content

SAM on JS? (Segment Anything Model) #161

Open
@hpssjellis

Description

@hpssjellis

I have a JS file that does segmentation but it does not run SAM.

https://hpssjellis.github.io/my-examples-of-huggingfacejs/public/hug11-15b.html

SAM (Segment Anything Model) is now on Huggingface https://huggingface.co/docs/transformers/main/en/model_doc/sam

The main model is at facebook/sam-vit-huge

but when I try that model get errors different from the working default model facebook/detr-resnet-50-panoptic

The errors I am getting are


Uncaught (in promise) Error: Task not found for this model
    at HfInference.request (inference.js:125:15)
    at async HfInference.imageSegmentation (inference.js:78:12)
    at async myHugginFaceLoad (hug11-15b.html:26:36)


I am busy with some other coding. If not, I could probably solve this issue, but does anyone have any suggestions of what the problem is? It is most likely the model input or output parameters are slightly different.

If anyone gets my model working please post your version of my code here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    inference@huggingface/inference related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions