Unverified Commit ccd3047a authored by xiliu8006's avatar xiliu8006 Committed by GitHub
Browse files

[Enhance]: Hide the import of open3d (#323)

* Reduce the open3d dependency

* Reduce the open3d dependency

* Reduce dependency of open3d if open3d is not used

* remove the warning in show_result
parent 93597a53
import cv2
import numpy as np
import open3d as o3d
import torch
from matplotlib import pyplot as plt
from open3d import geometry
try:
import open3d as o3d
from open3d import geometry
except ImportError:
raise ImportError(
'Please run "pip install open3d" to install open3d first.')
def _draw_points(points,
......
......@@ -3,8 +3,6 @@ import numpy as np
import trimesh
from os import path as osp
from .open3d_vis import Visualizer
def _write_ply(points, out_filename):
"""Write points into ``ply`` format for meshlab visualization.
......@@ -81,6 +79,8 @@ def show_result(points, gt_bboxes, pred_bboxes, out_dir, filename, show=True):
filename (str): Filename of the current frame.
show (bool): Visualize the results online.
"""
from .open3d_vis import Visualizer
if show:
vis = Visualizer(points)
if pred_bboxes is not None:
......
open3d
waymo-open-dataset-tf-2-1-0==1.2.0
......@@ -5,7 +5,6 @@ interrogate
isort
# Note: used for kwarray.group_items, this may be ported to mmcv in the future.
kwarray
open3d
pytest
pytest-cov
pytest-runner
......
......@@ -8,6 +8,6 @@ line_length = 79
multi_line_output = 0
known_standard_library = setuptools
known_first_party = mmdet,mmdet3d
known_third_party = cv2,load_scannet_data,lyft_dataset_sdk,m2r,matplotlib,mmcv,nuimages,numba,numpy,nuscenes,open3d,pandas,plyfile,pycocotools,pyquaternion,pytest,recommonmark,scannet_utils,scipy,seaborn,shapely,skimage,tensorflow,terminaltables,torch,trimesh,waymo_open_dataset
known_third_party = cv2,load_scannet_data,lyft_dataset_sdk,m2r,matplotlib,mmcv,nuimages,numba,numpy,nuscenes,pandas,plyfile,pycocotools,pyquaternion,pytest,recommonmark,scannet_utils,scipy,seaborn,shapely,skimage,tensorflow,terminaltables,torch,trimesh,waymo_open_dataset
no_lines_before = STDLIB,LOCALFOLDER
default_section = THIRDPARTY
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment