https://github.com/google-research/visu3d

3d without friction (Torch, TF, Jax, Numpy)

https://github.com/google-research/visu3d

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.3%) to scientific vocabulary

Keywords

3d nerf plotly

Keywords from Contributors

jax deep-neural-networks distributed reinforcement-learning research transformer tpu deep-reinforcement-learning
Last synced: 4 months ago · JSON representation

Repository

3d without friction (Torch, TF, Jax, Numpy)

Basic Info
  • Host: GitHub
  • Owner: google-research
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Homepage: https://visu3d.readthedocs.io/
  • Size: 8.52 MB
Statistics
  • Stars: 158
  • Watchers: 4
  • Forks: 13
  • Open Issues: 7
  • Releases: 8
Topics
3d nerf plotly
Created almost 4 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog Contributing License

README.md

visu3d - 3D geometry made easy

Unittests PyPI version Documentation Status

visu3d is an abstraction layer between Torch/TF/Jax/Numpy and your program. It provides:

  • Standard primitives for 3d geometry (Ray, Camera, Transform,...). You can combine those standard primitives with your custom ones.
  • Everything is trivially visualizable with zero boilerplate. Inspect & debug camera poses, trajectories,...
  • All primitives are dataclass_array, dataclasses which can be reshaped, sliced,... as if they were numpy arrays.
  • Everything is extensible, you can gradually opt-in only for the features you need, and replace any standard primitive by your custom ones.

Core features

Everything is a `v3d.DataclassArray`: **dataclass behave like `np.array`** (with indexing, slicing, shape manipulation, vectorization,...). ```python # Single ray ray = v3d.Ray(pos=[0, 0, 0], dir=[1, 1, 1]) assert rays.shape == () # Multiple rays batched together rays = v3d.Ray(pos=np.zeros((B, H, W, 3)), dir=np.ones((B, H, W, 3))) assert rays.shape == (B, H, W) rays = rays.reshape('b h w -> b (h w)') # Native `einops` support top_left_ray = rays[..., 0, 0] # (b, h, w) -> (b,) rays = rays.flatten() rays = rays[rays.norm() > 0] # Filter invalid rays ```
Everything is **visualizable interactively** Every object has a `.fig` property for interactive visualization: ```python rays.fig # Plot the rays ``` Display multiple objects together: ```python v3d.make_fig([cam, rays, point_cloud]) ``` Auto-plot figures with Colab magic: ```python v3d.auto_plot_figs() # Once at the start of the Colab cam, rays, point_cloud # Tuple auto-displayed without `v3d.make_fig` call ```
Same code seamlessly **works across Torch, Jax, TensorFlow, Numpy**. ```python rays = rays.as_jax() # .as_tf(), as_np(), .as_jax() assert isinstance(rays.pos, jnp.ndarray) assert rays.xnp is jnp rays = rays.as_torch() assert isinstance(rays.pos, torch.Tensor) assert rays.xnp is torch ``` With native support for auto-diff, `jax.vmap`, `jax.tree_utils`,...

Privitives

Common primitives (`Ray`, `Camera`, `Transform`,...), so user can express intent, instead of math. ```python H, W = (256, 1024) cam_spec = v3d.PinholeCamera.from_focal( resolution=(H, W), focal_in_px=35., ) cam = v3d.Camera.from_look_at( spec=cam_spec, pos=[5, 5, 5], target=[0, 0, 0], # Camera looks at the scene center ) rays = cam.rays() # Rays in world coordinates # Project `(*shape, 3)` world coordinates into `(*shape, 2)` pixel coordinates. px_coords = cam.px_from_world @ point_cloud ``` See [the API](https://github.com/google-research/visu3d/tree/main/visu3d/__init__.py) for a full list of primitive.
Creating your own primitives is trivial. Converting any dataclass to dataclass array is trivial: * Inherit from `v3d.DataclassArray` * Use [`etils.array_types`](https://github.com/google/etils/blob/main/etils/array_types/README.md) to annotate the array fields (or exlicitly use `my_field: Any = dca.field(shape=, dtype=)` instead of `dataclasses.field`) ```python from etils.array_types import FloatArray class MyRay(v3d.DataclassArray): pos: FloatArray[..., 3] dir: FloatArray[..., 3] rays = MyRay(pos=jnp.zeros((H, W, 3)), dir=jnp.ones((H, W, 3))) assert rays.shape == (H, W) ``` `v3d` makes it easy to opt-in to the feature you need by implementing the corresponding protocol.

Documentation

The best way to get started is to try the Colab tutorials (in the documentation):

Installation:

sh pip install visu3d

Usage:

python import visu3d as v3d

Installation

sh pip install visu3d

This is not an official Google product.

Owner

  • Name: Google Research
  • Login: google-research
  • Kind: organization
  • Location: Earth

GitHub Events

Total
  • Watch event: 11
  • Delete event: 3
  • Issue comment event: 1
  • Push event: 8
  • Pull request event: 6
  • Fork event: 1
  • Create event: 2
Last Year
  • Watch event: 11
  • Delete event: 3
  • Issue comment event: 1
  • Push event: 8
  • Pull request event: 6
  • Fork event: 1
  • Create event: 2

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 114
  • Total Committers: 8
  • Avg Commits per committer: 14.25
  • Development Distribution Score (DDS): 0.096
Past Year
  • Commits: 2
  • Committers: 2
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.5
Top Committers
Name Email Commits
Etienne Pot e****t@g****m 103
The visu3d Authors n****y@g****m 5
bhack b****k 1
Peter Hawkins p****s@g****m 1
Marc van Zee m****e@g****m 1
Lena Martens l****s@g****m 1
Iurii Kemaev i****v@g****m 1
Achint Sharma g****a@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 6
  • Total pull requests: 111
  • Average time to close issues: 2 months
  • Average time to close pull requests: 28 days
  • Total issue authors: 4
  • Total pull request authors: 3
  • Average comments per issue: 3.17
  • Average comments per pull request: 0.05
  • Merged pull requests: 20
  • Bot issues: 0
  • Bot pull requests: 109
Past Year
  • Issues: 1
  • Pull requests: 3
  • Average time to close issues: 6 minutes
  • Average time to close pull requests: 7 days
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 3.0
  • Average comments per pull request: 0.33
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 3
Top Authors
Issue Authors
  • Conchylicultor (2)
  • akshay-krishnan (2)
  • relh (1)
  • idaho777 (1)
Pull Request Authors
  • copybara-service[bot] (114)
  • bhack (1)
  • SauravMaheshkar (1)
Top Labels
Issue Labels
contributions-welcome (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 11,432 last-month
  • Total dependent packages: 2
    (may contain duplicates)
  • Total dependent repositories: 1
    (may contain duplicates)
  • Total versions: 18
  • Total maintainers: 1
proxy.golang.org: github.com/google-research/visu3d
  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 5 months ago
pypi.org: visu3d

3d geometry made easy.

  • Versions: 10
  • Dependent Packages: 2
  • Dependent Repositories: 1
  • Downloads: 11,432 Last month
Rankings
Downloads: 7.2%
Dependent packages count: 10.1%
Average: 13.0%
Dependent repos count: 21.6%
Maintainers (1)
Last synced: 5 months ago

Dependencies

.github/workflows/pytest_and_autopublish.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • etils-actions/pypi-auto-publish v1 composite
pyproject.toml pypi
  • dataclass_array *
  • einops *
  • etils [edc,enp,epath,epy,etree]
  • numpy *
  • typing_extensions *