Skip to content

Commit

Permalink
[Enhance] Replace data_dict calling 'img' key to support MMDet3D (ope…
Browse files Browse the repository at this point in the history
…n-mmlab#514)

* remove dict calling img key for compatibility

* fix unit test

* infer batch size using len(result) to be consistent with mmcv
  • Loading branch information
Wuziyi616 authored Apr 29, 2021
1 parent 6ccb1c0 commit ce56e68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mmseg/apis/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mmseg/models/segmentors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def train_step(self, data_batch, optimizer, **kwargs):
outputs = dict(
loss=loss,
log_vars=log_vars,
num_samples=len(data_batch['img'].data))
num_samples=len(data_batch['img_metas']))

return outputs

Expand Down

0 comments on commit ce56e68

Please sign in to comment.