From 0783d58e08265553df4962d3391dbd81efc71c77 Mon Sep 17 00:00:00 2001 From: Charles Gaydon <11660435+CharlesGaydon@users.noreply.github.com> Date: Thu, 14 Sep 2023 10:42:53 +0200 Subject: [PATCH 1/4] dev: delete the right dataset group during hdf5 creation --- myria3d/pctl/dataset/hdf5.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/myria3d/pctl/dataset/hdf5.py b/myria3d/pctl/dataset/hdf5.py index 498c2f1b..b0c9593c 100644 --- a/myria3d/pctl/dataset/hdf5.py +++ b/myria3d/pctl/dataset/hdf5.py @@ -234,7 +234,7 @@ def create_hdf5( # Useful in case data preparation was interrupted. with h5py.File(hdf5_file_path, "a") as hdf5_file: if basename in hdf5_file[split] and "is_complete" not in hdf5_file[split][basename].attrs: - del hdf5_file[basename] + del hdf5_file[split][basename] # Parse and add subtiles to split group. with h5py.File(hdf5_file_path, "a") as hdf5_file: if basename in hdf5_file[split]: From e57f8001fa9d74edb65a4ddd596bedbf64ff7efa Mon Sep 17 00:00:00 2001 From: Charles Gaydon <11660435+CharlesGaydon@users.noreply.github.com> Date: Thu, 14 Sep 2023 10:50:25 +0200 Subject: [PATCH 2/4] fix: support edge-case where src laz has no valid patch (pre_filter is False) A HDF5 group for the src file is not created if all patches included in a source laz do not pass the pre_filter step. This typically happens in clouds with a low or null number of points, when pre_filter requires a larger number of points than available. --- myria3d/pctl/dataset/hdf5.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/myria3d/pctl/dataset/hdf5.py b/myria3d/pctl/dataset/hdf5.py index b0c9593c..f9b1dbc6 100644 --- a/myria3d/pctl/dataset/hdf5.py +++ b/myria3d/pctl/dataset/hdf5.py @@ -285,4 +285,6 @@ def create_hdf5( ) # A termination flag to report that all samples for this point cloud were included in the df5 file. - hdf5_file[split][basename].attrs["is_complete"] = True + # Group may not have been created if source cloud had no patch passing the pre_filter step, hence the "if" here. + if basename in hdf5_file[split]: + hdf5_file[split][basename].attrs["is_complete"] = True From 4a86e8e9bf2adb2f3c346f13cab0dd346e9b889f Mon Sep 17 00:00:00 2001 From: Charles Gaydon <11660435+CharlesGaydon@users.noreply.github.com> Date: Thu, 14 Sep 2023 10:51:01 +0200 Subject: [PATCH 3/4] Update package_metadata.yaml to 3.4.9 --- package_metadata.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_metadata.yaml b/package_metadata.yaml index 72a706c6..4898c136 100644 --- a/package_metadata.yaml +++ b/package_metadata.yaml @@ -1,4 +1,4 @@ -__version__: "3.4.8" +__version__: "3.4.9" __name__: "myria3d" __url__: "https://github.com/IGNF/myria3d" __description__: "Deep Learning for the Semantic Segmentation of Aerial Lidar Point Clouds" From 8590b976d4a82b8f8c50ab0716b9b8c72c646217 Mon Sep 17 00:00:00 2001 From: Charles Gaydon <11660435+CharlesGaydon@users.noreply.github.com> Date: Thu, 14 Sep 2023 10:53:04 +0200 Subject: [PATCH 4/4] Update CHANGELOG.md for V3.4.9 --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index be024510..189e2d73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # main +### 3.4.9 +- Support edge-case where source LAZ has no valid subtile (i.e. pre_filter=False for all candidate subtiles) during hdf5 creation + ### 3.4.8 - Raise an informative error in case of unexpected task_name