geo3d.io.file_io ================ .. py:module:: geo3d.io.file_io Functions --------- .. autoapisummary:: geo3d.io.file_io.list_files geo3d.io.file_io.read_point_cloud geo3d.io.file_io.write_point_cloud geo3d.io.file_io.class_weights_file geo3d.io.file_io.class_weights_dataset Module Contents --------------- .. py:function:: list_files(directory: str, ext: str = 'las') -> List[str] List files in a directory. :param directory: The directory containing the files. :type directory: str :param ext: The extension of the files. Defaults to "las". :type ext: str, optional :returns: A list of filenames. .. py:function:: read_point_cloud(filename: str) -> numpy.typing.NDArray[numpy.floating] Read a point cloud file. :param filename: The point cloud file. :type filename: str :returns: The point cloud array. :rtype: np.ndarray .. py:function:: write_point_cloud(array: numpy.ndarray, filename: str) -> None Write a point cloud file in las format. :param array: The point cloud array. :type array: np.ndarray :param filename: The filename to write (las format). :type filename: str .. py:function:: class_weights_file(filename: str) -> dict Compute the class weigths (counts) of a point cloud file. :param filename: The point cloud file. :type filename: str :returns: A dictionary containing the classes and their relative counts. .. py:function:: class_weights_dataset(directory: str, ext: str = 'las', normalize: bool = True, classes: List[int] = [1, 2, 3], n_jobs: int = -1) -> Dict[int, int | float] Compute the class weights of a dataset of point clouds. :param directory: The directory containing the point clouds. :type directory: str :param ext: The extension of the point cloud files. Defaults to "las". :type ext: str, optional :param normalize: Give percentages if True. Defaults to True. :type normalize: bool, optional :param classes: The list of classes to get their counts. :type classes: list :param n_jobs: The number of workers. Defaults to -1. :type n_jobs: int :returns: A dictionary with keys the classes and values their counts.