Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint error introduced in #52 #59

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions advanced/segment-anything/sam.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ def predict_url(self, url: str) -> LeptonPickled:
# urllib to do this. Note that this is just an example - you can use any method
# to download the image.
try:
raw_img = np.asarray(Image.open(io.BytesIO(urlopen(url).read())).convert("RGB"))
raw_img = np.asarray(
Image.open(io.BytesIO(urlopen(url).read())).convert("RGB")
)
except Exception as e:
# HTTPException is a special exception that will be translated to a proper
# http error by fastAPI and return to the user side. In this case, we will
Expand Down Expand Up @@ -203,7 +205,9 @@ def generate_mask(self, url: str) -> PNGResponse:
masks.
"""
try:
raw_img = np.asarray(Image.open(io.BytesIO(urlopen(url).read())).convert("RGB"))
raw_img = np.asarray(
Image.open(io.BytesIO(urlopen(url).read())).convert("RGB")
)
except Exception as e:
raise HTTPException(
status_code=400,
Expand Down