Python中用于图像增强的图像增强管道出错
据我所知,路径是正确的,我也在遵循Augmentor文档 代码:Python中用于图像增强的图像增强管道出错,python,machine-learning,augmentor,Python,Machine Learning,Augmentor,据我所知,路径是正确的,我也在遵循Augmentor文档 代码: import Augmentor import os import warnings warnings.filterwarnings('ignore') import keras import glob for img in glob.glob("C:\\Users\\Diganta\\Desktop\\Courses and Projects\\Projects\\Bennet\\irregular*.jpg"): p
import Augmentor
import os
import warnings
warnings.filterwarnings('ignore')
import keras
import glob
for img in glob.glob("C:\\Users\\Diganta\\Desktop\\Courses and Projects\\Projects\\Bennet\\irregular*.jpg"):
p = Augmentor.Pipeline(img)
p.rotate(probability=0.7, max_left_rotation=10, max_right_rotation=10)
p.zoom(probability=0.5, min_factor=1.1, max_factor=1.5)
p.sample(100)
这确实运行了,但根据Augmentor文档中的指定,没有在目录中创建包含增强图像的输出文件夹。我不是增强专家,但通过查看管道,它似乎希望将源目录作为参数,并且它将自动查找其中的所有图片 尝试直接传递目录,不使用全局和循环:
p = Augmentor.Pipeline("C:\\Users\\Diganta\\Desktop\\Courses and Projects\\Projects\\Bennet")
p.rotate(probability=0.7, max_left_rotation=10, max_right_rotation=10)
p.zoom(probability=0.5, min_factor=1.1, max_factor=1.5)
p.sample(100)
在我看来,您还希望在所有图像上运行管道,而不是在子集上运行管道。如果是这种情况,则将p.sample(100)
替换为:
p.sample(0)
或:
请发一封信。特别是,请发布实际代码,而不是屏幕截图。@melpomene感谢您的建议。同一个“FileNotFoundError”对象是否没有属性“message”-在尝试p.process或p.sample(0)时获取此属性。@DigantaMisra:我认为您使用的是Python3,但此库是为Python2编写的。无论如何,问题是你的路径不存在——检查它是否存在correct@DigantaMisra:如果您有问题,请粘贴完整输出(作为文本,而不是屏幕截图)
p.process()