Skip to content

Commit

Permalink
cleanup of imports and Typing
Browse files Browse the repository at this point in the history
  • Loading branch information
oscar-nutonomy committed Nov 7, 2018
1 parent e663379 commit e9e3276
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 5 additions & 2 deletions python-sdk/export/export_pointclouds_as_obj.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
Export fused point clouds of a scene to a Wavefront OBJ file.
This point-cloud can be viewed in your favorite 3D rendering tool, e.g. Meshlab or Maya.
"""

import os
import os.path as osp
import argparse
Expand All @@ -16,8 +21,6 @@
def export_scene_pointcloud(nusc: NuScenes, out_path: str, scene_token: str, channel: str='LIDAR_TOP',
min_dist: float=3.0, max_dist: float=30.0, verbose: bool=True) -> None:
"""
Export fused point clouds of a scene to a Wavefront OBJ file.
This point-cloud can be viewed in your favorite 3D rendering tool, e.g. Meshlab or Maya.
:param nusc: NuScenes instance.
:param out_path: Output path to write the point-cloud to.
:param scene_token: Unique identifier of scene to render.
Expand Down
9 changes: 4 additions & 5 deletions python-sdk/nuscenes_utils/data_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
import cv2
import numpy as np
from pyquaternion import Quaternion
import cv2 as Axes
from matplotlib.axes._axes import Axes
from matplotlib.axes import Axes

from nuscenes_utils.geometry_utils import view_points

Expand Down Expand Up @@ -114,7 +113,7 @@ def load_pcd_bin(file_name: str) -> np.ndarray:
return points

@classmethod
def from_file(cls, file_name: str): # -> PointCloud
def from_file(cls, file_name: str) -> PointCloud:
"""
Instantiate from a .pcl, .pdc, .npy, or .bin file.
:param file_name: Path of the pointcloud file on disk.
Expand Down Expand Up @@ -276,7 +275,7 @@ def encode(self) -> List[float]:
self.label] + [self.score] + self.velocity.tolist() + [self.name]

@classmethod
def decode(cls, data: List[float]): # -> Box:
def decode(cls, data: List[float]) -> Box:
"""
Instantiates a Box instance from encoded vector representation.
:param data: [<float>: 16]. Output from encode.
Expand Down Expand Up @@ -343,7 +342,7 @@ def bottom_corners(self) -> np.ndarray:
return self.corners()[:, [2, 3, 7, 6]]

def render(self, axis: Axes, view: np.ndarray=np.eye(3), normalize: bool=False, colors: Tuple=('b', 'r', 'k'),
linewidth:float=2):
linewidth: float=2):
"""
Renders the box in the provided Matplotlib axis.
:param axis: Axis onto which the box should be drawn.
Expand Down

0 comments on commit e9e3276

Please sign in to comment.