diff --git a/modules/image/Image_gan/style_transfer/lapstyle_ocean/README.md b/modules/image/Image_gan/style_transfer/lapstyle_ocean/README.md index ae0d7aac17509c1afc44c3681313bb0a833ded5a..b1df2589abad5965e6274553d9be491d13efebc0 100644 --- a/modules/image/Image_gan/style_transfer/lapstyle_ocean/README.md +++ b/modules/image/Image_gan/style_transfer/lapstyle_ocean/README.md @@ -48,8 +48,8 @@ - ```shell $ hub install lapstyle_ocean ``` - - 如您安装时遇到问题,可参考:[零基础windows安装](../../../../docs/docs_ch/get_start/windows_quickstart.md) - | [零基础Linux安装](../../../../docs/docs_ch/get_start/linux_quickstart.md) | [零基础MacOS安装](../../../../docs/docs_ch/get_start/mac_quickstart.md) + - 如您安装时遇到问题,可参考:[零基础windows安装](../../../../../docs/docs_ch/get_start/windows_quickstart.md) + | [零基础Linux安装](../../../../../docs/docs_ch/get_start/linux_quickstart.md) | [零基础MacOS安装](../../../../../docs/docs_ch/get_start/mac_quickstart.md) ## 三、模型API预测 diff --git a/modules/image/Image_gan/style_transfer/lapstyle_ocean/model.py b/modules/image/Image_gan/style_transfer/lapstyle_ocean/model.py index ac37f5e677d092cadde1432b777bcd6a7a8877d3..d66c02322ecf630d643b23e193ac95b05d62a826 100644 --- a/modules/image/Image_gan/style_transfer/lapstyle_ocean/model.py +++ b/modules/image/Image_gan/style_transfer/lapstyle_ocean/model.py @@ -11,19 +11,19 @@ # 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 cv2 as cv -import numpy as np import urllib.request -from PIL import Image +import cv2 as cv +import numpy as np import paddle import paddle.nn.functional as F from paddle.vision.transforms import functional - +from PIL import Image +from ppgan.models.generators import DecoderNet +from ppgan.models.generators import Encoder +from ppgan.models.generators import RevisionNet from ppgan.utils.visual import tensor2img -from ppgan.models.generators import DecoderNet, Encoder, RevisionNet def img(img): diff --git a/modules/image/Image_gan/style_transfer/lapstyle_ocean/module.py b/modules/image/Image_gan/style_transfer/lapstyle_ocean/module.py index 8956d3f5ebcf4c52fb85f290abf68977dec613e5..254da42b660666c50a551b97ad486572589f34e5 100644 --- a/modules/image/Image_gan/style_transfer/lapstyle_ocean/module.py +++ b/modules/image/Image_gan/style_transfer/lapstyle_ocean/module.py @@ -11,21 +11,23 @@ # 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 +import numpy as np +import paddle from skimage.io import imread -from skimage.transform import rescale, resize +from skimage.transform import rescale +from skimage.transform import resize +import paddlehub as hub from .model import LapStylePredictor 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/style_transfer/lapstyle_ocean/util.py b/modules/image/Image_gan/style_transfer/lapstyle_ocean/util.py index b88ac3562b74cadc1d4d6459a56097ca4a938a0b..531a0ae0d487822a870ba7f09817e658967aff10 100644 --- a/modules/image/Image_gan/style_transfer/lapstyle_ocean/util.py +++ b/modules/image/Image_gan/style_transfer/lapstyle_ocean/util.py @@ -1,4 +1,5 @@ import base64 + import cv2 import numpy as np