jboth commited on
Commit
ae15956
·
verified ·
1 Parent(s): 49802f9

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
- class _Dummy:
8
- def __init__(self, *a, **kw): pass
9
- def __call__(self, *a, **kw): return None
10
- _Dummy.__name__ = _Dummy.__qualname__ = name
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
- class AxisArgs:
20
- def __init__(self, **kw): pass
 
 
 
21
 
22
- class Lighting:
23
- def __init__(self, **kw): pass
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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