Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,18 +9,20 @@ model.train()
|
|
9 |
|
10 |
import os
|
11 |
|
12 |
-
|
13 |
-
|
14 |
def greet(image):
|
15 |
# url = f'https://huggingface.co/spaces?p=1&sort=modified&search=GPT'
|
16 |
# html = request_url(url)
|
17 |
# key = os.getenv("OPENAI_API_KEY")
|
18 |
# x = torch.ones([1,3,224,224])
|
19 |
print(type(image))
|
|
|
|
|
20 |
out = model(image)
|
21 |
# model.train()
|
22 |
return f"Hello {model.bn1.running_mean.data} !!"
|
23 |
|
|
|
|
|
24 |
image = gr.inputs.Image(label="Upload a photo for beautify", shape=(224,224))
|
25 |
iface = gr.Interface(fn=greet, inputs=image, outputs="text")
|
26 |
iface.launch()
|
|
|
9 |
|
10 |
import os
|
11 |
|
|
|
|
|
12 |
def greet(image):
|
13 |
# url = f'https://huggingface.co/spaces?p=1&sort=modified&search=GPT'
|
14 |
# html = request_url(url)
|
15 |
# key = os.getenv("OPENAI_API_KEY")
|
16 |
# x = torch.ones([1,3,224,224])
|
17 |
print(type(image))
|
18 |
+
image = torch.tensor(image).float()
|
19 |
+
print(image.min(), image.max())
|
20 |
out = model(image)
|
21 |
# model.train()
|
22 |
return f"Hello {model.bn1.running_mean.data} !!"
|
23 |
|
24 |
+
|
25 |
+
|
26 |
image = gr.inputs.Image(label="Upload a photo for beautify", shape=(224,224))
|
27 |
iface = gr.Interface(fn=greet, inputs=image, outputs="text")
|
28 |
iface.launch()
|