def to_black(image, transfer_style): if transfer_style == "Hayao": output = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)# 转换为灰度图像 return output elif transfer_style == "Shinkai": return image elif transfer_style == "Kon Satoshi": return image else: return image