MadhurGarg commited on
Commit
f0b5009
·
1 Parent(s): 0264c52

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -29,7 +29,7 @@ model = YOLOTraining(model)
29
  model.load_state_dict(torch.load("model.pth", map_location=torch.device('cpu')), strict=False)
30
  model.eval()
31
 
32
- def yolo_predict(image: np.ndarray, iou_thresh: float = 0.75, thresh: float = 0.75):
33
 
34
  transforms = A.Compose(
35
  [
@@ -115,21 +115,21 @@ demo = gr.Interface(
115
  fn=yolo_predict,
116
  inputs=[
117
  gr.Image(shape=(config.IMAGE_SIZE,config.IMAGE_SIZE), label="Input Image"),
118
- gr.Slider(0, 1, value=0.75, step=0.05, label="IOU Threshold"),
119
- gr.Slider(0, 1, value=0.75, step=0.05, label="Threshold")
120
  ],
121
  outputs=gr.Gallery(rows=1, columns=1),
122
  examples=[
123
- ["examples/000001.jpg", 0.75, 0.75],
124
- ["examples/000002.jpg", 0.75, 0.75],
125
- ["examples/000003.jpg", 0.75, 0.75],
126
- ["examples/000004.jpg", 0.75, 0.75],
127
- ["examples/000005.jpg", 0.75, 0.75],
128
- ["examples/000006.jpg", 0.75, 0.75],
129
- ["examples/000007.jpg", 0.75, 0.75],
130
- ["examples/000008.jpg", 0.75, 0.75],
131
- ["examples/000009.jpg", 0.75, 0.75],
132
- ["examples/000010.jpg", 0.75, 0.75]
133
  ]
134
  )
135
 
 
29
  model.load_state_dict(torch.load("model.pth", map_location=torch.device('cpu')), strict=False)
30
  model.eval()
31
 
32
+ def yolo_predict(image: np.ndarray, iou_thresh: float = 0.5, thresh: float = 0.5):
33
 
34
  transforms = A.Compose(
35
  [
 
115
  fn=yolo_predict,
116
  inputs=[
117
  gr.Image(shape=(config.IMAGE_SIZE,config.IMAGE_SIZE), label="Input Image"),
118
+ gr.Slider(0, 1, value=0.5, step=0.05, label="IOU Threshold"),
119
+ gr.Slider(0, 1, value=0.5, step=0.05, label="Threshold")
120
  ],
121
  outputs=gr.Gallery(rows=1, columns=1),
122
  examples=[
123
+ ["examples/000001.jpg", 0.5, 0.5],
124
+ ["examples/000002.jpg", 0.5, 0.5],
125
+ ["examples/000003.jpg", 0.5, 0.5],
126
+ ["examples/000004.jpg", 0.5, 0.5],
127
+ ["examples/000005.jpg", 0.5, 0.5],
128
+ ["examples/000006.jpg", 0.5, 0.5],
129
+ ["examples/000007.jpg", 0.5, 0.5],
130
+ ["examples/000008.jpg", 0.5, 0.5],
131
+ ["examples/000009.jpg", 0.5, 0.5],
132
+ ["examples/000010.jpg", 0.5, 0.5]
133
  ]
134
  )
135