File size: 640 Bytes
cb70b4c
249653c
3eeeced
249653c
3eeeced
 
 
 
fffc3a2
8503f33
3eeeced
 
fffc3a2
 
3eeeced
 
 
fffc3a2
 
 
 
47ec9f1
cb70b4c
fffc3a2
 
cb70b4c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import gradio as gr
import requests
import torch

import timm

model = timm.create_model("hf_hub:nateraw/resnet18-random", pretrained=True)
model.train()

import os 



def greet(image):
    # url = f'https://huggingface.co/spaces?p=1&sort=modified&search=GPT'
    # html = request_url(url)
    # key = os.getenv("OPENAI_API_KEY")
#     x = torch.ones([1,3,224,224])
    print(type(image))
    out = model(image)
    # model.train()
    return f"Hello {model.bn1.running_mean.data} !!"

image = gr.inputs.Image(label="Upload a photo for beautify", shape=(224,224))
iface = gr.Interface(fn=greet, inputs=image, outputs="text")
iface.launch()