提交 34aecfbb 编写于 作者: L LielinJiang

Merge branch 'master' of https://github.com/PaddlePaddle/PaddleGAN into release/0.1.0

......@@ -185,14 +185,22 @@ class PSGANPredictor(BasePredictor):
inference = Inference(self.cfg, self.weight_path)
postprocess = PostProcess(self.cfg)
source = Image.open(self.args.source_path).convert("RGB")
try:
source = Image.open(self.args.source_path).convert("RGB")
except IOError:
print("Error: {} is not exist".format(self.args.source_path))
sys.exit()
reference_paths = list(Path(self.args.reference_dir).glob("*"))
if len(reference_paths) == 0:
print("Error: Can't find image file in {}.".format(
self.args.reference_dir))
sys.exit()
np.random.shuffle(reference_paths)
for reference_path in reference_paths:
if not reference_path.is_file():
print(reference_path, "is not a valid file.")
continue
reference = Image.open(reference_path).convert("RGB")
# Transfer the psgan from reference to source.
......
......@@ -4,3 +4,4 @@ scikit-image>=0.14.0
scipy>=1.1.0
opencv-python
imageio-ffmpeg
dlib
......@@ -20,7 +20,7 @@ with open('requirments.txt', encoding="utf-8-sig") as f:
def readme():
with open('doc/doc_en/whl_en.md', encoding="utf-8-sig") as f:
with open('README_en.md', encoding="utf-8-sig") as f:
README = f.read()
return README
......@@ -30,10 +30,13 @@ setup(
packages=['ppgan'],
include_package_data=True,
entry_points={"console_scripts": ["paddlegan= paddlegan.paddlegan:main"]},
author='PaddlePaddle Author',
version='0.1.0',
install_requires=requirements,
license='Apache License 2.0',
description='Awesome GAN toolkits based on PaddlePaddle',
long_description=readme(),
long_description_content_type='text/markdown',
url='https://github.com/PaddlePaddle/PaddleGAN',
download_url='https://github.com/PaddlePaddle/PaddleGAN.git',
keywords=['gan paddlegan'],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册