python黑白图片上色
Ta的回复 :你好,我需要代码学习学习。 from aip import AipImageProcess APP_ID='' API_KEY='' SECRET_KEY='' client = AipImageProcess(APP_ID, API_KEY, SECRET_KEY) with open('hb.jpg', 'rb') as fp: image=fp.read() s=client.colourize(image)#调用黑白图像上色 with open('hb1.jpg', 'wb') as f: f.write(s) 能输出图像,但没有内容。 错误提示:TypeError: a bytes-like object is required, not 'dict'