Open rango886 opened 1 week ago
Hi @rango886, to access it from another machine, you'll also need to set the backend API address, which is specified as the API_URL
env in this line https://github.com/facebookresearch/sam2/blob/c98aa6bea377d5c000cdc80197ce402dbf5304dc/demo/backend/server/app_conf.py#L14 and set to a local address http://localhost:7263
in docker-compose.yaml
in https://github.com/facebookresearch/sam2/blob/c98aa6bea377d5c000cdc80197ce402dbf5304dc/docker-compose.yaml#L26
You can change it to http://192.168.x.x:7263
(i.e. the server machine's IP address running the backend), so that it can be accessed from other hosts. Hope this resolves your issue
Hi @rango886, to access it from another machine, you'll also need to set the backend API address, which is specified as the
API_URL
env in this lineand set to a local address
http://localhost:7263
indocker-compose.yaml
in https://github.com/facebookresearch/sam2/blob/c98aa6bea377d5c000cdc80197ce402dbf5304dc/docker-compose.yaml#L26You can change it to
http://192.168.x.x:7263
(i.e. the server machine's IP address running the backend), so that it can be accessed from other hosts. Hope this resolves your issue
It seems that it doesn't work. After modifying the environment variable. I found that it is displayed that the browser does not support video features. I am using the latest version of Chrome. I found on the Internet that the front end may use this browser API https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder . For this API, local access does not use https, while within the local area network, https is required for use.
Please modify Chrome settings to enable the VideoEncoder feature when accessing over HTTP.
chrome://flags/
in your chrome.Please modify Chrome settings to enable the VideoEncoder feature when accessing over HTTP.
- Open
chrome://flags/
in your chrome.- Add your IP address to the Insecure origins treated as secure setting and relaunch the browser.
Thank you. It can be used in the local area network now. However, it is also necessary to click this button and set the IP address of the local area network to be able to use it.
Hi @rango886, to access it from another machine, you'll also need to set the backend API address, which is specified as the
API_URL
env in this lineand set to a local address
http://localhost:7263
indocker-compose.yaml
in https://github.com/facebookresearch/sam2/blob/c98aa6bea377d5c000cdc80197ce402dbf5304dc/docker-compose.yaml#L26You can change it to
http://192.168.x.x:7263
(i.e. the server machine's IP address running the backend), so that it can be accessed from other hosts. Hope this resolves your issue
Didn't work for me. In the console I still see requests to http://localhost:7263 I worked around it with
socat TCP-LISTEN:7263,reuseaddr,fork TCP:192.168.178.56:7263
There are currently different places for changing the server endpoint:
Frontend
The endpoint is also stored in local storage, which has precedence over the value in the DemoConfig.tsx
. Just in case, make sure to delete the local storage key before opening the site (or use the browser's incognito mode) or change the endpoint via the settings modal shared above:
localStorage.removeItem('SAM2_SETTINGS_KEY')
Backend
Note: there might be CORS restrictions if the page isn't loaded from localhost
After deploying an application with Docker, I can access it on the host machine using 127.0.0.1:7262. However, when I try to access it from other devices on the local network using 192.168.x.x IP address, I get a "Uh oh, this browser isn’t supported." error.