Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,7 @@ import gradio as gr
|
|
| 2 |
import os
|
| 3 |
import cv2
|
| 4 |
import numpy as np
|
|
|
|
| 5 |
from moviepy.editor import *
|
| 6 |
#from share_btn import community_icon_html, loading_icon_html, share_js
|
| 7 |
|
|
@@ -58,6 +59,7 @@ inference model
|
|
| 58 |
|
| 59 |
@torch.no_grad()
|
| 60 |
def xdecoder(image, instruction, *args, **kwargs):
|
|
|
|
| 61 |
image = image.convert("RGB")
|
| 62 |
with torch.autocast(device_type='cuda', dtype=torch.float16):
|
| 63 |
return referring_inpainting_gpt3(model_last, image, instruction, *args, **kwargs)
|
|
|
|
| 2 |
import os
|
| 3 |
import cv2
|
| 4 |
import numpy as np
|
| 5 |
+
from PIL import Image
|
| 6 |
from moviepy.editor import *
|
| 7 |
#from share_btn import community_icon_html, loading_icon_html, share_js
|
| 8 |
|
|
|
|
| 59 |
|
| 60 |
@torch.no_grad()
|
| 61 |
def xdecoder(image, instruction, *args, **kwargs):
|
| 62 |
+
image = Image.open(image)
|
| 63 |
image = image.convert("RGB")
|
| 64 |
with torch.autocast(device_type='cuda', dtype=torch.float16):
|
| 65 |
return referring_inpainting_gpt3(model_last, image, instruction, *args, **kwargs)
|