Nada2001 commited on
Commit
85d8021
·
1 Parent(s): 047d106

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import streamlit as st
2
  import torch
3
- from detect import detect
4
  from PIL import Image
5
  from io import *
6
  import glob
@@ -39,7 +39,7 @@ def imageInput(device, src):
39
  f.write(image_file.getbuffer())
40
 
41
  #call Model prediction--
42
- model = torch.hub.load('ultralytics/yolov5', 'custom', path='models/yoloTrained.pt', force_reload=True)
43
  model.cuda() if device == 'cuda' else model.cpu()
44
  pred = model(imgpath)
45
  pred.render() # render bbox in image
@@ -101,8 +101,7 @@ def main():
101
  st.sidebar.markdown("https://github.com/thepbordin/Obstacle-Detection-for-Blind-people-Deployment")
102
  if option == "Image":
103
  imageInput(deviceoption, datasrc)
104
- elif option == "Video":
105
- videoInput(deviceoption, datasrc)
106
 
107
 
108
 
 
1
  import streamlit as st
2
  import torch
3
+ from detect import *
4
  from PIL import Image
5
  from io import *
6
  import glob
 
39
  f.write(image_file.getbuffer())
40
 
41
  #call Model prediction--
42
+ model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt', force_reload=True)
43
  model.cuda() if device == 'cuda' else model.cpu()
44
  pred = model(imgpath)
45
  pred.render() # render bbox in image
 
101
  st.sidebar.markdown("https://github.com/thepbordin/Obstacle-Detection-for-Blind-people-Deployment")
102
  if option == "Image":
103
  imageInput(deviceoption, datasrc)
104
+
 
105
 
106
 
107