-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
89 lines (80 loc) · 2.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>YOLO Prediction Live</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #f0f0f0;
color: #333;
text-align: center;
}
.container {
background: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
max-width: 90%;
}
h1 {
font-size: 1.6em;
margin-bottom: 12px;
color: #444;
}
#video-stream {
max-width: 100%;
max-height: 75vh;
width: auto;
height: auto;
border-radius: 5px;
border: 1px solid #ddd;
display: none;
}
.message {
font-size: 1em;
margin-top: 10px;
color: #666;
}
.error {
color: #cc0000;
}
</style>
</head>
<body>
<div class="container">
<h1>YOLO Prediction Live</h1>
<p class="message" id="status-message">Loading video stream...</p>
<img
id="video-stream"
src="http://localhost:8000/video_feed"
alt="YOLO Video Stream"
/>
</div>
<script>
const img = document.getElementById("video-stream");
const statusMessage = document.getElementById("status-message");
img.onload = () => {
statusMessage.style.display = "none";
img.style.display = "block";
console.log("YOLO stream is live.");
};
img.addEventListener("error", () => {
console.error("Error loading YOLO stream.");
statusMessage.textContent =
"Error: Unable to load video stream.";
statusMessage.classList.add("error");
});
</script>
</body>
</html>