fix(GPU): 修复GFPGAN增强后蓝色遮罩问题 #2011
Reference in New Issue
Block a user
Delete Branch "fix/gfpgan-blue-face"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题
GFPGAN增强后,人脸出现蓝色遮罩(整半张脸变蓝)。
根因
musetalk_server.pyL935 附近:gfpgan_enhancer(_face_t, return_rgb=False, weight=0.35)—return_rgb=False返回 BGR 格式cv2.cvtColor(_out.astype(np.uint8), cv2.COLOR_RGB2BGR)— 又做了一次 RGB→BGR 转换同时复杂的色彩校正(mean/std 对齐)在错误的色彩空间下工作,可能引入额外色偏。
修复
cv2.cvtColor(_out_rgb, cv2.COLOR_RGB2BGR)现在是正确的值域处理
测试
备注