{"id":18573542,"url":"https://github.com/prs-eth/forainet","last_synced_at":"2025-03-17T16:12:36.751Z","repository":{"id":222573751,"uuid":"754394514","full_name":"prs-eth/ForAINet","owner":"prs-eth","description":"official source code for paper entitled \"Automated forest inventory: analysis of high-density airborne LiDAR point clouds with 3D deep learning\"","archived":false,"fork":false,"pushed_at":"2025-01-13T16:03:38.000Z","size":2803,"stargazers_count":57,"open_issues_count":14,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-02T14:18:42.332Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prs-eth.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-08T00:30:05.000Z","updated_at":"2025-02-24T16:01:13.000Z","dependencies_parsed_at":"2024-06-03T09:01:23.321Z","dependency_job_id":"fb0213f6-bbc7-4e20-9e22-a0de84c6e514","html_url":"https://github.com/prs-eth/ForAINet","commit_stats":null,"previous_names":["bxiang233/forainet","prs-eth/forainet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2FForAINet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2FForAINet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2FForAINet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2FForAINet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prs-eth","download_url":"https://codeload.github.com/prs-eth/ForAINet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244066189,"owners_count":20392406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T23:10:44.847Z","updated_at":"2025-03-17T16:12:36.721Z","avatar_url":"https://github.com/prs-eth.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Automated forest inventory: analysis of high-density airborne LiDAR point clouds with 3D deep learning\n\nThis repository represents the official code for paper entitled \"Automated forest inventory: analysis of high-density airborne LiDAR point clouds with 3D deep learning\".\n\n# Set up environment\n\nPlease refer to our previous repo:\n\nhttps://github.com/prs-eth/PanopticSegForLargeScalePointCloud\n\nIt includes the detailed steps and issues that might happen but already resolved.\n\n# FOR-Instance dataset\n\nPlease replace the old raw files with our new raw files:\n\nFor example, data_set1_5classes contains the data for \"basic setting\" in Table 4 in our paper.\n\n1. dataset for settings \"basic setting\", \"+ binary semantic loss\", \"+ class weights\", \"+ height weights\", \"+ region weights\", \"+ elastic distortion and subsampling\", \"+ TreeMix\"\n\nYou can download it:\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10828636.svg)](https://doi.org/10.5281/zenodo.10828636)\n\n2. For other setting to be added here.\n\n# Commands for running point cloud segmentation experiments based on different settings:\n\n```bash\ncd /$YOURPATH$/ForAINet/PointCloudSegmentation\n```\n\n1. Experiment for \"basic setting\" in the paper.\n\n```bash\n# Command for training\npython train.py task=panoptic data=panoptic/treeins_set1 models=panoptic/FORpartseg_3heads model_name=PointGroup-PAPER training=treeins_set1 job_name=#YOUR_JOB_NAME#\n```\n\n2. Experiment for \"+ binary semantic loss\" setting in the paper \n\n```bash\n# Command for training\npython train.py task=panoptic data=panoptic/treeins_set1 models=panoptic/FORpartseg_3heads_BiLoss model_name=PointGroup-PAPER training=treeins_set1_addBiLoss job_name=#YOUR_JOB_NAME#\n```\n\n3. Experiment for \"+ class weights\" setting in the paper \n\n```bash\n# Command for training\npython train.py task=panoptic data=panoptic/treeins_set1_classweight models=panoptic/FORpartseg_3heads model_name=PointGroup-PAPER training=treeins_set1_nw8_classweight job_name=#YOUR_JOB_NAME#\n```\n\n4. Experiment for \"+ height weights\" setting in the paper \n\n```bash\n# Command for training\npython train.py task=panoptic data=panoptic/treeins_set1_classweight models=panoptic/FORpartseg_3heads_heightweight model_name=PointGroup-PAPER training=treeins_set1_heightweight job_name=#YOUR_JOB_NAME#\n```\n\n5. Experiment for \"+ region weights\" setting in the paper \n\n```bash\n# Command for training\n\n# To be added\n```\n\n6. Experiment for \"+ intensity\" setting in the paper \n\n```bash\n# Command for training\npython train.py task=panoptic data=panoptic/treeins_set1_add_intensity models=panoptic/FORpartseg_3heads model_name=PointGroup-PAPER training=treeins_set1_intensity job_name=#YOUR_JOB_NAME#\n```\n\n7. Experiment for \"+ return number\" setting in the paper \n\n```bash\n# Command for training\npython train.py task=panoptic data=panoptic/treeins_set1_add_return_num models=panoptic/FORpartseg_3heads model_name=PointGroup-PAPER training=treeins_set1_return_num job_name=#YOUR_JOB_NAME#\n```\n\n8. Experiment for \"+ scan angle rank\" setting in the paper \n\n```bash\n# Command for training\npython train.py task=panoptic data=panoptic/treeins_set1_add_scan_angle_rank models=panoptic/FORpartseg_3heads model_name=PointGroup-PAPER training=treeins_set1_scan_angle_rank job_name=#YOUR_JOB_NAME#\n```\n\n9.  Experiment for \"+ hand-crafted features\" setting in the paper \n\n```bash\n# Command for training\npython train.py task=panoptic data=panoptic/treeins_set1_add_all_20010 models=panoptic/FORpartseg_3heads model_name=PointGroup-PAPER training=treeins_set1_addallFea_20010 job_name=#YOUR_JOB_NAME#\n```\n\n10. Experiment for \"+ elastic distortion and subsampling\" setting in the paper \n\n```bash\n# Command for training\npython train.py task=panoptic data=panoptic/treeins_set1_curved_subsam models=panoptic/FORpartseg_3heads model_name=PointGroup-PAPER training=treeins_set1_addCurvedSubsample job_name=#YOUR_JOB_NAME#\n```\n\n11. Experiment for \"+ TreeMix\" setting in the paper \n\n```bash\n# Command for training\npython train.py task=panoptic data=panoptic/treeins_set1_treemix3d models=panoptic/FORpartseg_3heads model_name=PointGroup-PAPER training=treeins_set1_mixtree job_name=#YOUR_JOB_NAME#\n```\n\n12.  Experiments for data with different point density \n\n```bash\n# Command for training\npython train.py task=panoptic data=panoptic/treeins_set1_treemix3d_pd#POINT_DENSITY# models=panoptic/FORpartseg_3heads model_name=PointGroup-PAPER training=mixtree_#POINT_DENSITY# job_name=#YOUR_JOB_NAME#\n\n# take point density=10 as an example\npython train.py task=panoptic data=panoptic/treeins_set1_treemix3d_pd10 models=panoptic/FORpartseg_3heads model_name=PointGroup-PAPER training=mixtree_10 job_name=#YOUR_JOB_NAME#\n```\n\n\n13. Commands for testing. Remember to change \"checkpoint_dir\" parameter to your path.\n\nOur pretrained model could be download here:\nhttps://www.dropbox.com/scl/fi/mv4nxe60cco86fd2u9f3z/PointGroup-PAPER.pt?rlkey=ua6093kehk0youpo8g3a6g0nm\u0026st=wiqv3a0u\u0026dl=0\n\n```bash\n# Command for test\n# remember to change the following 2 parameters in eval.yaml:\n# 1. \"checkpoint_dir\" to your log files path\n# 2. \"data\" is the paths for your test files\npython eval.py\n\n# Command for output the final evaluation file\n# replace parameter \"test_sem_path\" by your path\npython evaluation_stats_FOR.py\n```\n\n# Commands for running tree parameters extraction code:\n\n```bash\ncd /$YOURPATH$/ForAINet/tree_metrics\n# remember to adjust parameters based on your dataset\npython measurement.py\n```\n\n# Commands for running code for extracting manually extracted geometric features:\n\n```bash\n# Please note that our code is based on the Superpoint Graphs repository, which can be found at https://github.com/loicland/superpoint_graph. We have included our custom partition_FORdata.py file.\ncd /$YOURPATH$/ForAINet/superpoint_graph/partition\npython partition_FORdata.py\n```\n\n# Handling large point clouds: a workflow for tiling, predicting, and merging:\n\nFor large point clouds, we provide the code to process them seamlessly. The workflow involves the following steps:\n\n1. Splitting the point cloud: use split_largePC_to_tiles.py to divide the large point cloud into fixed-size tiles (default: 50m tiles with 5m overlap).\n2. Predicting for each tile: run predictions on each tile using generate_eval_command.py.\n3. Merging results: combine the results of all tiles back into the original point cloud using merge_tiles.py.\nAll these operations can be easily executed with the large_PC_predict.sh command:\n\n```bash\n# modify parameters in large_PC_predict.sh:\n# base_path: your project directory\n# tile_size and overlap\n# src_dir: specify the directory where your model is stored\n\n# modify parameters in exampleeval.yaml:\n# checkpoint_dir: the location of your model checkpoint\n# data.fold: the paths of the point cloud files you want to test\n\nbash large_PC_predict.sh\n```\n\n# Citing\nIf you find our work useful, please do not hesitate to cite it:\n\n```\n@article{\n  xiang2024automated,\n  title={Automated forest inventory: analysis of high-density airborne LiDAR point clouds with 3D deep learning},\n  author={Binbin Xiang, Maciej Wielgosz, Theodora Kontogianni, Torben Peters, Stefano Puliti, Rasmus Astrup, Konrad Schindler},\n  journal={Remote Sensing of Environment},\n  volume={305},\n  pages={114078},\n  year={2024},\n  publisher={Elsevier}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprs-eth%2Fforainet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprs-eth%2Fforainet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprs-eth%2Fforainet/lists"}