Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- app.py +3 -11
- style_images/Great_Wave.jpg +0 -0
- style_images/Lego_Bricks.jpg +0 -0
- style_images/Oil_Painting.jpg +0 -0
- style_images/Starry_Night.jpg +3 -0
.gitattributes
CHANGED
@@ -37,3 +37,4 @@ style_images/Scream.jpg filter=lfs diff=lfs merge=lfs -text
|
|
37 |
style_images/StarryNight.jpg filter=lfs diff=lfs merge=lfs -text
|
38 |
content_images/Scream.jpg filter=lfs diff=lfs merge=lfs -text
|
39 |
style_images/Mosaic.jpg filter=lfs diff=lfs merge=lfs -text
|
|
|
|
37 |
style_images/StarryNight.jpg filter=lfs diff=lfs merge=lfs -text
|
38 |
content_images/Scream.jpg filter=lfs diff=lfs merge=lfs -text
|
39 |
style_images/Mosaic.jpg filter=lfs diff=lfs merge=lfs -text
|
40 |
+
style_images/Starry_Night.jpg filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import time
|
2 |
from PIL import Image
|
3 |
from tqdm import tqdm
|
@@ -74,17 +75,8 @@ def save_img(img, original_size):
|
|
74 |
return img
|
75 |
|
76 |
|
77 |
-
|
78 |
-
|
79 |
-
'Starry Night': 'StarryNight.jpg',
|
80 |
-
'Great Wave': 'GreatWave.jpg',
|
81 |
-
'Scream': 'Scream.jpg',
|
82 |
-
# styles
|
83 |
-
'Lego Bricks': 'LegoBricks.jpg',
|
84 |
-
'Oil Painting': 'OilPainting.jpg',
|
85 |
-
'Mosaic': 'Mosaic.jpg'
|
86 |
-
}
|
87 |
-
style_options = {k: f'./style_images/{v}' for k, v in style_options.items()}
|
88 |
|
89 |
@spaces.GPU(duration=30)
|
90 |
def inference(content_image, style_image, style_strength, output_quality, progress=gr.Progress(track_tqdm=True)):
|
|
|
1 |
+
import os
|
2 |
import time
|
3 |
from PIL import Image
|
4 |
from tqdm import tqdm
|
|
|
75 |
return img
|
76 |
|
77 |
|
78 |
+
style_files = os.listdir('./style_images')
|
79 |
+
style_options = {' '.join(style_file.split('.')[0].split('_')): f'./style_images/{style_file}' for style_file in style_files}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
@spaces.GPU(duration=30)
|
82 |
def inference(content_image, style_image, style_strength, output_quality, progress=gr.Progress(track_tqdm=True)):
|
style_images/Great_Wave.jpg
ADDED
style_images/Lego_Bricks.jpg
ADDED
style_images/Oil_Painting.jpg
ADDED
style_images/Starry_Night.jpg
ADDED
Git LFS Details
|