From aa49f75bb7edaaaae788702f61e64a9cdb941c79 Mon Sep 17 00:00:00 2001 From: chenjian Date: Tue, 8 Mar 2022 15:17:46 +0800 Subject: [PATCH] fix dependency order --- modules/image/Image_gan/gan/photopen/model.py | 9 ++++----- modules/image/Image_gan/gan/photopen/module.py | 18 ++++++++++-------- modules/image/Image_gan/gan/photopen/util.py | 1 + 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/modules/image/Image_gan/gan/photopen/model.py b/modules/image/Image_gan/gan/photopen/model.py index f9e517ec..4a0b0a48 100644 --- a/modules/image/Image_gan/gan/photopen/model.py +++ b/modules/image/Image_gan/gan/photopen/model.py @@ -11,17 +11,16 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +import os -from PIL import Image, ImageOps import cv2 import numpy as np -import os - import paddle - +from PIL import Image +from PIL import ImageOps from ppgan.models.generators import SPADEGenerator -from ppgan.utils.photopen import data_onehot_pro from ppgan.utils.filesystem import load +from ppgan.utils.photopen import data_onehot_pro class PhotoPenPredictor: diff --git a/modules/image/Image_gan/gan/photopen/module.py b/modules/image/Image_gan/gan/photopen/module.py index a099c5db..4ff21ceb 100644 --- a/modules/image/Image_gan/gan/photopen/module.py +++ b/modules/image/Image_gan/gan/photopen/module.py @@ -11,22 +11,24 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -import os import argparse import copy +import os -import paddle -import paddlehub as hub -from paddlehub.module.module import moduleinfo, runnable, serving -import numpy as np import cv2 -from skimage.io import imread -from skimage.transform import rescale, resize +import numpy as np +import paddle from ppgan.utils.config import get_config +from skimage.io import imread +from skimage.transform import rescale +from skimage.transform import resize +import paddlehub as hub from .model import PhotoPenPredictor from .util import base64_to_cv2 +from paddlehub.module.module import moduleinfo +from paddlehub.module.module import runnable +from paddlehub.module.module import serving @moduleinfo( diff --git a/modules/image/Image_gan/gan/photopen/util.py b/modules/image/Image_gan/gan/photopen/util.py index b88ac356..531a0ae0 100644 --- a/modules/image/Image_gan/gan/photopen/util.py +++ b/modules/image/Image_gan/gan/photopen/util.py @@ -1,4 +1,5 @@ import base64 + import cv2 import numpy as np -- GitLab