def init_model(self): self.model = KSession(self.name, self.model_path, model_kwargs=dict()) self.model.load_model() placeholder = np.zeros( (self.batchsize, self.input_size, self.input_size, 3), dtype="float32") self.model.predict(placeholder)
def init_model(self): self.model = KSession(self.name, self.model_path, model_kwargs=dict()) self.model.load_model() self.model.append_softmax_activation(layer_index=-1) placeholder = np.zeros((self.batchsize, self.input_size, self.input_size, 3), dtype="float32") self.model.predict(placeholder)
def init_model(self): """ Initialize VGG Face 2 Model. """ model_kwargs = dict(custom_objects={'L2_normalize': L2_normalize}) self.model = KSession(self.name, self.model_path, model_kwargs=model_kwargs, allow_growth=self.config["allow_growth"], exclude_gpus=self._exclude_gpus) self.model.load_model()
def init_model(self): self.model = KSession(self.name, self.model_path, model_kwargs=dict(), allow_growth=self.config["allow_growth"], exclude_gpus=self._exclude_gpus) self.model.load_model() placeholder = np.zeros((self.batchsize, self.input_size, self.input_size, 3), dtype="float32") self.model.predict(placeholder)
def init_model(self): """ Initialize FAN model """ self.model = KSession(self.name, self.model_path, allow_growth=self.config["allow_growth"], exclude_gpus=self._exclude_gpus) self.model.load_model() # Feed a placeholder so Aligner is primed for Manual tool placeholder_shape = (self.batchsize, self.input_size, self.input_size, 3) placeholder = np.zeros(placeholder_shape, dtype="float32") self.model.predict(placeholder)
def init_model(self): """ Initialize FAN model """ model_kwargs = dict(custom_objects={'TorchBatchNorm2D': TorchBatchNorm2D}) self.model = KSession(self.name, self.model_path, model_kwargs=model_kwargs, allow_growth=self.config["allow_growth"]) self.model.load_model() # Feed a placeholder so Aligner is primed for Manual tool placeholder_shape = (self.batchsize, 3, self.input_size, self.input_size) placeholder = np.zeros(placeholder_shape, dtype="float32") self.model.predict(placeholder)