From fdcf368708d5e246df25dea5cf4e45a8b484a90f Mon Sep 17 00:00:00 2001 From: Jeremy Reizenstein Date: Thu, 29 Oct 2020 10:15:17 -0700 Subject: [PATCH] import vis parts separately Summary: We envision `pytorch3d.vis` to contain submodules with different dependencies. Allow (and require) them to be imported independently. Reviewed By: theschnitz Differential Revision: D24622519 fbshipit-source-id: 44840f70f5fd2bd410405bf09546024e48238744 --- docs/tutorials/render_colored_points.ipynb | 2 +- docs/tutorials/render_textured_meshes.ipynb | 3 ++- pytorch3d/vis/__init__.py | 6 ------ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/docs/tutorials/render_colored_points.ipynb b/docs/tutorials/render_colored_points.ipynb index 890a0425..25b223e8 100644 --- a/docs/tutorials/render_colored_points.ipynb +++ b/docs/tutorials/render_colored_points.ipynb @@ -67,7 +67,7 @@ "\n", "# Data structures and functions for rendering\n", "from pytorch3d.structures import Pointclouds\n", - "from pytorch3d.vis import AxisArgs, plot_batch_individually, plot_scene\n", + "from pytorch3d.vis.plotly_vis import AxisArgs, plot_batch_individually, plot_scene\n", "from pytorch3d.renderer import (\n", " look_at_view_transform,\n", " FoVOrthographicCameras, \n", diff --git a/docs/tutorials/render_textured_meshes.ipynb b/docs/tutorials/render_textured_meshes.ipynb index 657bdb96..e6f9c5f9 100644 --- a/docs/tutorials/render_textured_meshes.ipynb +++ b/docs/tutorials/render_textured_meshes.ipynb @@ -93,7 +93,8 @@ "\n", "# Data structures and functions for rendering\n", "from pytorch3d.structures import Meshes\n", - "from pytorch3d.vis import AxisArgs, plot_batch_individually, plot_scene, texturesuv_image_matplotlib\n", + "from pytorch3d.vis.plotly_vis import AxisArgs, plot_batch_individually, plot_scene\n", + "from pytorch3d.vis.texture_vis import texturesuv_image_matplotlib\n", "from pytorch3d.renderer import (\n", " look_at_view_transform,\n", " FoVPerspectiveCameras, \n", diff --git a/pytorch3d/vis/__init__.py b/pytorch3d/vis/__init__.py index 6f7d948b..40539064 100644 --- a/pytorch3d/vis/__init__.py +++ b/pytorch3d/vis/__init__.py @@ -1,7 +1 @@ # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. - -from .plotly_vis import AxisArgs, Lighting, plot_batch_individually, plot_scene -from .texture_vis import texturesuv_image_matplotlib, texturesuv_image_PIL - - -__all__ = [k for k in globals().keys() if not k.startswith("_")]