Skip to content

Commit

Permalink
Fix deploy patch bug (w,h) -> (h,w)
Browse files Browse the repository at this point in the history
  • Loading branch information
goodsong81 committed May 23, 2023
1 parent befc201 commit a4bbbd5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions otx/algorithms/detection/adapters/mmdet/utils/config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,10 @@ def patch_input_shape(cfg: ConfigDict, deploy_cfg: ConfigDict):
assert all(isinstance(i, int) and i > 0 for i in size)
# default is static shape to prevent an unexpected error
# when converting to OpenVINO IR
w, h = size
logger.info(f"Patching OpenVINO IR input shape: {size}")
deploy_cfg.ir_config.input_shape = size
deploy_cfg.backend_config.model_inputs = [ConfigDict(opt_shapes=ConfigDict(input=[1, 3, *size]))]
deploy_cfg.ir_config.input_shape = (w, h)
deploy_cfg.backend_config.model_inputs = [ConfigDict(opt_shapes=ConfigDict(input=[1, 3, h, w]))]


def patch_ir_scale_factor(deploy_cfg: ConfigDict, hyper_parameters: DetectionConfig):
Expand Down

0 comments on commit a4bbbd5

Please sign in to comment.