hamarh / HMNet_pth

PyTorch implementation of Hierarchical Neural Memory Network
BSD 3-Clause "New" or "Revised" License
36 stars 5 forks source link

A bug about the `boxes.dtype.names` in the `psee_evaluator.py` #4

Closed JDYG closed 1 year ago

JDYG commented 1 year ago

Hi, When I execute the evaluation code psee_evaluator.py, I notice that it will reformat the ground truth box first. In your original code for preparing the training/test dataset, you add a dtype (invalid) for the gt boxes, which doesn't exist in the original Gen1 dataset.

Therefore, when executing the psee_evaluator.py and calling the reformat_boxes(boxes) for the gt_boxes_list, it will trigger the error ValueError: no field of name invalid for new[name] = boxes[name].

Because the boxes.dtype.names for gt_boxes is ('t', 'x', 'y', 'w', 'h', 'class_id', 'confidence', 'track_id', 'invalid') and the dtype.names for the initiated new is ('t', 'x', 'y', 'w', 'h', 'class_id', 'track_id', 'class_confidence'), which is defined in the line 21 in the box_loading.py.

I guess I should modify the original box_loading.py for the HMNet. I modify it as following, and it now can run successfully.

BBOX_DTYPE = np.dtype({'names':['t','x','y','w','h','class_id','track_id','class_confidence','invalid'], 'formats':['<i8','<f4','<f4','<f4','<f4','<u4','<u4','<f4','|b1'], 'offsets':[0,8,12,16,20,24,28,32,36], 'itemsize':40})
hamarh commented 1 year ago

Thanks for pointing out, and sorry for my mistake.

I have modified psee_evaluator.py so that it drops 'invalid' field. (Actually, we don't need to set the field for the testing dataset in the first place, but I mistakenly added validate_bbox.py in prepair.sh.)