mirror of
https://git.mirrors.martin98.com/https://github.com/danielgatis/rembg
synced 2025-08-15 20:45:56 +08:00
chore: Update .gitignore and add .python-version file
This commit is contained in:
parent
688b34841b
commit
ed1c29576f
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,7 +11,6 @@ __pycache__/
|
|||||||
*~≈
|
*~≈
|
||||||
.env
|
.env
|
||||||
.envrc
|
.envrc
|
||||||
.python-version
|
|
||||||
.idea
|
.idea
|
||||||
.pytest_cache
|
.pytest_cache
|
||||||
|
|
||||||
|
1
.python-version
Normal file
1
.python-version
Normal file
@ -0,0 +1 @@
|
|||||||
|
3.12.4
|
@ -241,13 +241,13 @@ def remove(
|
|||||||
"""
|
"""
|
||||||
if isinstance(data, bytes) or force_return_bytes:
|
if isinstance(data, bytes) or force_return_bytes:
|
||||||
return_type = ReturnType.BYTES
|
return_type = ReturnType.BYTES
|
||||||
img = Image.open(io.BytesIO(cast(bytes, data)))
|
img = cast(PILImage, Image.open(io.BytesIO(cast(bytes, data))))
|
||||||
elif isinstance(data, PILImage):
|
elif isinstance(data, PILImage):
|
||||||
return_type = ReturnType.PILLOW
|
return_type = ReturnType.PILLOW
|
||||||
img = data
|
img = cast(PILImage, data)
|
||||||
elif isinstance(data, np.ndarray):
|
elif isinstance(data, np.ndarray):
|
||||||
return_type = ReturnType.NDARRAY
|
return_type = ReturnType.NDARRAY
|
||||||
img = Image.fromarray(data)
|
img = cast(PILImage, Image.fromarray(data))
|
||||||
else:
|
else:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Input type {} is not supported. Try using force_return_bytes=True to force python bytes output".format(
|
"Input type {} is not supported. Try using force_return_bytes=True to force python bytes output".format(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user