Repository: nerfstudio-project/nerfstudio

Issue:
Blank viewer
When I run nerfstudio on linux and open the viewer, I don't see the input image, just a blank coordinate system,please tell me why.
I can see training progress in the terminal。



Discussion:
Are you running locally or on a server? If on a server, are you forwarding the port? If locally, do you have a firewall? Can you send a screenshot of the viewer window and one of your terminal.
I run nerfstudio on ubuntu locally, there is my screenshot
![Uploading 51C0EB5CD28F96F81107CAA768B43A85.jpg…]()
![A192490CF4ADA6C66F54B2699C43596A](https://user-images.githubusercontent.com/104246718/232184430-574598b1-d6a4-42e3-8306-047a4b456d12.jpg)

![51C0EB5CD28F96F81107CAA768B43A85](https://user-images.githubusercontent.com/104246718/232185480-420285e5-8e4a-45bd-814a-2122315a7f5d.jpg)

I encountered the same issue. It can be displayed normally when using version 0.1.19, but it shows blank after upgrading to version 0.2.0.
@fanhongxing What URL are you navigating to?
> @fanhongxing What URL are you navigating to?

Thank you for your prompt reply.
0.2.0  https://viewer.nerf.studio/versions/23-04-10-0/?websocket_url=ws://localhost:7007
0.1.19  https://viewer.nerf.studio/versions/23-03-9-0/?websocket_url=ws://localhost:7007
@fanhongxing Are you using chrome? If so, can you go to `More Tools` -> `Developer Tools` -> `Console` and see if that reports any errors?
Can you also provide a screen shot.
Also what browser are you using?
I'm having the same issue. Output of chrome dev tools console is:
![image](https://user-images.githubusercontent.com/18286310/232606379-35a9dfd7-9699-4637-afe5-1184fb850cc4.png)
on link: https://viewer.nerf.studio/versions/23-04-10-0/?websocket_url=ws://localhost:7007

On 0.1.19 it is working fine.

Besides, I noticed that in the install of ns-install-cli it says the follwoing:
```
bash: ../home/user/nerfstudio/nerfstudio/viewer/app/src/modules/WebSocket/ViserMessages.tsx: Permission denied
bash: Wrote: command not found
```
Looks at some point it is trying to move a folder up for a global path (../home/....)?

Thanks for your support!
FYI the `ns-install-cli` error should be fixed by #1754. This should only impact the completions though.

As a datapoint I also just tried both 0.1.19 and 0.1.20 on both Chrome and Firefox; both are working on my end.
It worked for me when I just tried with a fresh install, ubuntu server, ubuntu and osx client, firefox and chrome.
I am running on the server and have forwarded the port.The browser is Edge.
![image](https://user-images.githubusercontent.com/41686308/232640470-fcc6f129-65ae-4f88-bf76-b5d2d48827e8.png)
![image](https://user-images.githubusercontent.com/41686308/232640520-a9c093b5-9ea2-4a4c-a9b9-64f4a93ea762.png)
![image](https://user-images.githubusercontent.com/41686308/232640631-5d145265-6296-4a24-90cc-a98fab0ced9e.png)


> @fanhongxing Are you using chrome? If so, can you go to `More Tools` -> `Developer Tools` -> `Console` and see if that reports any errors?


@fanhongxing You are forwarding port `7007` to `8591`, correct?
How did you install the package, `pip install nerfstudio` or `pip install -e .`? If the later, can you try rerunning it.
@tancik 
Yes, that's correct. I have tried both methods, pip install nerfstudio==0.2.0 and pip install -e ., but they both give the same issue.
![image](https://user-images.githubusercontent.com/41686308/232642613-6935df36-6b64-4bce-bd40-d106c3477652.png)

Can you try modifying the following line from `host="localhost"` to `host="0.0.0.0"` to see if that fixes it?
https://github.com/nerfstudio-project/nerfstudio/blob/c1c7a3b2831defd0f3ffd4d6cb410f2454d124c5/nerfstudio/viewer/server/viewer_state.py#L125
I'm also having the same issue right now, and that line change fixed it for me.
Also fixes the problem for me :+1: 



> Can you try modifying the following line from `host="localhost"` to `host="0.0.0.0"` to see if that fixes it?
> 
> https://github.com/nerfstudio-project/nerfstudio/blob/c1c7a3b2831defd0f3ffd4d6cb410f2454d124c5/nerfstudio/viewer/server/viewer_state.py#L125

@tancik Thanks! Changing host from 'localhost' to '0.0.0.0' can solve the problem! Another possible solution is to set the address of the remote server in local port forwarding to '127.0.0.1', instead of the address of the SSH server.
![image](https://user-images.githubusercontent.com/41686308/232772990-a479432c-2a4e-4895-9d25-b57483deb7ad.png)



Resolving patch:
diff --git a/nerfstudio/viewer/server/viewer_state.py b/nerfstudio/viewer/server/viewer_state.py
--- a/nerfstudio/viewer/server/viewer_state.py
+++ b/nerfstudio/viewer/server/viewer_state.py
@@ -125,7 +125,7 @@ def __init__(
 
         self.camera_message = None
 
-        self.viser_server = ViserServer(host="0.0.0.0", port=websocket_port)
+        self.viser_server = ViserServer(host="127.0.0.1", port=websocket_port)
 
         self.viser_server.register_handler(IsTrainingMessage, self._handle_is_training)
         self.viser_server.register_handler(SaveCheckpointMessage, self._handle_save_checkpoint)


Test patch: