Mehmet Batuhan Duman commited on
Commit
029ea87
·
1 Parent(s): d20de52

Changed scan func

Browse files
Files changed (2) hide show
  1. .idea/workspace.xml +1 -1
  2. app.py +5 -1
.idea/workspace.xml CHANGED
@@ -65,7 +65,7 @@
65
  <workItem from="1683665300392" duration="7649000" />
66
  <workItem from="1683708398011" duration="1235000" />
67
  <workItem from="1684437905081" duration="110000" />
68
- <workItem from="1686602174110" duration="2380000" />
69
  </task>
70
  <servers />
71
  </component>
 
65
  <workItem from="1683665300392" duration="7649000" />
66
  <workItem from="1683708398011" duration="1235000" />
67
  <workItem from="1684437905081" duration="110000" />
68
+ <workItem from="1686602174110" duration="2679000" />
69
  </task>
70
  <servers />
71
  </component>
app.py CHANGED
@@ -14,6 +14,7 @@ import torch
14
  import cv2
15
  import matplotlib.pyplot as plt
16
  import matplotlib.patches as patches
 
17
 
18
  class Net2(nn.Module):
19
  def __init__(self):
@@ -248,8 +249,11 @@ outputs = [
248
  gr.Image(label="Detected Ships"),
249
  gr.Textbox(label="Elapsed Time")
250
  ]
 
 
251
 
252
- iface = gr.Interface(fn=gradio_process_image, inputs=inputs, outputs=outputs)
253
  iface.launch()
254
 
255
 
 
 
14
  import cv2
15
  import matplotlib.pyplot as plt
16
  import matplotlib.patches as patches
17
+ from functools import partial
18
 
19
  class Net2(nn.Module):
20
  def __init__(self):
 
249
  gr.Image(label="Detected Ships"),
250
  gr.Textbox(label="Elapsed Time")
251
  ]
252
+ # Here I'm using 0.5 as the threshold, but adjust according to your needs
253
+ gradio_process_image_partial = partial(gradio_process_image, model=model, device=device, threshold=0.5)
254
 
255
+ iface = gr.Interface(fn=gradio_process_image_partial, inputs=inputs, outputs=outputs)
256
  iface.launch()
257
 
258
 
259
+