Aumkeshchy2003 commited on
Commit
0569316
·
verified ·
1 Parent(s): b86490c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -2,12 +2,11 @@ import torch
2
  import numpy as np
3
  import gradio as gr
4
  from PIL import Image
5
- import time
6
 
7
  # Device configuration
8
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
9
 
10
- # Load optimized YOLOv5s model
11
  model = torch.hub.load('ultralytics/yolov5', 'yolov5s', pretrained=True).to(device)
12
 
13
  # Performance optimizations
@@ -60,9 +59,9 @@ with gr.Blocks(title="Real-Time Object Detection") as app:
60
  gr.Checkbox(label="Enable FP16 Acceleration", value=True)
61
 
62
  # Configure queue and launch
63
- app.queue(concurrency_count=4, max_size=20).launch(
64
  server_name="0.0.0.0",
65
  server_port=7860,
66
  share=False,
67
  enable_queue=True
68
- )
 
2
  import numpy as np
3
  import gradio as gr
4
  from PIL import Image
 
5
 
6
  # Device configuration
7
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
8
 
9
+ # Load YOLOv5s model
10
  model = torch.hub.load('ultralytics/yolov5', 'yolov5s', pretrained=True).to(device)
11
 
12
  # Performance optimizations
 
59
  gr.Checkbox(label="Enable FP16 Acceleration", value=True)
60
 
61
  # Configure queue and launch
62
+ app.queue().launch(
63
  server_name="0.0.0.0",
64
  server_port=7860,
65
  share=False,
66
  enable_queue=True
67
+ )