Update app.py
Browse files
app.py
CHANGED
|
@@ -40,11 +40,14 @@ def process_image(image, prompt):
|
|
| 40 |
mask_image = cv2.cvtColor(np.array(mask_image), cv2.COLOR_RGB2GRAY)
|
| 41 |
|
| 42 |
# Perform inpainting with LAMA
|
| 43 |
-
input_dict = {"image": image, "mask": mask_image}
|
| 44 |
-
|
|
|
|
|
|
|
| 45 |
|
| 46 |
-
inpainted_image =
|
| 47 |
-
inpainted_image =
|
|
|
|
| 48 |
|
| 49 |
return mask_image, inpainted_image
|
| 50 |
|
|
|
|
| 40 |
mask_image = cv2.cvtColor(np.array(mask_image), cv2.COLOR_RGB2GRAY)
|
| 41 |
|
| 42 |
# Perform inpainting with LAMA
|
| 43 |
+
# input_dict = {"image": image, "mask": mask_image}
|
| 44 |
+
# imageio.imwrite("./data/data_mask.png", input_dict["mask"])
|
| 45 |
+
# os.system('python predict.py model.path=/home/user/app/ indir=/home/user/app/data/ outdir=/home/user/app/dataout/ device=cpu')
|
| 46 |
+
# # inpainted_image = lama_model.inference(data=input_dict)["data"][0]
|
| 47 |
|
| 48 |
+
inpainted_image = Image.new('RGB', (image.shape[1], image.shape[0]), (0, 0, 0))
|
| 49 |
+
# inpainted_image = cv2.cvtColor(inpainted_image, cv2.COLOR_BGR2RGB)
|
| 50 |
+
# inpainted_image = Image.fromarray(inpainted_image)
|
| 51 |
|
| 52 |
return mask_image, inpainted_image
|
| 53 |
|