Standardize handling of config files (#15451)

* Standardize handling of config files

* Formatting

* Remove unused
This commit is contained in:
Nicolas Mowen
2024-12-11 18:46:42 -06:00
committed by GitHub
parent 6b12a45a95
commit 0e3fb6cbdd
5 changed files with 22 additions and 40 deletions

View File

@@ -136,17 +136,17 @@ class Rknn(DetectionApi):
def check_config(self, config):
if (config.model.width != 320) or (config.model.height != 320):
raise Exception(
"Make sure to set the model width and height to 320 in your config.yml."
"Make sure to set the model width and height to 320 in your config."
)
if config.model.input_pixel_format != "bgr":
raise Exception(
'Make sure to set the model input_pixel_format to "bgr" in your config.yml.'
'Make sure to set the model input_pixel_format to "bgr" in your config.'
)
if config.model.input_tensor != "nhwc":
raise Exception(
'Make sure to set the model input_tensor to "nhwc" in your config.yml.'
'Make sure to set the model input_tensor to "nhwc" in your config.'
)
def detect_raw(self, tensor_input):