facechain icon indicating copy to clipboard operation
facechain copied to clipboard

windows系统推理生成的图片保存路径下有中文 ,cv.imwrite无法保存图片

Open JohnsonXi opened this issue 2 years ago • 2 comments

cv2.imwrite(os.path.join(save_dir, 'single', str(num) + '.png'), img) save_dir路径中有中文 ,保存不了图片;但无报错或提示;

for img in outputs: # count the number of images in the folder num = len(os.listdir(os.path.join(save_dir, 'single'))) cv2.imwrite(os.path.join(save_dir, 'single', str(num) + '.png'), img)

JohnsonXi avatar Jan 12 '24 07:01 JohnsonXi

因此后续“查看历史生成结果”无返回值

JohnsonXi avatar Jan 12 '24 07:01 JohnsonXi

将cv2.imwrite换成cv2.imencode就能保存图片了 for img in outputs: # count the number of images in the folder num = len(os.listdir(os.path.join(save_dir, 'single'))) cv2.imencode('.png', img)[1].tofile(os.path.join(save_dir, "single", str(num) + '.png'))

JohnsonXi avatar Jan 13 '24 05:01 JohnsonXi

please try out the newest train-free, 10s inference version facechain-fact.

sunbaigui avatar Jun 04 '24 09:06 sunbaigui