Spaces:
Runtime error
Runtime error
Mauricio Guerta
commited on
Commit
·
784d811
1
Parent(s):
d05fe89
Adiciona camera awake
Browse files- .vscode/launch.json +16 -0
- app.py +5 -10
.vscode/launch.json
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
// Use IntelliSense to learn about possible attributes.
|
3 |
+
// Hover to view descriptions of existing attributes.
|
4 |
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
5 |
+
"version": "0.2.0",
|
6 |
+
"configurations": [
|
7 |
+
{
|
8 |
+
"name": "Python: Current File",
|
9 |
+
"type": "python",
|
10 |
+
"request": "launch",
|
11 |
+
"program": "${file}",
|
12 |
+
"console": "integratedTerminal",
|
13 |
+
"justMyCode": true
|
14 |
+
}
|
15 |
+
]
|
16 |
+
}
|
app.py
CHANGED
@@ -4,19 +4,14 @@ import time
|
|
4 |
import streamlit as st
|
5 |
|
6 |
### CONNECT TO CAMERA
|
7 |
-
# either like this using your own camera IP
|
8 |
-
#capture = cv2.VideoCapture('rtsp://192.168.0.131:554/user=atualli&password=Ope1w3r&channel=1&stream=0.sdp')
|
9 |
-
# or like this
|
10 |
-
capture = cv2.VideoCapture('rtsp://192.168.0.131:554/user=atualli&password=Ope1w3r&channel=1&stream=0.sdp')
|
11 |
|
12 |
-
|
13 |
-
run = st.checkbox("Turn on camera",value=False)
|
14 |
|
15 |
-
### MAKE PLACE HOLDER FOR VIDEO FRAMES
|
16 |
-
FRAME_WINDOW =st.image([])
|
17 |
|
18 |
-
|
19 |
-
|
|
|
20 |
x, frame = capture.read()
|
21 |
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
|
|
22 |
time.sleep(0.025)
|
|
|
4 |
import streamlit as st
|
5 |
|
6 |
### CONNECT TO CAMERA
|
|
|
|
|
|
|
|
|
7 |
|
8 |
+
capture = cv2.VideoCapture('rtsp://atualli:[email protected]:1024/Streaming/channels/102/?transportmode=unicast')
|
|
|
9 |
|
|
|
|
|
10 |
|
11 |
+
pic = st.empty()
|
12 |
+
|
13 |
+
while True:
|
14 |
x, frame = capture.read()
|
15 |
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
16 |
+
pic.image(frame)
|
17 |
time.sleep(0.025)
|