Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import gradio as gr
|
|
| 2 |
import os
|
| 3 |
import tempfile
|
| 4 |
import zipfile
|
| 5 |
-
from
|
| 6 |
|
| 7 |
def process_adain_api(files, style_strength=1.0):
|
| 8 |
'''API endpoint for AdaIN processing.'''
|
|
@@ -23,11 +23,10 @@ def process_adain_api(files, style_strength=1.0):
|
|
| 23 |
shutil.copy(file.name, input_dir)
|
| 24 |
|
| 25 |
try:
|
| 26 |
-
|
| 27 |
-
style_images_path = "path/to/your/style/images"
|
| 28 |
|
| 29 |
# Run AdaIN
|
| 30 |
-
result_path = run_adain(input_dir,
|
| 31 |
|
| 32 |
# Create zip file
|
| 33 |
zip_path = os.path.join(temp_dir, "style_transfer_results.zip")
|
|
|
|
| 2 |
import os
|
| 3 |
import tempfile
|
| 4 |
import zipfile
|
| 5 |
+
from test_api import run_adain
|
| 6 |
|
| 7 |
def process_adain_api(files, style_strength=1.0):
|
| 8 |
'''API endpoint for AdaIN processing.'''
|
|
|
|
| 23 |
shutil.copy(file.name, input_dir)
|
| 24 |
|
| 25 |
try:
|
| 26 |
+
style_dataset_pth = "tidalove/paleo-real"
|
|
|
|
| 27 |
|
| 28 |
# Run AdaIN
|
| 29 |
+
result_path = run_adain(input_dir, style_dataset_pth, output_dir, style_strength)
|
| 30 |
|
| 31 |
# Create zip file
|
| 32 |
zip_path = os.path.join(temp_dir, "style_transfer_results.zip")
|