diff --git a/labelCloud/__init__.py b/labelCloud/__init__.py index 49e0fc1..a5f830a 100644 --- a/labelCloud/__init__.py +++ b/labelCloud/__init__.py @@ -1 +1 @@ -__version__ = "0.7.0" +__version__ = "0.7.1" diff --git a/labelCloud/control/pcd_manager.py b/labelCloud/control/pcd_manager.py index e65008f..1ce543d 100644 --- a/labelCloud/control/pcd_manager.py +++ b/labelCloud/control/pcd_manager.py @@ -171,11 +171,14 @@ def load_pointcloud(self, path_to_pointcloud: str) -> PointCloud: points = bin_pcd.reshape((-1, 4))[ :, 0:3 ] # Reshape and drop reflection values + points = points[~np.isnan(points).any(axis=1)] # drop rows with nan self.current_o3d_pcd = o3d.geometry.PointCloud( o3d.utility.Vector3dVector(points) ) else: # Load point cloud with open3d - self.current_o3d_pcd = o3d.io.read_point_cloud(str(path_to_pointcloud)) + self.current_o3d_pcd = o3d.io.read_point_cloud( + str(path_to_pointcloud), remove_nan_points=True + ) tmp_pcd = PointCloud(path_to_pointcloud) tmp_pcd.points = np.asarray(self.current_o3d_pcd.points).astype( diff --git a/labelCloud/utils/logger.py b/labelCloud/utils/logger.py index 00e6168..2ee4e91 100644 --- a/labelCloud/utils/logger.py +++ b/labelCloud/utils/logger.py @@ -12,9 +12,7 @@ f_handler.setLevel(logging.DEBUG) # TODO: Filter colors # Create formatters and add it to handlers -f_handler.setFormatter( - logging.Formatter("%(asctime)s - %(levelname)-8s: %(message)s [%(name)s]") -) +f_handler.setFormatter(logging.Formatter("%(asctime)s - %(levelname)-8s: %(message)s")) logging.basicConfig( diff --git a/labelCloud/view/gui.py b/labelCloud/view/gui.py index a9c3992..10deddd 100644 --- a/labelCloud/view/gui.py +++ b/labelCloud/view/gui.py @@ -585,12 +585,14 @@ def update_mode_status(self, mode: str) -> None: self.mode_status.setText(text) def change_pointcloud_folder(self) -> None: - path_to_folder = QFileDialog.getExistingDirectory( - self, - "Change Point Cloud Folder", - directory=config.get("FILE", "pointcloud_folder"), + path_to_folder = Path( + QFileDialog.getExistingDirectory( + self, + "Change Point Cloud Folder", + directory=config.get("FILE", "pointcloud_folder"), + ) ) - if not path_to_folder or path_to_folder.isspace(): + if not path_to_folder.is_dir(): logging.warning("Please specify a valid folder path.") else: self.controller.pcd_manager.pcd_folder = path_to_folder @@ -599,10 +601,14 @@ def change_pointcloud_folder(self) -> None: logging.info("Changed point cloud folder to %s!" % path_to_folder) def change_label_folder(self) -> None: - path_to_folder = QFileDialog.getExistingDirectory( - self, "Change Label Folder", directory=config.get("FILE", "label_folder") + path_to_folder = Path( + QFileDialog.getExistingDirectory( + self, + "Change Label Folder", + directory=config.get("FILE", "label_folder"), + ) ) - if not path_to_folder or path_to_folder.isspace(): + if not path_to_folder.is_dir(): logging.warning("Please specify a valid folder path.") else: self.controller.pcd_manager.label_manager.label_folder = path_to_folder