Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add nerf viewer #40

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

add nerf viewer #40

wants to merge 18 commits into from

Conversation

WYK96
Copy link

@WYK96 WYK96 commented Apr 27, 2023

add nerf viewer client and server.

@CLAassistant
Copy link

CLAassistant commented Apr 27, 2023

CLA assistant check
All committers have signed the CLA.

@GACLove
Copy link
Member

GACLove commented May 5, 2023

  1. Add Architecture diagram in README.md
  2. Delete the top-level directory "nerf_viewer"
  3. Rename the directory "nerf_viewer" to "viewer":
  4. Rename the directory "bridge_server" to "server"
  5. Write a start.sh or start.py script to launch the server and client
  6. Generate a default .gitignore file, visit https://www.toptal.com/developers/gitignore.
  7. To delete unused files and modules

pip install -r ./requirements.txt
```

#### 2.2 Start Server
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"###" would be enough

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the typo. The title hierarchy issue has been fixed.


Visit http://localhost:3000/ in the browser:

![alt viewer](./doc/viewer.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we replace it with new vierwer screenshot? The coordinate axis on upper right corner is tilted.

Copy link
Author

@WYK96 WYK96 Jun 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original version of README.md is for debug purpose. In the lastest doc, the screenshots have been removed.

@@ -0,0 +1,85 @@
# Nerf Viewer Quick Start
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nerf -> NeRF

Copy link
Author

@WYK96 WYK96 Jun 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glitch fixed: Nerf Viewer -> XRNeRF Viewer

@@ -0,0 +1,85 @@
import atexit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we rename it to bridge_server.py? As there is no conflict, it is not necessary to add _subprocess suffix.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Renamed bridge_server_subprocess.py to bridge_server.py
  2. Renamed function run_bridge_server_as_subprocess to start_bridge_server


In the project directory, you can run:

### `npm start`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm start

Same as L17, L22 and L32

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This README.md is automatically generated by Create React App. It has been replaced to XRNerf Viewer.


### `npm run build` fails to minify

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Learn More section, as each subsection. only as one sentence, shall we use bullet point directly? For example,

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This README.md is automatically generated by Create React App. It has been replaced to XRNerf Viewer.

// },
// },
},
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented content if they are unnecessary anymore.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused code blocks removed.

@yl-1993
Copy link
Member

yl-1993 commented May 11, 2023

  1. Move two readme files to ${ROOT}/docs/en/visualization/, e.g., nerf_viewer.md, so it can also be viewed viareadthedocs.
  2. Move all png to ${ROOT}/resources/viewer/ and try to compress the single filesize under 10KB.

@yl-1993 yl-1993 requested a review from maoXyzt May 11, 2023 10:42
@maoXyzt
Copy link
Contributor

maoXyzt commented May 12, 2023

  • format *.py files via pre-commit hooks according to the project's .pre-commit-config.yaml
  • add one blank new line to the end of code files if there is not one.


Please follow the instructions in:

https://juejin.cn/post/7120267871950733320/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any installation instruction in English? Say https://github.com/nvm-sh/nvm#installing-and-updating.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original version of README.md is for debug purpose. In the lastest doc, the installation instructions has been updated so that it is suitable for non-chinese users.

conda activate BridgeServer

# install dependencies
pip install -r ./requirements.txt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a requirements folder in the root directory of the repository, where many different requirements files are named according to their functionality and placed here, such as requirements/synbody.txt. You can also consider renaming your requirements.txt to something like bridge_server.txt. In addition, most of the relative paths in our documentation are relative to the root directory of the repository, not to subdirectories like viewers.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For requriements, the dependencies list of server has been moved from
python/xrprimer/services/xrnerf/requirements.txt to requirements/service_xrnerf.txt.

For paths, they are now relative to the root directory of the repository, e.g., ./run.py to xrprimer/python/xrprimer/services/xrnerf/run.py.

Appreciate for the suggestion.

#### 2.2 Start Server

```
python ./run_viewer.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python ./run_viewer.py
python .python/tools/un_viewer.py

We often put files with a main function program entry point in the tools folder to distinguish them from files that are only called and not used as entry points.

@@ -0,0 +1 @@
.idea
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we merge this file with the .gitignore file in the root directory?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original .gitignore file is for debug purpose only. It has been removed now.

return False


def get_free_port(default_port: int = None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def get_free_port(default_port: int = None):
from typing import Union
def get_free_port(default_port: Union[int, None] = None):

Copy link
Author

@WYK96 WYK96 Jun 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default_port: int has been declared as default_port: Optional[int].

return False


def get_free_port(default_port: int = None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For users, there are two possible scenarios. In the first scenario, the user does not care which port is used as long as the service is started successfully and the port used is returned. The current function can meet this requirement. In the second scenario, the user may be required to use a specific port, such as port 80. If the target port is occupied, an exception should be thrown and there is no need to continue running. Considering these two scenarios, we can modify the parameter list of this function, for example:

  1. def bind_port(allow_random_port: bool, preferred_port: Union[int, None] = None) -> int:
  2. def bind_port(target_port: Union[int, None] = None) -> int:

In the first example, the allow_random_port parameter is used to determine which usage scenario to use, and preferred_port is the port number that is preferentially attempted. In the second example, the target_port parameter is used to determine the usage scenario. If it is provided, the target port must be used. If it is not provided, there are no requirements and any available port can be returned.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated port binding logics: if the user specified a port, the server will check whether the port is already in use and then create connections using zmq, otherwise the server will automatically find an available port.


def run_bridge_server_as_subprocess(
websocket_port: int,
zmq_port: Optional[int] = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ChatGPT:
In Python, Union[int, None] and Optional[int] are similar in that they both indicate that a variable can be either an integer or None. However, there is a subtle difference between them.

Union[int, None] explicitly specifies that the variable can be either an integer or None. It does not allow any other type to be assigned to it. On the other hand, Optional[int] is actually an alias for Union[int, None], which means it represents the same set of possible types. However, Optional[int] does not explicitly indicate that the variable cannot be assigned any other type.

Therefore, using Union[int, None] is more specific and explicit, and may help prevent type-related bugs in your code. However, both Optional[int] and Union[int, None] can be used interchangeably in most cases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt the response from ChatGPT. According to PEP484 which is the official definitions of python typing hints, Optional[...] is no more than a shorthand of Union[..., None]. It says in The typing module section:

Optional, defined by Optional[t] == Union[t, None]

So do the documentation of typing.Optional:

Optional[X] is equivalent to X | None (or Union[X, None]).

It's also recommended to use Optional[...] for readability. Since for complex types, we could combine Union with Optional. For example, from def foo(x: Optional[Union[str, pathlib.Path]] = None): ..., we know that foo accepts a path-like argument or None as default. And we can extract this complex type to be PathLike = Union[str, pathlib.Path] and def foo(x: Optional[PathLike] = None): .... Otherwise, we need two typings of Union[str, pathlib.Path, None] and Union[str, pathlib.Path].

There is a related disccusion at StackOverflow says why Optional is suggested:

https://stackoverflow.com/questions/51710037/how-should-i-use-the-optional-type-hint

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from ChatGPT:

In python, is there any difference between Optional[int] and Union[int, None]`?

Yes, there is a difference, but it's mainly in how they are expressed. Both Optional[int] and Union[int, None] represent the same type, which is either an integer or None. The difference lies in how you express this type annotation.

Optional[int] is a more concise and readable way to express a type that can either be an integer or None. It is equivalent to Union[int, None]. The Optional type is just a shorthand for a Union with None as one of the alternatives.

In Python, you can use both Optional[int] and Union[int, None] to annotate a variable or a function argument that accepts either an integer or None. However, it's generally recommended to use the Optional type for readability and simplicity.

from typing import Optional, Union

def example_optional(x: Optional[int]) -> None:
    print(x)

def example_union(x: Union[int, None]) -> None:
    print(x)

example_optional(42)  # Prints 42
example_optional(None)  # Prints None
example_union(42)  # Prints 42
example_union(None)  # Prints None

In both cases, the functions example_optional and example_union accept either an integer or None as their argument, and both function calls produce the same output.


And I asked ChatGPT about the practical difference in static type checkers mypy.

Is there any difference between Optional[int] and Union[int, None] when using python type checkers like mypy?

No, there is no difference between Optional[int] and Union[int, None] when using Python type checkers like mypy.

Optional[int] is actually a shorthand for Union[int, None], and they are equivalent in terms of type checking. Both indicate that the annotated variable can either be an integer or None.

Using Optional[int] is generally preferred as it is more concise and easier to read. However, if you are using an older version of Python or a type checker that does not support Optional, you can use Union[int, None] instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Optional[int] is equivalent to Union[int, None] whereas more concise and readable, we're using Optional as the type annotation.

def run_bridge_server_as_subprocess(
websocket_port: int,
zmq_port: Optional[int] = None,
ip_address: str = "127.0.0.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.0.0.0 may allow access to a larger range than 127.0.0.1. Should we change the default value to 0.0.0.0?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace the default ip address to 0.0.0.0 makes zmq fail to connect with client.

TODO: figure out why this happens.

time.sleep(0.5)

message = "The bridge server subprocess failed."
cleanup(process)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

process in cleanup is passed by arg list, but in poll_process it looks like a global var.
Considering that the process variable has a clear lifetime and these functions are strongly related to it, would it be better to rewrite this code as a class and access it through self.sub_process?

@@ -0,0 +1,5 @@
pyzmq==25.0.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import umsgpack
from typing import Tuple
import numpy as np
import cv2 as cv
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about not as cv? We use cv2 directly in other modules inside XRPrimer.

Copy link
Author

@WYK96 WYK96 Jun 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed cv to cv2. The OpenCV is used to generate fake images for debug purpose, which should be further replaced by the nerf backend.
TODO: remove the dependency once the nerf backend is ready.

elif str(self.state.resolution) == "1080":
return 1920, 1080
else:
print("invalid resolution")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check logger example in class.
self.logger.error(msg) logs the message in error level, if a file handler has been configured, the message will never be lost. After logging, by using raise ValueError, we can prevent the program from continuing to run and causing unexpected errors, which can make it easier for developers to identify the location where the error occurred.

Draw an image using current camera configuration.
"""

"""fetch data from state"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""fetch data from state"""
# fetch data from state

pre-commit will find everything breaks rules.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue has been fixed by pre-commit.

"""
Let the renderer relief for some time to avoid websocket blocking
"""
time.sleep(0.05)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 0.05? It looks like 20 fps. If the time parameter for sleep is a user-specified parameter that is set during construction or dynamically determined based on the program's running state, it may be better.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The relief time is a time step that the backend sleep for some time to avoid websocket blocking. The value of it needs to be further evaluated. A more reasonable relief time would be:

$relief\_time = time\_step - (backend\_inference\_elapsed + viewer\_render\_elapsed)$

e.g. If we want the viewer renders at 60fps, our per-frame budget is 16.6ms. Assuming that the nerf inference time is 5ms and viewer render latency is 4ms, the relif time is 16.6-5-4=7.6ms

Unfortunately, we do not have a really available backend up to now.

TODO: replace to a more reasonable relief time once the nerf backend is ready.

thread.start()
thread.join(timeout_in_sec)
except Exception as e:
print("Failed to start thread")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try:
thread.start()
thread.join(timeout_in_sec)
except Exception as e:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In most cases, we do not use Exception because it corresponds to too broad of an error category. If we can identify a specific type of error, such as RuntimeError or ValueError, we should only catch the known and specific types of errors.

@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.env.test.local
.env.production.local

npm-debug.log*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to redirect these logs to a designated path, such as logs/npm_log.txt?

},
},
},
// MuiIcon: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these lines does not work, and it is no important comment, please remove them from official commit. To keep them, push another branch in a forked repo.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused code blocks removed.


### 1.1 Install Dependencies

#### 1.1.1 Install NVM
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NVM is not a requirement but a recommendation.

Will it be better for users to choose their own method to install node.js?

And NVM could be an optional choice like:

Install node.js 18.15.

It's suggested to use `NVM` to install and manage `node.js` installations.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original version of README.md is for debug purpose. In the lastest doc, the installation guide has been replaced to:

The package.json contains dependencies to build the viewer, which can be installed using Node Package Manager(npm). It's suggested to manage Node.js installations with Node Version Manager(nvm). The installation instructions of nvm can be found here.


Please follow the instructions in:

https://juejin.cn/post/7120267871950733320/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This a blog in Chinese not suitable for non-Chinese users and only for windows platform. For i18n, post official installation instructions.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original version of README.md is for debug purpose. In the lastest doc, the link for nvm installation guidelines has been replaced from https://juejin.cn/post/7120267871950733320/ to https://heynode.com/tutorial/install-nodejs-locally-nvm/.


```shell
# install node 18.15.0
nvm install 18.15.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nodejs 18.15 could be precise enough. Don't pin the patch version.

Copy link
Author

@WYK96 WYK96 Jun 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch version has been removed: 18.15.0 -> 18.15

@@ -0,0 +1,5 @@
pyzmq==25.0.2
pyngrok==5.2.1
tornado
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pin tornado's major version to prevent incompatibility (i.e. tornado>=6,<7), since a major version update could probably break current codes.

def check_origin(self, origin: str) -> bool:
return True

def open(self, *args: str, **kwargs: str):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are args of List[str] & kwargs of Dict[str, str]?
Since they are not used, their typings could be omitted.

Comment on lines 1 to 10
import time
import base64
import pickle
import umsgpack
from typing import Tuple
import numpy as np
import cv2 as cv
from actions import UPDATE_STATE, UPDATE_RENDER_RESULT
from bridge_server_subprocess import run_bridge_server_as_subprocess
from visualizer import Viewer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imports unsorted.

Recommended to run isort to update all bridge_servers python files.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All python imports have been sorted by isort in pre-commit.

@@ -0,0 +1,38 @@
/* .App {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file includes only commented contents

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused file removed.

@@ -0,0 +1,31 @@
// /* eslint-disable no-underscore-dangle */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file includes only commented contents

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused file removed.


def run_bridge_server_as_subprocess(
websocket_port: int,
zmq_port: Optional[int] = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt the response from ChatGPT. According to PEP484 which is the official definitions of python typing hints, Optional[...] is no more than a shorthand of Union[..., None]. It says in The typing module section:

Optional, defined by Optional[t] == Union[t, None]

So do the documentation of typing.Optional:

Optional[X] is equivalent to X | None (or Union[X, None]).

It's also recommended to use Optional[...] for readability. Since for complex types, we could combine Union with Optional. For example, from def foo(x: Optional[Union[str, pathlib.Path]] = None): ..., we know that foo accepts a path-like argument or None as default. And we can extract this complex type to be PathLike = Union[str, pathlib.Path] and def foo(x: Optional[PathLike] = None): .... Otherwise, we need two typings of Union[str, pathlib.Path, None] and Union[str, pathlib.Path].

There is a related disccusion at StackOverflow says why Optional is suggested:

https://stackoverflow.com/questions/51710037/how-should-i-use-the-optional-type-hint


def run_bridge_server_as_subprocess(
websocket_port: int,
zmq_port: Optional[int] = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from ChatGPT:

In python, is there any difference between Optional[int] and Union[int, None]`?

Yes, there is a difference, but it's mainly in how they are expressed. Both Optional[int] and Union[int, None] represent the same type, which is either an integer or None. The difference lies in how you express this type annotation.

Optional[int] is a more concise and readable way to express a type that can either be an integer or None. It is equivalent to Union[int, None]. The Optional type is just a shorthand for a Union with None as one of the alternatives.

In Python, you can use both Optional[int] and Union[int, None] to annotate a variable or a function argument that accepts either an integer or None. However, it's generally recommended to use the Optional type for readability and simplicity.

from typing import Optional, Union

def example_optional(x: Optional[int]) -> None:
    print(x)

def example_union(x: Union[int, None]) -> None:
    print(x)

example_optional(42)  # Prints 42
example_optional(None)  # Prints None
example_union(42)  # Prints 42
example_union(None)  # Prints None

In both cases, the functions example_optional and example_union accept either an integer or None as their argument, and both function calls produce the same output.


And I asked ChatGPT about the practical difference in static type checkers mypy.

Is there any difference between Optional[int] and Union[int, None] when using python type checkers like mypy?

No, there is no difference between Optional[int] and Union[int, None] when using Python type checkers like mypy.

Optional[int] is actually a shorthand for Union[int, None], and they are equivalent in terms of type checking. Both indicate that the annotated variable can either be an integer or None.

Using Optional[int] is generally preferred as it is more concise and easier to read. However, if you are using an older version of Python or a type checker that does not support Optional, you can use Union[int, None] instead.

WYK96 added 12 commits June 6, 2023 11:15
…nderer/xrnerf

2. Move XRNerf bridge server from viewers/nerf_viewer/bridge_server to python/xrprimer/services/xrnerf
2. Optimized data flow that greatly reduces the react dom element refresh frequency
2.[improvement] Introduced 'typer' for CLI parsing and better printing functionality
…rer/xrnerf/, docs/en/services/xrnerf/ respectively;

2.[improvement] added an architecture diagram in the viewer doc;
3.[improvement] updated installation instructions
@WYK96
Copy link
Author

WYK96 commented Jun 7, 2023

  1. Move two readme files to ${ROOT}/docs/en/visualization/, e.g., nerf_viewer.md, so it can also be viewed viareadthedocs.
  2. Move all png to ${ROOT}/resources/viewer/ and try to compress the single filesize under 10KB.
  1. Moved client and server readme files to ${ROOT}/docs/en/web_renderer/xrnerf and ${ROOT}/docs/en/services/xrnerf, repectively.
  2. Moved helper images to ${ROOT}/resources. Since the original version of README.md is for debug purpose, the screenshots have been removed in the lastest doc.

@WYK96
Copy link
Author

WYK96 commented Jun 7, 2023

  1. Add Architecture diagram in README.md
  2. Delete the top-level directory "nerf_viewer"
  3. Rename the directory "nerf_viewer" to "viewer":
  4. Rename the directory "bridge_server" to "server"
  5. Write a start.sh or start.py script to launch the server and client
  6. Generate a default .gitignore file, visit https://www.toptal.com/developers/gitignore.
  7. To delete unused files and modules
  1. Added a framework figure in ${ROOT}/docs/en/web_renderer/xrnerf/README.md
  2. The top-level directory nerf_viewer has been deleted. Now the viewer client is on ${ROOT}/web_renderer/xrnerf and the viewer server is on ${ROOT}/python/xrprimer/services/xrnerf
  3. The directory ${ROOT}/viewers/nerf_viewer/client is renamed to ${ROOT}/web_renderer/xrnerf
  4. The directory ${ROOT}/viewers/nerf_viewer/bridge_server is renamed to ${ROOT}/python/xrprimer/services/xrnerf
  5. Added ${ROOT}/web_renderer/xrnerf/start.bat to launch the client and ${ROOT}/python/xrprimer/services/xrnerf/run.py to launch the server.
    TODO: test the framework on Linux systems and add a start.sh for client startup
  6. TODO: it seems that https://www.toptal.com/developers/gitignore does not provide an option to generate JavaScript and TypeScript .gitignore file. Need to be fixed later.
  7. Deleted redundant files and modules:
    • Removed redundant redux stored variables
    • Removed unused code blocks

@WYK96
Copy link
Author

WYK96 commented Jun 7, 2023

  • format *.py files via pre-commit hooks according to the project's .pre-commit-config.yaml
  • add one blank new line to the end of code files if there is not one.
  1. Reformatted python scripts with ${ROOT}/.pre-commit-config.yaml utilizing pre-commit hooks
  2. For each python script, added a new line at the end of file

WYK96 added 3 commits June 7, 2023 18:57
…rt, the server will check whether the port is already in use and then create connections using zmq, otherwise the server will automatically find an available port
@HaiyiMei HaiyiMei assigned HaiyiMei and unassigned HaiyiMei Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants