Scale-Iterative Upscaling Network for Image Deblurring
代码链接:GitHub - minyuanye/SIUN: Sharp Image Deblurring
1. 配置环境:tensorflow-gpu 1.4.0+cuda8+cudnn6
2. 数据集:使用自己的成对数据集,我放置的路径如下
修改SIUN-master\code\src\lib\data_producer.py中读取文件的代码如下:
def __traversalDir(self,root):
for name in os.listdir(root):
fullPath = os.path.join(root, name)
if os.path.isdir(fullPath):
self.__directoryList.append(fullPath)
for directory in self.__directoryList:
if directory.endswith('blur'):
for parent, dirnames, filenames in os.walk(directory):
for filename in filenames:
self.__fileBlurList.append(os.path.join(parent,filename))
修改SIUN-master\code\src\config.py中的文件路径
3. 打开deblur.py文件,修改True或False选择训练、测试、预测等功能。
def getArgs():
parser = argparse.ArgumentParser()
parser.add_argument("--train", help="train the model", action="store_true", default=True)
parser.add_argument("--test", help="test the model", action="store_true", default=False)
parser.add_argument("--apply", help="use the model", action="store_true", default=False)
parser.add_argument("--verify", help="verify the model", action="store_true", default=False)
parser.add_argument("--gpu", help="test device list", default="0")
parser.add_argument("--file-path", help="file path of the input image")
parser.add_argument("--dir-path", help="dir path of the input images")
parser.add_argument("--result-dir", help="deblur result dir of the input images")
parser.add_argument("--iter", help="iter times", default=0, type=int)
return parser.parse_args()