Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +49 -28
templates/index.html
CHANGED
@@ -1,36 +1,57 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
-
<html
|
3 |
<head>
|
4 |
-
<
|
5 |
-
<
|
6 |
-
<
|
7 |
-
<
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
<script src="https://cdn.socket.io/4.1.2/socket.io.min.js"></script>
|
14 |
-
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
15 |
-
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
|
16 |
-
<script>
|
17 |
-
const videoElement = document.getElementById('videoPlayer');
|
18 |
-
const startCameraBtn = document.getElementById('startCameraBtn');
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
</body>
|
36 |
</html>
|
|
|
1 |
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
<head>
|
4 |
+
<title>Video Stream</title>
|
5 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.4.0/socket.io.js"></script>
|
6 |
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
7 |
+
<script type="text/javascript">
|
8 |
+
var socket = io.connect('http://' + document.domain + ':' + location.port);
|
9 |
+
|
10 |
+
socket.on('connect', function() {
|
11 |
+
console.log("Connected");
|
12 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
+
function togglePreview() {
|
15 |
+
$.get("/request_preview_switch");
|
16 |
+
}
|
17 |
|
18 |
+
function toggleFlipH() {
|
19 |
+
$.get("/request_flipH_switch");
|
20 |
+
}
|
21 |
|
22 |
+
function toggleRunModel() {
|
23 |
+
$.get("/request_run_model_switch");
|
24 |
+
}
|
25 |
+
|
26 |
+
function toggleMediaPipe() {
|
27 |
+
$.get("/request_mediapipe_switch");
|
28 |
+
}
|
29 |
+
|
30 |
+
function updateConfidenceSlider() {
|
31 |
+
var sliderValue = document.getElementById("confidenceSlider").value;
|
32 |
+
$.ajax({
|
33 |
+
type: 'POST',
|
34 |
+
url: '/update_slider_value',
|
35 |
+
data: {sliderValue: sliderValue},
|
36 |
+
async: true
|
37 |
+
});
|
38 |
+
}
|
39 |
+
|
40 |
+
function stopVideo() {
|
41 |
+
$.get("/stop_process");
|
42 |
+
}
|
43 |
</script>
|
44 |
+
</head>
|
45 |
+
<body>
|
46 |
+
<h1>Video Stream</h1>
|
47 |
+
<img src="{{ url_for('video_feed') }}" width="640"/>
|
48 |
+
<br>
|
49 |
+
<button onclick="togglePreview()">Toggle Preview</button>
|
50 |
+
<button onclick="toggleFlipH()">Toggle FlipH</button>
|
51 |
+
<button onclick="toggleRunModel()">Run Model Detection</button>
|
52 |
+
<button onclick="toggleMediaPipe()">Run MediaPipe Hand Landmarks</button>
|
53 |
+
<br>
|
54 |
+
Confidence Threshold: <input type="range" id="confidenceSlider" min="0" max="100" value="{{ session.get('confidence', 75) }}" oninput="updateConfidenceSlider()">
|
55 |
+
<button onclick="stopVideo()">Stop Video</button>
|
56 |
</body>
|
57 |
</html>
|