{"id":28261198,"url":"https://github.com/nerfstudio-project/nerfview","last_synced_at":"2025-06-16T00:32:03.282Z","repository":{"id":243150837,"uuid":"736183639","full_name":"nerfstudio-project/nerfview","owner":"nerfstudio-project","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-08T00:39:04.000Z","size":116,"stargazers_count":114,"open_issues_count":9,"forks_count":12,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-08T01:30:50.832Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nerfstudio-project.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-12-27T07:53:59.000Z","updated_at":"2025-06-08T00:39:09.000Z","dependencies_parsed_at":"2024-06-07T01:46:48.131Z","dependency_job_id":"29db7645-819b-4a09-9c99-a7d62db117d0","html_url":"https://github.com/nerfstudio-project/nerfview","commit_stats":null,"previous_names":["hangg7/nerfview"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/nerfstudio-project/nerfview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerfstudio-project%2Fnerfview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerfstudio-project%2Fnerfview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerfstudio-project%2Fnerfview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerfstudio-project%2Fnerfview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nerfstudio-project","download_url":"https://codeload.github.com/nerfstudio-project/nerfview/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerfstudio-project%2Fnerfview/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259978383,"owners_count":22941124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-20T06:05:30.115Z","updated_at":"2025-06-16T00:32:03.265Z","avatar_url":"https://github.com/nerfstudio-project.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nerfview\n\n\u003cp align=\"left\"\u003e\n    \u003ca href=\"https://github.com/hangg7/nerfview/actions/workflows/core_tests.yml\"\u003e\n        \u003cimg alt=\"core-tests\" src=\"https://github.com/hangg7/nerfview/actions/workflows/core_tests.yml/badge.svg?branch=main\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/nerfview/\"\u003e\n        \u003cimg alt=\"codecov\" src=\"https://img.shields.io/pypi/pyversions/nerfview\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nnerfview is a minimal\\* web viewer for interactive NeRF rendering. It is largely\ninspired by [nerfstudio's\nviewer](https://github.com/nerfstudio-project/nerfstudio), but with a\nstandalone packaging and simple API to quickly integrate into your own research\nprojects.\n\n\\*The whole package contains two files and is less than 400 lines of code.\n\n## Installation\n\nThis package requires Python 3.8+.\n\nFor existing project, you can install it via pip:\n\n```bash\npip install nerfview\n```\n\nTo run our examples, you can clone this repository and then install it locally:\n\n```bash\ngit clone https://github.com/nerfstudio-project/nerfview\n# Install torch first.\npip install torch\n# Then this repo and dependencies for running examples. Note that `gsplat`\n# requires compilation and this will take some time for the first time.\npip install -e .\npip install -r examples/requirements.txt\n```\n\n## Usage\n\nnerfview is built on [viser](https://viser.studio/latest/) and provides a\nsimple API for interactive viewing.\n\nThe canonical usage is as follows:\n\n```python\nfrom typing import Tuple\n\nimport viser\nimport nerfview\n\n\ndef render_fn(\n    camera_state: nerfview.CameraState, render_tab_state: nerfview.RenderTabState\n) -\u003e np.ndarray:\n    # Parse camera state for camera-to-world matrix (c2w) and intrinsic (K) as\n    # float64 numpy arrays.\n    if render_tab_state.preview_render:\n        width = render_tab_state.render_width\n        height = render_tab_state.render_height\n    else:\n        width = render_tab_state.viewer_width\n        height = render_tab_state.viewer_height\n\n    c2w = camera_state.c2w\n    K = camera_state.get_K([width, height])\n    # Do your things and get an image as a uint8 numpy array.\n    img = your_rendering_logic(...)\n    return img\n\n# Initialize a viser server and our viewer.\nserver = viser.ViserServer(verbose=False)\nviewer = nerfview.Viewer(server=server, render_fn=render_fn, mode='rendering')\n```\n\nIt will start a viser server and render the image from a camera that you can interact with.\n\n## Examples\n\nWe provide a few examples ranging from toy rendering to real-world NeRF training\napplications. Click on the dropdown to see more details. You can always ask for\nhelp message by the `-h` flag.\n\n\u003cdetails\u003e\n\u003csummary\u003eRendering a dummy scene.\u003c/summary\u003e\n\u003cbr\u003e\n    \nhttps://github.com/hangg7/nerfview/assets/10098306/53a41fac-bce7-4820-be75-f90483bc22a0\n\nThis example is the best starting point to understand the basic API.\n\n```bash\npython examples/00_dummy_rendering.py\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRendering a dummy training process.\u003c/summary\u003e\n\u003cbr\u003e\n    \nhttps://github.com/hangg7/nerfview/assets/10098306/8b13ca4a-6aaa-46a7-a333-b889c2a4ac15\n\nThis example is the best starting point to understand the API for training time\nupdate.\n\n```bash\npython examples/01_dummy_training.py\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRendering a mesh scene.\u003c/summary\u003e\n\u003cbr\u003e\n    \nhttps://github.com/hangg7/nerfview/assets/10098306/84c9993f-82a3-48fb-9786-b5205bffcd6f\n\nThis example showcases how to interactively render a mesh by directly serving\nrendering results from \u003ca href=\"https://nvlabs.github.io/nvdiffrast/\"\u003envdiffrast\u003c/a\u003e.\n\n```bash\n# Only need to run once the first time.\nbash examples/assets/download_dragon_mesh.sh\nCUDA_VISIBLE_DEVICES=0 python examples/02_mesh_rendering.py\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRendering a pretrained 3DGS scene.\u003c/summary\u003e\n\u003cbr\u003e\n    \nhttps://github.com/hangg7/nerfview/assets/10098306/7b526105-8b6f-431c-9b49-10c821a3bd36\n\nThis example showcases how to render a pretrained 3DGS model using gsplat. The\nscene is cropped such that it is smaller to download. It is essentially the\n[simple viewer\nexample](https://github.com/nerfstudio-project/gsplat/blob/07d9188590ae1ee1e9ff7794a4217cc4591b44cf/examples/simple_viewer.py),\nwhich we include here to be self-contained.\n\n```bash\n# Only need to run once the first time.\nbash examples/assets/download_gsplat_ckpt.sh\nCUDA_VISIBLE_DEVICES=0 python examples/03_gsplat_rendering.py \\\n    --ckpt examples/assets/ckpt_6999_crop.pt\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRendering a 3DGS training process.\u003c/summary\u003e\n\u003cbr\u003e\n    \nhttps://github.com/hangg7/nerfview/assets/10098306/640d4067-e410-49aa-86b8-325140dd73a8\n\nThis example showcases how to render while training 3DGS on mip-NeRF's garden\nscene using gsplat. It is essentially the [simple trainer\nexample](https://github.com/nerfstudio-project/gsplat/blob/07d9188590ae1ee1e9ff7794a4217cc4591b44cf/examples/simple_trainer.py),\nwhich we include here to be self-contained.\n\n```bash\n# Only need to run once the first time.\nbash examples/assets/download_colmap_garden.sh\nCUDA_VISIBLE_DEVICES=0 python examples/04_gsplat_training.py \\\n    --data_dir examples/assets/colmap_garden/ \\\n    --data_factor 8 \\\n    --result_dir results/garden/\n```\n\n\u003c/details\u003e\n\n## Acknowledgement\n\nThis project cannot exist without the great work of\n[nerfstudio](https://github.com/nerfstudio-project/nerfstudio) and\n[viser](https://viser.studio/latest/). We rely on\n[nvdiffrast](https://nvlabs.github.io/nvdiffrast/) for the mesh example and\n[gsplat](https://docs.gsplat.studio/latest/) for the 3DGS examples. We thank\nthe authors for their great work and open-source spirit.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerfstudio-project%2Fnerfview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnerfstudio-project%2Fnerfview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerfstudio-project%2Fnerfview/lists"}