Spaces:
Sleeping
Sleeping
Update lama_inpaint.py
Browse files- lama_inpaint.py +4 -1
lama_inpaint.py
CHANGED
@@ -21,8 +21,11 @@ from lama.saicinpainting.evaluation.utils import move_to_device
|
|
21 |
from lama.saicinpainting.training.trainers import load_checkpoint
|
22 |
from lama.saicinpainting.evaluation.data import pad_tensor_to_modulo
|
23 |
|
24 |
-
|
|
|
25 |
|
|
|
|
|
26 |
|
27 |
@torch.no_grad()
|
28 |
def inpaint_img_with_lama(
|
|
|
21 |
from lama.saicinpainting.training.trainers import load_checkpoint
|
22 |
from lama.saicinpainting.evaluation.data import pad_tensor_to_modulo
|
23 |
|
24 |
+
def load_img_to_array(img_p):
|
25 |
+
return np.array(Image.open(img_p))
|
26 |
|
27 |
+
def save_array_to_img(img_arr, img_p):
|
28 |
+
Image.fromarray(img_arr.astype(np.uint8)).save(img_p)
|
29 |
|
30 |
@torch.no_grad()
|
31 |
def inpaint_img_with_lama(
|