dk-liang / FIDTM

[IEEE TMM] Focal Inverse Distance Transform Maps for Crowd Localization
MIT License
169 stars 41 forks source link

bug fix when no human presents in a frame #15

Closed RawanLaz closed 3 years ago

RawanLaz commented 3 years ago

When no human presents in the image, the code generate an error

Traceback (most recent call last): File "/home/rawan/FIDTM/video_demo.py", line 190, in main(params) File "/home/rawan/FIDTM/video_demo.py", line 76, in main box_img = generate_bounding_boxes(pred_kpoint, frame) File "/home/rawan/FIDTM/video_demo.py", line 133, in generate_bounding_boxes tree = scipy.spatial.KDTree(pts.copy(), leafsize=leafsize) File "/home/rawan/miniconda3/lib/python3.9/site-packages/scipy/spatial/kdtree.py", line 337, in init super().init(data, leafsize, compact_nodes, copy_data, File "ckdtree.pyx", line 558, in scipy.spatial.ckdtree.cKDTree.init ValueError: data must be 2 dimensions

dk-liang commented 3 years ago

Thanks!