图片统一转为RGB
This commit is contained in:
@@ -76,6 +76,7 @@ def split_image(img_path, max_ratio=2.82, best_ration=1.41, overlap=0.05):
|
|||||||
cropped_img = cropped_img.convert("RGB")
|
cropped_img = cropped_img.convert("RGB")
|
||||||
split_result.append({"img": cropped_img, "x_offset": offset, "y_offset": 0})
|
split_result.append({"img": cropped_img, "x_offset": offset, "y_offset": 0})
|
||||||
else:
|
else:
|
||||||
|
img = img.convert("RGB")
|
||||||
split_result.append({"img": img, "x_offset": 0, "y_offset": 0})
|
split_result.append({"img": img, "x_offset": 0, "y_offset": 0})
|
||||||
return split_result
|
return split_result
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user