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

Sketching + Inpainting Capabilities to Gradio #2144

Merged
merged 22 commits into from
Sep 23, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
formatting
  • Loading branch information
abidlabs committed Sep 6, 2022
commit 5c67ff1445e7a0f20fff655b28df88ca668e6260
5 changes: 4 additions & 1 deletion gradio/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,10 @@ def preprocess(self, x: str | Dict) -> np.array | PIL.Image | str | None:
"""
if x is None:
return x
if self.tool in ["sketch", "color-sketch"] and self.source in ["upload", "webcam"]:
if self.tool in ["sketch", "color-sketch"] and self.source in [
"upload",
"webcam",
]:
x, mask = x["image"], x["mask"]

im = processing_utils.decode_base64_to_image(x)
Expand Down