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

Changed scan func

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -249,6 +249,8 @@ outputs = [
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
 
 
249
  gr.Image(label="Detected Ships"),
250
  gr.Textbox(label="Elapsed Time")
251
  ]
252
+ model = None # TODO: initialize your model
253
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
254
  # Here I'm using 0.5 as the threshold, but adjust according to your needs
255
  gradio_process_image_partial = partial(gradio_process_image, model=model, device=device, threshold=0.5)
256