Spaces:
Running
on
Zero
Running
on
Zero
Jagrut Thakare
commited on
Commit
·
3b555b3
1
Parent(s):
d4f9371
v2.2
Browse files
app.py
CHANGED
@@ -12,11 +12,19 @@ login(os.getenv("HF_TOKEN"))
|
|
12 |
@spaces.GPU()
|
13 |
def process_image(image, mask, progress=gr.Progress(track_tqdm=True)):
|
14 |
if np.unique(mask["background"]).size == 1:
|
15 |
-
print("\
|
|
|
|
|
|
|
16 |
output = process_inpaint(image["background"], image["layers"][0])
|
17 |
else:
|
18 |
-
print("
|
19 |
-
print("Mask : ", mask
|
|
|
|
|
|
|
|
|
|
|
20 |
output = process_inpaint(image["background"], mask["background"])
|
21 |
img_output = Image.fromarray(output).convert("RGB")
|
22 |
|
|
|
12 |
@spaces.GPU()
|
13 |
def process_image(image, mask, progress=gr.Progress(track_tqdm=True)):
|
14 |
if np.unique(mask["background"]).size == 1:
|
15 |
+
print("\nDid not Receive Mask\n")
|
16 |
+
print("Mask Size : ", image["layers"][0].shape)
|
17 |
+
print("Unique values: ", np.unique(image["layers"][0]))
|
18 |
+
print("Type : ", type(image["layers"][0]))
|
19 |
output = process_inpaint(image["background"], image["layers"][0])
|
20 |
else:
|
21 |
+
print("\nProcessing Received Mask\n")
|
22 |
+
print("Mask Size : ", mask.shape)
|
23 |
+
print("Unique values: ", np.unique(mask))
|
24 |
+
print("Type : ", type(mask))
|
25 |
+
print("Mask Size : ", mask["background"].shape)
|
26 |
+
print("Unique values: ", np.unique(mask["background"]))
|
27 |
+
print("Type : ", type(mask["background"]))
|
28 |
output = process_inpaint(image["background"], mask["background"])
|
29 |
img_output = Image.fromarray(output).convert("RGB")
|
30 |
|