在AI中水平翻轉圖片,可使用圖像處理工具或代碼實現。例如,在Python中使用PIL庫:
python
from PIL import Image
img = Image.open(image.jpg)
flipped_img = img.transpose(Image.FLIP_LEFT_RIGHT)
flipped_img.save(flipped_image.jpg)
此代碼將圖像水平翻轉并保存。
python
from PIL import Image
img = Image.open(image.jpg)
flipped_img = img.transpose(Image.FLIP_LEFT_RIGHT)
flipped_img.save(flipped_image.jpg)
此代碼將圖像水平翻轉并保存。