Skip to content

Commit 5105903

Browse files
Merge pull request #206 from yoshitomo-matsubara/dev
Refactor and improve result summary message
2 parents 4af775e + 306f15f commit 5105903

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

torchdistill/eval/coco.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,10 @@ def reduce_from_all_processes(self):
186186

187187
def __str__(self):
188188
acc_global, acc, iu = self.compute()
189-
return (
190-
'Global pixelwise acc: {:.1f}, Average row correct: {}, IoU: {}, mean IoU: {:.1f}').format(
191-
acc_global.item(),
192-
['{:.1f}'.format(i) for i in acc.tolist()],
193-
['{:.1f}'.format(i) for i in iu.tolist()],
194-
iu.mean().item())
189+
return 'mean IoU: {:.1f}, IoU: {}, Global pixelwise acc: {:.1f}, Average row correct: {}'.format(
190+
iu.mean().item(), ['{:.1f}'.format(i) for i in iu.tolist()],
191+
acc_global.item(), ['{:.1f}'.format(i) for i in acc.tolist()]
192+
)
195193

196194

197195
def convert_to_xywh(boxes):

torchdistill/models/util.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ def redesign_model(org_model, model_config, model_label, model_type='original'):
105105
module = get_adaptation_module(adaptation_config['type'], **adaptation_config['params'])
106106
else:
107107
module = get_module(org_model, module_path)
108+
108109
if module_path in frozen_module_path_set:
109110
freeze_module_params(module)
111+
110112
add_submodule(module, module_path, module_dict)
111113
return build_sequential_container(module_dict)

0 commit comments

Comments
 (0)