cella110n commited on
Commit
6198c8a
·
verified ·
1 Parent(s): ff08268

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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() # モデルがロードされていなければロード