LiUzHiAn / hf2vad

MIT License
124 stars 24 forks source link

ValueError: setting an array element with a sequence #35

Open zw-absin opened 11 months ago

zw-absin commented 11 months ago

Run the following command: python extract_bboxes.py --proj_root=/data1/zhouwx/hf2vad-master/ --dataset_name=ped2 --mode=train

Problem: Traceback (most recent call last): File "data/hf2vad-master/extract_bboxes.py", line 161, in obj_bboxes_extraction(dataset_root=os.path.join(args.proj_root, "data"), File "/data/hf2vad-master/extract_bboxes.py", line 149, in obj_bboxes_extraction np.save(os.path.join(os.path.join(dataset_root, dataset_name), File "<__array_function__ internals>", line 200, in save File "/data/anaconda3/envs/pytorch1.10/lib/python3.9/site-packages/numpy/lib/npyio.py", line 521, in save arr = np.asanyarray(arr) ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2010,) + inhomogeneous part.

Should I change the npyio.py to "arr = np.asanyarray(arr, dtype=object)" to solve this problem?

zw-absin commented 11 months ago

The problem seems to be solved by changing the code. By the way, can this work detect specific anomalies in the video, like 'video anomaly localization'? For example, how the red bonding boxes in the Fig5 come about? Are they manually marked? Thanks a lot if any body can answer this question!