[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 mmcvpull/1801/head
parent
6ccb1c0fe5
commit
ce56e68d30
|
@ -97,7 +97,7 @@ def single_gpu_test(model,
|
||||||
result = np2tmp(result)
|
result = np2tmp(result)
|
||||||
results.append(result)
|
results.append(result)
|
||||||
|
|
||||||
batch_size = data['img'][0].size(0)
|
batch_size = len(result)
|
||||||
for _ in range(batch_size):
|
for _ in range(batch_size):
|
||||||
prog_bar.update()
|
prog_bar.update()
|
||||||
return results
|
return results
|
||||||
|
|
|
@ -155,7 +155,7 @@ class BaseSegmentor(nn.Module):
|
||||||
outputs = dict(
|
outputs = dict(
|
||||||
loss=loss,
|
loss=loss,
|
||||||
log_vars=log_vars,
|
log_vars=log_vars,
|
||||||
num_samples=len(data_batch['img'].data))
|
num_samples=len(data_batch['img_metas']))
|
||||||
|
|
||||||
return outputs
|
return outputs
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue