Jagrut Thakare commited on
Commit
3b555b3
·
1 Parent(s): d4f9371
Files changed (1) hide show
  1. app.py +11 -3
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("\n Did not Receive Mask\n")
 
 
 
16
  output = process_inpaint(image["background"], image["layers"][0])
17
  else:
18
- print("Processing Received Mask")
19
- print("Mask : ", mask["background"][:,:,3])
 
 
 
 
 
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