pn23 commited on
Commit
d93302f
·
verified ·
1 Parent(s): c507263

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -5
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import streamlit as st
2
-
 
3
 
4
  title = st.title("Welcome to Therapute")
5
 
@@ -15,10 +16,26 @@ st.write(x, 'squared is', x * x)
15
  st.write(curr_exer)
16
  st.success("Success")
17
 
18
- import streamlit as st
19
 
20
- picture = st.camera_input("Take a picture")
21
 
22
- if picture:
23
- st.image(picture)
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
+ import numpy as np
3
+ import cv2 as cv
4
 
5
  title = st.title("Welcome to Therapute")
6
 
 
16
  st.write(curr_exer)
17
  st.success("Success")
18
 
 
19
 
 
20
 
 
 
21
 
22
+ cap = cv.VideoCapture(0)
23
+ if not cap.isOpened():
24
+ print("Cannot open camera")
25
+ exit()
26
+ while True:
27
+ # Capture frame-by-frame
28
+ ret, frame = cap.read()
29
+ # if frame is read correctly ret is True
30
+ if not ret:
31
+ print("Can't receive frame (stream end?). Exiting ...")
32
+ break
33
+ # Our operations on the frame come here
34
+ gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
35
+ # Display the resulting frame
36
+ cv.imshow('frame', gray)
37
+ if cv.waitKey(1) == ord('q'):
38
+ break
39
+ # When everything done, release the capture
40
+ cap.release()
41
+ cv.destroyAllWindows()