Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
import modal
|
2 |
import gradio as gr
|
3 |
import numpy as np
|
|
|
|
|
4 |
|
5 |
f = modal.Cls.lookup("casa-interior-hf-v3", "DesignModel")
|
6 |
f_gc = modal.Cls.lookup("casa-interior-gc-v2", "GetProduct")
|
@@ -59,7 +61,17 @@ def casa_ai_run_tab3(dict=None):
|
|
59 |
print('Please provide cropped object')
|
60 |
return None
|
61 |
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
return result_image
|
64 |
|
65 |
with gr.Blocks() as casa:
|
|
|
1 |
import modal
|
2 |
import gradio as gr
|
3 |
import numpy as np
|
4 |
+
from io import BytesIO
|
5 |
+
import requests
|
6 |
|
7 |
f = modal.Cls.lookup("casa-interior-hf-v3", "DesignModel")
|
8 |
f_gc = modal.Cls.lookup("casa-interior-gc-v2", "GetProduct")
|
|
|
61 |
print('Please provide cropped object')
|
62 |
return None
|
63 |
|
64 |
+
result_urls = f_gc.inference.remote(selected_crop)
|
65 |
+
print(result_urls)
|
66 |
+
|
67 |
+
result_image = []
|
68 |
+
for r in result_urls:
|
69 |
+
try:
|
70 |
+
response = requests.get(r)
|
71 |
+
img = Image.open(BytesIO(response.content))
|
72 |
+
result_image.append(img)
|
73 |
+
except:
|
74 |
+
pass
|
75 |
return result_image
|
76 |
|
77 |
with gr.Blocks() as casa:
|