SAM2 connection - 403 error

Hi,

I hosted my SAM2 model on server x. However, when I try to connect it to Label Studio I get a 403 error. Can anyone help on how to fix this?

The thing is I am able to access the model and see the status from my browser but when I try to connect it it says that the health check has failed.

Where are you hosting your SAM2 model server? Make sure you’re using the external IP address and that you’re on the exposed port.

I am hosting it on a localhost.

If you’re hosting your model on localhost, and your Label Studio is running in a different localhost, you’re going to hit an issue where “localhost” doesn’t resolve to the correct instance. Instead, try running ngrok to get a URL to your model server using the following command (I’m going to assume that your model is being hosted on port 9090, but you can change the command for whatever port you’re using).

ngrok http https://localhost:9090

Then, you can take the forwarding address that is provided by ngrok and use that. I hope this helps!