Eval failed
following the evaluation step: https://github.com/manycore-research/SpatialLM?tab=readme-ov-file#evaluation
python eval.py --metadata SpatialLM-Testset/test.csv --gt_dir SpatialLM-Testset/layout --pred_dir SpatialLM-Testset/pred --label_mapping SpatialLM-Testset/benchmark_categories.tsv
After inference done, the eval.py failed with following info:
Traceback (most recent call last):
File "/home/pzhang/repos/llm/SpatialLM/eval.py", line 433, in <module>
calc_layout_tp(
File "/home/pzhang/repos/llm/SpatialLM/eval.py", line 339, in calc_layout_tp
[
File "/home/pzhang/repos/llm/SpatialLM/eval.py", line 340, in <listcomp>
calc_thin_bbox_iou_2d(
File "/home/pzhang/repos/llm/SpatialLM/eval.py", line 292, in calc_thin_bbox_iou_2d
if are_planes_parallel_and_close(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pzhang/repos/llm/SpatialLM/eval.py", line 277, in are_planes_parallel_and_close
n1_length * n2_length > ZERO_TOLERANCE
AssertionError: Invalid plane corners, corners_1: [[-0.01468042 -0.7744153 -0.02371482]
[-0.01468042 -0.7744153 -0.02371482]
[-0.01468042 -0.7744153 2.27628518]
[-0.01468042 -0.7744153 2.27628518]], corners_2: [[ 8.11968068e-03 -7.43863114e-01 -4.73248960e-08]
[ 7.37224130e-01 -7.43863114e-01 -4.73248960e-08]
[ 7.37224130e-01 -7.43863114e-01 2.30000005e+00]
[ 8.11968068e-03 -7.43863114e-01 2.30000005e+00]]
Most likely happening because your p1, p2 are the same in the are_planes_parallel_and_close function. In my case, its happening only for 1 example, so I just removed the assert statement https://github.com/manycore-research/SpatialLM/blob/13230c957525316d4488ac7000409c05f8d9971c/eval.py#L276 and replaced it with the following --
if not (n1_length * n2_length > ZERO_TOLERANCE):
print("Invalid plane corners, corners_1: ", corners_1, "corners_2: ", corners_2)
return False
Most likely happening because your p1, p2 are the same in the
are_planes_parallel_and_closefunction. In my case, its happening only for 1 example, so I just removed the assert statementLine 276 in 13230c9
assert ( and replaced it with the following --
if not (n1_length * n2_length > ZERO_TOLERANCE): print("Invalid plane corners, corners_1: ", corners_1, "corners_2: ", corners_2) return False
Thanks for your reply! After rerunning the inference code, the assertion error disappeared.😊