prs-eth / ForAINet

official source code for paper entitled "Automated forest inventory: analysis of high-density airborne LiDAR point clouds with 3D deep learning"
50 stars 9 forks source link

Fixed a bug in running eval.py: TypeError: only size-1 arrays can be converted to Python scalars #9

Open yihshe opened 2 weeks ago

yihshe commented 2 weeks ago

To calculate the semantic segmentation oAcc, the denominator at ForAINet/PointCloudSegmentation/torch_points3d/datasets/panoptic/treeins_set1.py(204)final_eval() is originally written as sum(true_positive_classes[sem_classcount_final])/float(sum(positive_classes[[sem_classcount_final]])), however, this will raise the error: TypeError: only size-1 arrays can be converted to Python scalars. The bug is fixed by removing the brackets of [sem_classcount_final] in the denominator, which I suspect is a typo. The corrected line should be: sum(true_positive_classes[sem_classcount_final])/float(sum(positive_classes[sem_classcount_final])).