Untitled1.ipynb @4cd1a00 — view markup · raw · history · blame
图片扩展¶
1. 项目介绍¶
图片扩展是一项基于计算机视觉的学习任务。
我们只需要上传待扩展的图片,便能快速生成对图像周围像素的预测,将原图像补全,快来试试吧!
2. 项目结构¶
In [1]:
# 显示文件夹树状目录
import os
import os.path
def dfs_showdir(path, depth):
if depth == 0:
print("root:[" + path + "]")
for item in os.listdir(path):
if item[0] not in ['.', '__']:
print("| " * depth + "+--" + item)
newitem = path +'/'+ item
if os.path.isdir(newitem):
dfs_showdir(newitem, depth +1)
if __name__ == '__main__':
path = os.getcwd() # 文件夹路径
dfs_showdir(path, 0) # 显示文件夹的树状结构
3. 项目demo¶
In [2]:
# 导入相关模块
from handler import *
In [6]:
print("Input img:")
Image.open('/home/jovyan/work/images/test.png').resize((128, 128))
Out[6]:
In [4]:
handle({'Photo': '/home/jovyan/work/images/test.png'})
Out[4]:
In [7]:
print("Output img:")
Image.open('./results/test_output.png').resize((128, 128))
Out[7]: