Update Optional[x] -> x | None and Union[x, y] to x | y (#26633)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2025-10-12 09:51:31 -07:00
committed by GitHub
parent 9bb38130cb
commit 8fcaaf6a16
944 changed files with 9490 additions and 10121 deletions
+1 -2
View File
@@ -3,7 +3,6 @@
from io import BytesIO
from pathlib import Path
from typing import Union
import pybase64
import torch
@@ -26,7 +25,7 @@ def rescale_image_size(
def rgba_to_rgb(
image: Image.Image,
background_color: Union[tuple[int, int, int], list[int]] = (255, 255, 255),
background_color: tuple[int, int, int] | list[int] = (255, 255, 255),
) -> Image.Image:
"""Convert an RGBA image to RGB with filled background color."""
assert image.mode == "RGBA"