Spaces:
Running
on
Zero
Running
on
Zero
testing out creating a simple app
Browse files
app.py
CHANGED
@@ -1,7 +1,25 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
4 |
-
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
from chrislib.general import uninvert, view
|
|
|
4 |
|
5 |
+
from intrinsic.pipeline import run_pipeline
|
6 |
+
from intrinsic.model_util import load_models
|
7 |
+
|
8 |
+
intrinsic_model = load_models('paper_weights')
|
9 |
+
global intrinsic_model
|
10 |
+
|
11 |
+
def decompose(img):
|
12 |
+
result = run_pipeline(
|
13 |
+
img,
|
14 |
+
intrinsic_model
|
15 |
+
)
|
16 |
+
|
17 |
+
return view(uninvert(result['inv_shd'])), "Completed"
|
18 |
+
|
19 |
+
|
20 |
+
gr.Interface(
|
21 |
+
generatedepth,
|
22 |
+
[gr.inputs.Image(type="numpy", label="Input")],
|
23 |
+
[gr.outputs.Image(type="numpy", label="Output"), gr.outputs.Textbox(label=":")],
|
24 |
+
examples=[["avocado.jpg"]]
|
25 |
+
).launch(debug=True)
|