Open Tylerrrrrrr007 opened 4 years ago
'''theta = np.random.randint(-15, 15) * np.pi / 180
M_shear = np.array([[1, np.tan(theta), 0], [0, 1, 0]], dtype=np.float32)'''
M_shear = np.array([[1, np.tan(0), 0], [0, 1, 0]], dtype=np.float32)
_img = Image.fromarray(cv2.warpAffine(np.array(_img), M_shear, hanzi_size))
yield _img
解决了,上边这个东西不能整个注释掉QAQ
TypeError: zip argument #1 must support iteration
求问:为什么不可迭代了?原代码没动
数据集
data_directory = "data" with open("all.txt", 'r', encoding="utf-8") as fr: zi_sets = fr.read() for i, zi in enumerate(zi_sets):
目录准备