[Enhance] Replace data_dict calling 'img' key to support MMDet3D (#514)

* remove dict calling img key for compatibility

* fix unit test

* infer batch size using len(result) to be consistent with mmcv
pull/1801/head
Ziyi Wu 2021-04-29 16:01:34 +08:00 committed by GitHub
parent 6ccb1c0fe5
commit ce56e68d30
2 changed files with 2 additions and 2 deletions

View File

@ -97,7 +97,7 @@ def single_gpu_test(model,
result = np2tmp(result)
results.append(result)
batch_size = data['img'][0].size(0)
batch_size = len(result)
for _ in range(batch_size):
prog_bar.update()
return results

View File

@ -155,7 +155,7 @@ class BaseSegmentor(nn.Module):
outputs = dict(
loss=loss,
log_vars=log_vars,
num_samples=len(data_batch['img'].data))
num_samples=len(data_batch['img_metas']))
return outputs