mmpose
mmpose copied to clipboard
progress bar updating in mmpose/apis/test.py is incorrect for multi-frame detectors such as posewarper
Describe the bug
Batch size count in single_gpu_test and multi_gpu_test, such as the line here, https://github.com/open-mmlab/mmpose/blob/f8b79fe3d92aa71c29c16835cbe7af11204f412c/mmpose/apis/test.py#L37 is incorrect for multi-frame detectors such as posewarper. This line assumes the input image is a tensor while for posewarper the input is a list of tensors and the length of list is equal to number of frames used for inference not batch size.
Reproduction Use tools/test.py to test a posewarper stage2 model and observe how the progress bar updates.
Environment Irrelevant
Error traceback Not applicable
Bug fix Probably using number of entries in img_metas is a better approach?
@zwfcrazy Thanks for your feedback! This is actually a bug.
Currently, the input data is a dictionary so we just use the length of the first value in data
as the batch size.
Probably using number of entries in img_metas is a better approach?
This may work. Would you like to raise a pull request to fix it by yourself?
@liqikai9 I am currently using this modification batch_size = len(data['img_metas'].data[0])
for my own test, but I am not sure if this is general enough.
I see. It seems like a good choice for this detector and config. We will continue to pay attention to this issue and find a general way to fix it. Thanks again~