Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,7 @@ Original file is located at
|
|
10 |
import cv2
|
11 |
import gradio as gr
|
12 |
import os
|
|
|
13 |
from PIL import Image
|
14 |
from rembg import remove
|
15 |
from io import BytesIO
|
@@ -52,6 +53,8 @@ class GOSNormalize(object):
|
|
52 |
|
53 |
|
54 |
transform = transforms.Compose([GOSNormalize([0.5,0.5,0.5],[1.0,1.0,1.0])])
|
|
|
|
|
55 |
def get_url_im(t):
|
56 |
user_agent = {'User-agent': 'gradio-app'}
|
57 |
response = requests.get(t, headers=user_agent)
|
|
|
10 |
import cv2
|
11 |
import gradio as gr
|
12 |
import os
|
13 |
+
import functools
|
14 |
from PIL import Image
|
15 |
from rembg import remove
|
16 |
from io import BytesIO
|
|
|
53 |
|
54 |
|
55 |
transform = transforms.Compose([GOSNormalize([0.5,0.5,0.5],[1.0,1.0,1.0])])
|
56 |
+
|
57 |
+
@functools.lru_cache()
|
58 |
def get_url_im(t):
|
59 |
user_agent = {'User-agent': 'gradio-app'}
|
60 |
response = requests.get(t, headers=user_agent)
|