Spaces:
Running
on
Zero
Running
on
Zero
thuzhaowang
commited on
Commit
·
d5b6d2d
1
Parent(s):
9bd1f8b
use gradio 4
Browse files
README.md
CHANGED
@@ -4,7 +4,7 @@ emoji: 📉
|
|
4 |
colorFrom: purple
|
5 |
colorTo: blue
|
6 |
sdk: gradio
|
7 |
-
sdk_version:
|
8 |
python_version: 3.10.14
|
9 |
app_file: app.py
|
10 |
pinned: false
|
|
|
4 |
colorFrom: purple
|
5 |
colorTo: blue
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 4.44.1
|
8 |
python_version: 3.10.14
|
9 |
app_file: app.py
|
10 |
pinned: false
|
app.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
import os
|
2 |
-
os.environ["no_proxy"] = "localhost,127.0.0.1,::1"
|
3 |
import yaml
|
4 |
import numpy as np
|
5 |
from PIL import Image
|
@@ -8,7 +7,7 @@ import importlib
|
|
8 |
import torch
|
9 |
import tempfile
|
10 |
import json
|
11 |
-
|
12 |
from core.models import DiT_models
|
13 |
from core.diffusion import create_diffusion
|
14 |
from core.utils.dinov2 import Dinov2Model
|
@@ -81,7 +80,7 @@ def preprocess(input_image, do_remove_background):
|
|
81 |
processed_image = input_image
|
82 |
return processed_image
|
83 |
|
84 |
-
|
85 |
def sample(image, seed, category):
|
86 |
# seed
|
87 |
np.random.seed(seed)
|
|
|
1 |
import os
|
|
|
2 |
import yaml
|
3 |
import numpy as np
|
4 |
from PIL import Image
|
|
|
7 |
import torch
|
8 |
import tempfile
|
9 |
import json
|
10 |
+
import spaces
|
11 |
from core.models import DiT_models
|
12 |
from core.diffusion import create_diffusion
|
13 |
from core.utils.dinov2 import Dinov2Model
|
|
|
80 |
processed_image = input_image
|
81 |
return processed_image
|
82 |
|
83 |
+
@spaces.GPU
|
84 |
def sample(image, seed, category):
|
85 |
# seed
|
86 |
np.random.seed(seed)
|