mirror of
				https://github.com/blakeblackshear/frigate.git
				synced 2025-10-27 10:52:11 +01:00 
			
		
		
		
	Don't fail if openvino fails to import (#5532)
* Don't fail if openvino fails to import * Ensure all modules are imported safely * Undo * Fix list append
This commit is contained in:
		
							parent
							
								
									0592c8b0e2
								
							
						
					
					
						commit
						2797a60d4f
					
				@ -13,12 +13,19 @@ from .detector_config import BaseDetectorConfig
 | 
			
		||||
 | 
			
		||||
logger = logging.getLogger(__name__)
 | 
			
		||||
 | 
			
		||||
plugin_modules = [
 | 
			
		||||
    importlib.import_module(name)
 | 
			
		||||
    for finder, name, ispkg in pkgutil.iter_modules(
 | 
			
		||||
        plugins.__path__, plugins.__name__ + "."
 | 
			
		||||
    )
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
_included_modules = pkgutil.iter_modules(plugins.__path__, plugins.__name__ + ".")
 | 
			
		||||
 | 
			
		||||
plugin_modules = []
 | 
			
		||||
 | 
			
		||||
for _, name, _ in _included_modules:
 | 
			
		||||
    try:
 | 
			
		||||
        # currently openvino may fail when importing
 | 
			
		||||
        # on an arm device with 64 KiB page size.
 | 
			
		||||
        plugin_modules.append(importlib.import_module(name))
 | 
			
		||||
    except ImportError as e:
 | 
			
		||||
        logger.error(f"Error importing detector runtime: {e}")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
api_types = {det.type_key: det for det in DetectionApi.__subclasses__()}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user