def get_model(self, git_model_id, model_filename, backend): """ Check if model is available, if not, download and unzip it """ root_path = os.path.abspath(os.path.dirname(sys.argv[0])) cache_path = os.path.join(root_path, "plugins", "extract", ".cache") model = GetModel(model_filename, cache_path, git_model_id).model_path model = cv2.dnn.readNetFromCaffe(model[1], model[0]) # pylint: disable=no-member model.setPreferableTarget(self.get_backend(backend)) return model
def get_model(git_model_id, model_filename): """ Check if model is available, if not, download and unzip it """ root_path = os.path.abspath(os.path.dirname(sys.argv[0])) cache_path = os.path.join(root_path, "plugins", "extract", ".cache") model = GetModel(model_filename, cache_path, git_model_id).model_path model = cv2.dnn.readNetFromCaffe(model[1], model[0]) # pylint: disable=no-member model.setPreferableTarget(cv2.dnn.DNN_TARGET_CPU) # pylint: disable=no-member return model
def get_model(self, git_model_id, model_filename, backend): """ Check if model is available, if not, download and unzip it """ model = GetModel(model_filename, git_model_id).model_path model = cv2.dnn.readNetFromCaffe(model[1], model[0]) model.setPreferableTarget(self.get_backend(backend)) return model