From c01949a04442e77f1f42640a14fb0c9e9e6aae25 Mon Sep 17 00:00:00 2001 From: Dominik Winkelbauer Date: Tue, 22 Aug 2023 11:31:38 +0200 Subject: [PATCH] chore(pylint): Some pylint fixes --- blenderproc/python/writer/BopWriterUtility.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/blenderproc/python/writer/BopWriterUtility.py b/blenderproc/python/writer/BopWriterUtility.py index bd055747c..c21def0c4 100644 --- a/blenderproc/python/writer/BopWriterUtility.py +++ b/blenderproc/python/writer/BopWriterUtility.py @@ -26,7 +26,7 @@ def write_bop(output_dir: str, target_objects: Optional[List[MeshObject]] = None, - depths: Optional[List[np.ndarray]] = None, colors: Optional[List[np.ndarray]] = None, + depths: List[np.ndarray] = None, colors: List[np.ndarray] = None, color_file_format: str = "PNG", dataset: str = "", append_to_existing_output: bool = True, depth_scale: float = 1.0, jpg_quality: int = 95, save_world2cam: bool = True, ignore_dist_thres: float = 100., m2mm: Optional[bool] = None, annotation_unit: str = 'mm', @@ -56,10 +56,6 @@ def write_bop(output_dir: str, target_objects: Optional[List[MeshObject]] = None :param calc_mask_info_coco: Whether to calculate gt masks, gt info and gt coco annotations. :param delta: Tolerance used for estimation of the visibility masks (in [m]). """ - if depths is None: - depths = [] - if colors is None: - colors = [] # Output paths. dataset_dir = os.path.join(output_dir, dataset) @@ -375,8 +371,8 @@ def get_frame_camera(save_world2cam: bool, depth_scale: float = 1.0, unit_scalin return frame_camera_dict @staticmethod - def write_frames(chunks_dir: str, dataset_objects: list, depths: Optional[List[np.ndarray]] = None, - colors: Optional[List[np.ndarray]] = None, color_file_format: str = "PNG", + def write_frames(chunks_dir: str, dataset_objects: list, depths: List[np.ndarray], + colors: List[np.ndarray], color_file_format: str = "PNG", depth_scale: float = 1.0, frames_per_chunk: int = 1000, annotation_scale: float = 1000., ignore_dist_thres: float = 100., save_world2cam: bool = True, jpg_quality: int = 95): """Write each frame's ground truth into chunk directory in BOP format @@ -396,10 +392,6 @@ def write_frames(chunks_dir: str, dataset_objects: list, depths: Optional[List[n specified format (see `annotation_format` in `write_bop` for further details). :param frames_per_chunk: Number of frames saved in each chunk (called scene in BOP) """ - if depths is None: - depths = [] - if colors is None: - colors = [] # Format of the depth images. depth_ext = '.png'