Spaces:
Paused
Paused
Upload pytorch3d_stub/pytorch3d/vis/plotly_vis.py with huggingface_hub
Browse files
pytorch3d_stub/pytorch3d/vis/plotly_vis.py
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
"""pytorch3d.vis.plotly_vis stub with catch-all."""
|
| 2 |
import warnings
|
|
|
|
| 3 |
|
| 4 |
def __getattr__(name):
|
| 5 |
-
if name.startswith("
|
| 6 |
raise AttributeError(name)
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
return _Dummy
|
| 12 |
|
| 13 |
def plot_scene(plots, **kwargs):
|
| 14 |
return None
|
|
@@ -16,8 +16,27 @@ def plot_scene(plots, **kwargs):
|
|
| 16 |
def get_camera_wireframe(**kwargs):
|
| 17 |
return None
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
"""pytorch3d.vis.plotly_vis stub with catch-all."""
|
| 2 |
import warnings
|
| 3 |
+
from collections import namedtuple
|
| 4 |
|
| 5 |
def __getattr__(name):
|
| 6 |
+
if name.startswith("__") and name.endswith("__"):
|
| 7 |
raise AttributeError(name)
|
| 8 |
+
# Return a callable dummy for any missing name
|
| 9 |
+
def _dummy(*a, **kw): return None
|
| 10 |
+
_dummy.__name__ = name
|
| 11 |
+
return _dummy
|
|
|
|
| 12 |
|
| 13 |
def plot_scene(plots, **kwargs):
|
| 14 |
return None
|
|
|
|
| 16 |
def get_camera_wireframe(**kwargs):
|
| 17 |
return None
|
| 18 |
|
| 19 |
+
# These need to be namedtuples with _asdict() support because plot_scene.py calls ._asdict()
|
| 20 |
+
AxisArgs = namedtuple("AxisArgs", ["showgrid", "backgroundcolor", "showticklabels", "tickcolor", "gridcolor", "zeroline"],
|
| 21 |
+
defaults=[True, "rgb(230,230,230)", True, "black", "rgb(200,200,200)", False])
|
| 22 |
+
Lighting = namedtuple("Lighting", ["ambient", "diffuse", "specular", "roughness", "fresnel"],
|
| 23 |
+
defaults=[0.5, 1.0, 0.3, 0.5, 0.2])
|
| 24 |
|
| 25 |
+
# Explicitly define all private functions that plot_scene imports
|
| 26 |
+
def _add_camera_trace(fig, cameras, trace_name, subplot_idx, ncols, camera_scale, **kw):
|
| 27 |
+
pass
|
| 28 |
+
|
| 29 |
+
def _add_pointcloud_trace(fig, pointclouds, trace_name, subplot_idx, ncols, max_points=20000, marker_size=1, **kw):
|
| 30 |
+
pass
|
| 31 |
+
|
| 32 |
+
def _add_ray_bundle_trace(fig, ray_bundle, trace_name, subplot_idx, ncols, *a, **kw):
|
| 33 |
+
pass
|
| 34 |
+
|
| 35 |
+
def _is_ray_bundle(obj):
|
| 36 |
+
return False
|
| 37 |
+
|
| 38 |
+
def _scale_camera_to_bounds(value, vrange, is_position):
|
| 39 |
+
return value
|
| 40 |
+
|
| 41 |
+
def _update_axes_bounds(verts_center, max_expand, current_layout):
|
| 42 |
+
pass
|