Spaces:
Runtime error
Runtime error
Update app.py (#1)
Browse files- Update app.py (5f847d391a5ff8708a5d26f214d0e82d7e962afa)
Co-authored-by: Ci Splunk <Csplk@users.noreply.huggingface.co>
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
from os.path import basename, splitext
|
2 |
-
|
3 |
import gradio as gr
|
4 |
from huggingface_hub import hf_hub_download
|
5 |
|
@@ -8,7 +8,7 @@ from onnx_inference import vectorize_image
|
|
8 |
|
9 |
MODEL_PATH = hf_hub_download("nopperl/marked-lineart-vectorizer", "model.onnx")
|
10 |
|
11 |
-
|
12 |
def predict(input_image_path, threshold, stroke_width):
|
13 |
output_filepath = splitext(basename(input_image_path))[0] + ".svg"
|
14 |
for recons_img in vectorize_image(input_image_path, model=MODEL_PATH, output=output_filepath, threshold_ratio=threshold, stroke_width=stroke_width):
|
|
|
1 |
from os.path import basename, splitext
|
2 |
+
import spaces
|
3 |
import gradio as gr
|
4 |
from huggingface_hub import hf_hub_download
|
5 |
|
|
|
8 |
|
9 |
MODEL_PATH = hf_hub_download("nopperl/marked-lineart-vectorizer", "model.onnx")
|
10 |
|
11 |
+
@spaces.GPU
|
12 |
def predict(input_image_path, threshold, stroke_width):
|
13 |
output_filepath = splitext(basename(input_image_path))[0] + ".svg"
|
14 |
for recons_img in vectorize_image(input_image_path, model=MODEL_PATH, output=output_filepath, threshold_ratio=threshold, stroke_width=stroke_width):
|