mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-12-06 05:24:11 +03:00
Format code based on the results of Python Checks
x
This commit is contained in:
parent
7933a83a42
commit
acb17a7b50
@ -25,8 +25,10 @@ model_cache_dir = os.path.join(MODEL_CACHE_DIR, "axengine_cache/")
|
|||||||
class AxengineDetectorConfig(BaseDetectorConfig):
|
class AxengineDetectorConfig(BaseDetectorConfig):
|
||||||
type: Literal[DETECTOR_KEY]
|
type: Literal[DETECTOR_KEY]
|
||||||
|
|
||||||
|
|
||||||
class Axengine(DetectionApi):
|
class Axengine(DetectionApi):
|
||||||
type_key = DETECTOR_KEY
|
type_key = DETECTOR_KEY
|
||||||
|
|
||||||
def __init__(self, config: AxengineDetectorConfig):
|
def __init__(self, config: AxengineDetectorConfig):
|
||||||
logger.info("__init__ axengine")
|
logger.info("__init__ axengine")
|
||||||
super().__init__(config)
|
super().__init__(config)
|
||||||
@ -57,9 +59,7 @@ class Axengine(DetectionApi):
|
|||||||
if not os.path.isfile(model_props["path"]):
|
if not os.path.isfile(model_props["path"]):
|
||||||
self.download_model(model_props["filename"])
|
self.download_model(model_props["filename"])
|
||||||
else:
|
else:
|
||||||
supported_models_str = ", ".join(
|
supported_models_str = ", ".join(model[1:-1] for model in supported_models)
|
||||||
model[1:-1] for model in supported_models
|
|
||||||
)
|
|
||||||
raise Exception(
|
raise Exception(
|
||||||
f"Model {model_path} is unsupported. Provide your own model or choose one of the following: {supported_models_str}"
|
f"Model {model_path} is unsupported. Provide your own model or choose one of the following: {supported_models_str}"
|
||||||
)
|
)
|
||||||
@ -84,4 +84,3 @@ class Axengine(DetectionApi):
|
|||||||
raise ValueError(
|
raise ValueError(
|
||||||
f'Model type "{self.detector_config.model.model_type}" is currently not supported.'
|
f'Model type "{self.detector_config.model.model_type}" is currently not supported.'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user