eeshawn commited on
Commit
9f1ec44
1 Parent(s): 940bd9c

update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -2,11 +2,6 @@ import gradio as gr
2
  import torch
3
  from ultralyticsplus import YOLO, render_result
4
 
5
- yolo_model = YOLO('eeshawn11/naruto_hand_seal_detection')
6
- yolo_model.overrides['max_det'] = 20
7
- device = 'cuda' if torch.cuda.is_available() else 'cpu'
8
- yolo_model.to(device)
9
-
10
  def seal_detection(
11
  image,
12
  conf_threshold,
@@ -74,5 +69,10 @@ with gr.Blocks() as demo:
74
  submit.click(fn=seal_detection, inputs=[image[0], slider[0]], outputs=outputs)
75
 
76
  if __name__ == "__main__":
 
 
 
 
 
77
  demo.queue(api_open=False, max_size=10)
78
  demo.launch()
 
2
  import torch
3
  from ultralyticsplus import YOLO, render_result
4
 
 
 
 
 
 
5
  def seal_detection(
6
  image,
7
  conf_threshold,
 
69
  submit.click(fn=seal_detection, inputs=[image[0], slider[0]], outputs=outputs)
70
 
71
  if __name__ == "__main__":
72
+ yolo_model = YOLO('eeshawn11/naruto_hand_seal_detection')
73
+ yolo_model.overrides['max_det'] = 20
74
+ device = 'cuda' if torch.cuda.is_available() else 'cpu'
75
+ yolo_model.to(device)
76
+
77
  demo.queue(api_open=False, max_size=10)
78
  demo.launch()