From d36080127c3bbdaa3b7d74d37e6ffbb7fb2674f7 Mon Sep 17 00:00:00 2001 From: leesusu Date: Mon, 7 Dec 2020 12:04:22 +0800 Subject: [PATCH] Fix some bugs. (#108) --- ppgan/faceutils/face_detection/api.py | 4 ++-- ppgan/faceutils/face_detection/detection/sfd/sfd_detector.py | 3 +-- ppgan/modules/conv.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ppgan/faceutils/face_detection/api.py b/ppgan/faceutils/face_detection/api.py index 7b61606..0d503ee 100644 --- a/ppgan/faceutils/face_detection/api.py +++ b/ppgan/faceutils/face_detection/api.py @@ -64,8 +64,8 @@ class FaceAlignment: # Get the face detector face_detector_module = __import__( - 'face_detection.detection.' + face_detector, globals(), locals(), - [face_detector], 0) + 'ppgan.faceutils.face_detection.detection.' + face_detector, + globals(), locals(), [face_detector], 0) self.face_detector = face_detector_module.FaceDetector(verbose=verbose) def get_detections_for_batch(self, images): diff --git a/ppgan/faceutils/face_detection/detection/sfd/sfd_detector.py b/ppgan/faceutils/face_detection/detection/sfd/sfd_detector.py index 4db2d28..b4d7178 100644 --- a/ppgan/faceutils/face_detection/detection/sfd/sfd_detector.py +++ b/ppgan/faceutils/face_detection/detection/sfd/sfd_detector.py @@ -33,8 +33,7 @@ class SFDDetector(FaceDetector): # Initialise the face detector if path_to_detector is None: - model_weights_path = get_weights_path_from_url( - models_urls['s3fd'], cur_path) + model_weights_path = get_weights_path_from_url(models_urls['s3fd']) model_weights = paddle.load(model_weights_path) else: model_weights = paddle.load(path_to_detector) diff --git a/ppgan/modules/conv.py b/ppgan/modules/conv.py index b6018af..2fc09c5 100644 --- a/ppgan/modules/conv.py +++ b/ppgan/modules/conv.py @@ -59,7 +59,7 @@ class Conv2dTransposeRelu(nn.Layer): **kwargs): super().__init__(*args, **kwargs) self.conv_block = nn.Sequential( - nn.ConvTranspose2D(cin, cout, kernel_size, stride, padding, + nn.Conv2DTranspose(cin, cout, kernel_size, stride, padding, output_padding), nn.BatchNorm2D(cout)) self.act = nn.ReLU() -- GitLab