mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-24 23:57:41 +03:00
clean up
This commit is contained in:
parent
805170dd87
commit
f1b64e51cf
@ -35,19 +35,20 @@ class SynapDetector(DetectionApi):
|
|||||||
|
|
||||||
def __init__(self, detector_config: SynapDetectorConfig):
|
def __init__(self, detector_config: SynapDetectorConfig):
|
||||||
if not SYNAP_SUPPORT:
|
if not SYNAP_SUPPORT:
|
||||||
raise ImportError(
|
logger.error(
|
||||||
"Error importing Synaptics SDK modules. You must use the -synaptics Docker image variant for Synaptics detector support."
|
"Error importing Synaptics SDK modules. You must use the -synaptics Docker image variant for Synaptics detector support."
|
||||||
)
|
)
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
_, ext = os.path.splitext(detector_config.model.path)
|
_, ext = os.path.splitext(detector_config.model.path)
|
||||||
if ext and ext != ".synap":
|
if ext and ext != ".synap":
|
||||||
raise ValueError("Model path config for Synap1680 is wrong.")
|
raise ValueError("Model path config for Synap1680 is incorrect.")
|
||||||
|
|
||||||
synap_network = Network(detector_config.model.path)
|
synap_network = Network(detector_config.model.path)
|
||||||
logger.info(f"Synap NPU loaded model: {detector_config.model.path}")
|
logger.info(f"Synap NPU loaded model: {detector_config.model.path}")
|
||||||
except ValueError as ve:
|
except ValueError as ve:
|
||||||
logger.error(f"Config to Synap1680 was Failed: {ve}")
|
logger.error(f"Synap1680 setup has failed: {ve}")
|
||||||
raise
|
raise
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Failed to init Synap NPU: {e}")
|
logger.error(f"Failed to init Synap NPU: {e}")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user