Spaces:
Running
on
Zero
Running
on
Zero
Upload app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
import spaces
|
2 |
import gradio as gr
|
|
|
3 |
import onnxruntime as ort
|
4 |
import numpy as np
|
5 |
from PIL import Image, ImageDraw, ImageFont
|
@@ -374,6 +374,7 @@ def initialize_model():
|
|
374 |
labels_data, _, tag_to_category_map = load_tag_mapping(tag_mapping_path)
|
375 |
print("Model and labels loaded.")
|
376 |
|
|
|
377 |
def predict(image_input, gen_threshold, char_threshold, output_mode):
|
378 |
"""Gradioインターフェース用の予測関数"""
|
379 |
initialize_model() # モデルがロードされていなければロード
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
import spaces
|
3 |
import onnxruntime as ort
|
4 |
import numpy as np
|
5 |
from PIL import Image, ImageDraw, ImageFont
|
|
|
374 |
labels_data, _, tag_to_category_map = load_tag_mapping(tag_mapping_path)
|
375 |
print("Model and labels loaded.")
|
376 |
|
377 |
+
@spaces.GPU()
|
378 |
def predict(image_input, gen_threshold, char_threshold, output_mode):
|
379 |
"""Gradioインターフェース用の予測関数"""
|
380 |
initialize_model() # モデルがロードされていなければロード
|