import os from PIL import Image def rotate_images(images_folder, output_folder): # Process each file in the images folder for image_file in os.listdir(images_folder): if image_file.endswith('.jpg'): image_path = os.path.join(images_folder, image_file) # Load and rotate the image image = Image.open(image_path) rotated_image = image.rotate(-90, expand=True) # Rotate clockwise by 90 degrees # Save the rotated image output_image_path = os.path.join(output_folder, image_file) rotated_image.save(output_image_path,quality=99) # Set the paths to your image and output folders # images_folder = 'E:\\ios_picture2' images_folder = 'E:\\ios_picture2' output_folder = 'D:\\2024-3-21_ios_add\\aaa' # Rotate images in the folder rotate_images(images_folder, output_folder) print("Processing completed.")
苹果手机拍摄的照片和安卓手机拍摄图片混合作为目标检测或语义分割数据集,需要将苹果手机拍摄的图片进行顺时针旋转90度,然后在用标记软件进行标记
于 2024-04-01 19:52:41 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)