Solution: An error error opening file occurs when labeling with labelimg

Problem Description

  • After collecting the pictures, I am going to use the labelimg tool to label the pictures today. After labeling one or two pictures, I continue to label the next one, but an error message pops up: I thought it was caused by Chinese characters in the path of the read picture
    insert image description here
    . After changing to a path that does not contain Chinese, this error still occurs. I searched the Internet and found that it should be a problem with the image format, not the Chinese path contained in the image.

Solution

from PIL import Image

image_path = "D:/11.png"
image_new_path = "D:/12.png"
image = Image.open(image_path)
image = image.convert('RGB')
image.save(image_new_path)

Reference article: https://blog.csdn.net/xuhong_001/article/details/126530908

Guess you like

Origin blog.csdn.net/ungoing/article/details/127973470