예제 #1
0
 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
예제 #2
0
 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
예제 #3
0
파일: vgg_face.py 프로젝트: wei/faceswap
 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