Python 获得;TypeError:int()参数必须是字符串、类似字节的对象或数字,而不是';元组'&引用;在使用pytesseract时
获取TypeError:int()参数必须是字符串、类似字节的对象或数字,而不是使用flask中的PyteSeract的“元组”Python 获得;TypeError:int()参数必须是字符串、类似字节的对象或数字,而不是';元组'&引用;在使用pytesseract时,python,flask,python-tesseract,Python,Flask,Python Tesseract,获取TypeError:int()参数必须是字符串、类似字节的对象或数字,而不是使用flask中的PyteSeract的“元组” def predict(): if request.method == 'POST': imagefile = request.files['img'].read() image = Image.open(io.BytesIO(imagefile)) #image.show() print(typ
def predict():
if request.method == 'POST':
imagefile = request.files['img'].read()
image = Image.open(io.BytesIO(imagefile))
#image.show()
print(type(image))
text = (pytesseract.image_to_string(image,'eng+kan'))
#rint(imagefile.read())
#print(type(imagefile))
print(text)
return render_template('predict.html')
完整的回溯将是有用的information@ex4谢谢,但我想出了一个办法,只需应用一些预处理。@White_Wolf:你到底是如何应用这个预处理的?这对我也有帮助。我面临着同样的问题。