[Fix] fix det with static shape (#1049)
* fix det with static shape * update rotated detection * fix resize keep ratiopull/1095/head
parent
676f1bf49c
commit
6ac9c4d7a8
|
@ -42,10 +42,14 @@ def process_model_config(model_cfg: mmcv.Config,
|
|||
transforms = cfg.data.test.pipeline[1]['transforms']
|
||||
for trans in transforms:
|
||||
trans_type = trans['type']
|
||||
if trans_type == 'Resize':
|
||||
if trans_type == 'Resize' and len(
|
||||
input_shape) != 1 and input_shape[0] != input_shape[1]:
|
||||
trans['keep_ratio'] = False
|
||||
elif trans_type == 'Pad':
|
||||
trans['size_divisor'] = 1
|
||||
if 'size_divisor' in trans:
|
||||
trans['size_divisor'] = 1
|
||||
else:
|
||||
trans['size'] = tuple(input_shape)
|
||||
|
||||
cfg.data.test.pipeline = replace_ImageToTensor(cfg.data.test.pipeline)
|
||||
return cfg
|
||||
|
|
|
@ -64,7 +64,7 @@ def process_model_config(model_cfg: mmcv.Config,
|
|||
transforms = cfg.data.test.pipeline[1]['transforms']
|
||||
for trans in transforms:
|
||||
trans_type = trans['type']
|
||||
if trans_type == 'Pad':
|
||||
if trans_type == 'Pad' and 'size_divisor' in trans:
|
||||
trans['size_divisor'] = 1
|
||||
|
||||
cfg.data.test.pipeline = replace_ImageToTensor(cfg.data.test.pipeline)
|
||||
|
|
Loading…
Reference in New Issue