Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgatis committed Mar 31, 2023
1 parent 54cf4f8 commit 658ab42
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions rembg/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
import time
from enum import Enum
from typing import IO, Optional, cast
from typing import IO, Optional, Tuple, cast

import aiohttp
import click
Expand Down Expand Up @@ -377,7 +377,11 @@ def __init__(
self.ae = ae
self.om = om
self.ppm = ppm
self.bgc = map(int, bgc.split(",")) if bgc else None
self.bgc = (
cast(Tuple[int, int, int, int], tuple(map(int, bgc.split(","))))
if bgc
else None
)

class CommonQueryPostParams:
def __init__(
Expand Down Expand Up @@ -413,7 +417,11 @@ def __init__(
self.ae = ae
self.om = om
self.ppm = ppm
self.bgc = map(int, bgc.split(",")) if bgc else None
self.bgc = (
cast(Tuple[int, int, int, int], tuple(map(int, bgc.split(","))))
if bgc
else None
)

def im_without_bg(content: bytes, commons: CommonQueryParams) -> Response:
return Response(
Expand Down

0 comments on commit 658ab42

Please sign in to comment.