hillol7 commited on
Commit
38e26ff
·
verified ·
1 Parent(s): 7ff5a7f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -1,8 +1,9 @@
1
  import streamlit as st
2
  import cv2
3
  import numpy as np
 
4
  def main():
5
- st.title("SnapShot: One Stop Solution For Surveillance")
6
  st.sidebar.title("Upload Files")
7
 
8
  uploaded_image = st.sidebar.file_uploader("Upload an image (PNG or JPG)", type=["png", "jpg"])
@@ -10,8 +11,8 @@ def main():
10
 
11
  if uploaded_image and uploaded_video:
12
  st.sidebar.success("Files successfully uploaded!")
13
- image = cv2.imdecode(np.fromstring(uploaded_image.read(), np.uint8), cv2.IMREAD_COLOR)
14
- video = cv2.VideoCapture(uploaded_video)
15
 
16
  st.header("Uploaded Image")
17
  st.image(image, caption="Uploaded Image", use_column_width=True)
@@ -29,7 +30,7 @@ def main():
29
  occurrence_duration = 0
30
  prev_matches = []
31
 
32
- while video.isOpened():
33
  ret, frame = video.read()
34
  if not ret:
35
  st.write("End of video reached.")
 
1
  import streamlit as st
2
  import cv2
3
  import numpy as np
4
+
5
  def main():
6
+ st.title("SIFT Object Tracking in Video")
7
  st.sidebar.title("Upload Files")
8
 
9
  uploaded_image = st.sidebar.file_uploader("Upload an image (PNG or JPG)", type=["png", "jpg"])
 
11
 
12
  if uploaded_image and uploaded_video:
13
  st.sidebar.success("Files successfully uploaded!")
14
+ image = cv2.imdecode(np.frombuffer(uploaded_image.read(), np.uint8), cv2.IMREAD_COLOR)
15
+ video = cv2.VideoCapture(np.frombuffer(uploaded_video.read(), np.uint8))
16
 
17
  st.header("Uploaded Image")
18
  st.image(image, caption="Uploaded Image", use_column_width=True)
 
30
  occurrence_duration = 0
31
  prev_matches = []
32
 
33
+ while True:
34
  ret, frame = video.read()
35
  if not ret:
36
  st.write("End of video reached.")