def setUp(self): self.set = HNSWFeaturesSet("/tmp/foo.bin", 10, 2)
from lib.basic_logger import log from lib.yaml_config import YamlConfig as Config from lib.redis_bus import RedisBus #NB! Import before MySQLEngine to avoid SegmentationFault from lib.query_executor.query_executor import QueryDictExecutor from lib.mysql_driver.mysql_engine import MySQLEngine from lib.get_face_hash import Infer from lib.hnsw_features_set import HNSWFeaturesSet from lib.queries.mysql_queries import mysql_queries as query from mysql.connector.errors import ProgrammingError, InterfaceError, OperationalError, IntegrityError # Create global instance of config project_dir = "/opt/projects/mvid" config = Config('/etc/spyspace/mvid_conf.yaml') # Create global instance of basic transport bus = RedisBus(host=config.find('redis_host')) executor = QueryDictExecutor(MySQLEngine, config.find('mysql_host'), user=config.find('mysql_user'), password=config.find('mysql_passwd'), database="mvideo") features_set = HNSWFeaturesSet(config.find('ann_path'), config.find('ann_max_elements')) infer = Infer()
def test_file_not_created_error(self): with self.assertRaises(FileNotFoundError): HNSWFeaturesSet("/foo/bar.bin", 1, 1)
ann_path = config.find('ann_path') ann_max_elements = config.find('ann_max_elements') vino_mode = config.find('vino_mode') cpu_extension = config.find('cpu_extension') detector_model = config.find('intel_fd_model') landmarks_model = config.find('intel_lm_model') reid_model = config.find('intel_ri_model') detection_threshold = config.find('detection_threshold') pedestrian_model = config.find('intel_pedestrian_model') pedestrian_threshold = config.find('pedestrian_threshold') bus = RedisBus(host=host, queue_size=queue_size) ram_bus = RamBus() executor = QueryDictExecutor(MySQLEngine, db_host, user=db_user, password=db_password, database=db_database) features_set = HNSWFeaturesSet(ann_path, ann_max_elements) frame_handler = OpenVinoHandler(mode=vino_mode, cpu_extension=cpu_extension, detection_threshold=detection_threshold, classDetector=FaceDetectorModel, detector_model=detector_model, classLandmarks=LandmarksDetector, landmarks_model=landmarks_model, classReid=FaceReidModel, reid_model=reid_model) pedestrian_frame_handler = OpenVinoHandler(mode=vino_mode, cpu_extension=cpu_extension, detection_threshold=pedestrian_threshold, classDetector=FaceDetectorModel, detector_model=pedestrian_model)