diff --git a/third_part/GPEN/face_morpher/facemorpher/warper.py b/third_part/GPEN/face_morpher/facemorpher/warper.py index 50b1a315..9f930a22 100644 --- a/third_part/GPEN/face_morpher/facemorpher/warper.py +++ b/third_part/GPEN/face_morpher/facemorpher/warper.py @@ -13,7 +13,7 @@ def bilinear_interpolate(img, coords): x0, y0 = int_coords dx, dy = coords - int_coords - # 4 Neighour pixels + # 4 Neighbour pixels q11 = img[y0, x0] q21 = img[y0, x0+1] q12 = img[y0+1, x0] diff --git a/third_part/face3d/models/template_model.py b/third_part/face3d/models/template_model.py index dac7b33d..6d511a6c 100644 --- a/third_part/face3d/models/template_model.py +++ b/third_part/face3d/models/template_model.py @@ -87,7 +87,7 @@ def forward(self): def backward(self): """Calculate losses, gradients, and update network weights; called in every training iteration""" - # caculate the intermediate results if necessary; here self.output has been computed during function + # calculate the intermediate results if necessary; here self.output has been computed during function # calculate loss given the input and intermediate results self.loss_G = self.criterionLoss(self.output, self.data_B) * self.opt.lambda_regression self.loss_G.backward() # calculate gradients of network G w.r.t. loss_G diff --git a/third_part/face3d/util/util.py b/third_part/face3d/util/util.py index 0d689ca1..fda1509f 100644 --- a/third_part/face3d/util/util.py +++ b/third_part/face3d/util/util.py @@ -68,7 +68,7 @@ def tensor2im(input_image, imtype=np.uint8): image_numpy = image_tensor.clamp(0.0, 1.0).cpu().float().numpy() # convert it into a numpy array if image_numpy.shape[0] == 1: # grayscale to RGB image_numpy = np.tile(image_numpy, (3, 1, 1)) - image_numpy = np.transpose(image_numpy, (1, 2, 0)) * 255.0 # post-processing: tranpose and scaling + image_numpy = np.transpose(image_numpy, (1, 2, 0)) * 255.0 # post-processing: transpose and scaling else: # if it is a numpy array, do nothing image_numpy = input_image return image_numpy.astype(imtype) diff --git a/utils/inference_utils.py b/utils/inference_utils.py index 84025f17..9abf57eb 100644 --- a/utils/inference_utils.py +++ b/utils/inference_utils.py @@ -197,7 +197,7 @@ def Laplacian_Pyramid_Blending_with_mask(A, B, m, num_levels = 6): lpB = [gpB[num_levels-1]] gpMr = [gpM[num_levels-1]] for i in range(num_levels-1,0,-1): - # Laplacian: subtarct upscaled version of lower level from current level + # Laplacian: subtract upscaled version of lower level from current level # to get the high frequencies LA = np.subtract(gpA[i-1], cv2.pyrUp(gpA[i])) LB = np.subtract(gpB[i-1], cv2.pyrUp(gpB[i]))