Upload 3 files
Browse files- assets/index-C2x4uvch.js +0 -0
- assets/index-DMNAdTgA.css +1 -0
- index.html +50 -19
assets/index-C2x4uvch.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
assets/index-DMNAdTgA.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
*{box-sizing:border-box;padding:0;margin:0;font-family:sans-serif}html,body{height:100%}body{padding:16px 32px}body,#container{display:flex;flex-direction:column;justify-content:center;align-items:center}#controls{display:flex;padding:1rem;gap:1rem}#controls>div{text-align:center}h1,h4{text-align:center}h4{margin-top:.5rem}#container{position:relative;width:720px;height:405px;max-width:100%;max-height:100%;border:2px dashed #D1D5DB;border-radius:.75rem;overflow:hidden;margin-top:1rem;background-size:100% 100%;background-position:center;background-repeat:no-repeat}#overlay,canvas{position:absolute;width:100%;height:100%}#status{min-height:16px;margin:8px 0}.bounding-box{position:absolute;box-sizing:border-box;border:solid 2px}.bounding-box-label{color:#fff;position:absolute;font-size:12px;margin:-16px 0 0 -2px;padding:1px}
|
index.html
CHANGED
@@ -1,19 +1,50 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
|
4 |
+
<head>
|
5 |
+
<meta charset="UTF-8" />
|
6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
7 |
+
<title>Transformers.js | WebGPU real-time object detection</title>
|
8 |
+
<script type="module" crossorigin src="/assets/index-C2x4uvch.js"></script>
|
9 |
+
<link rel="stylesheet" crossorigin href="/assets/index-DMNAdTgA.css">
|
10 |
+
</head>
|
11 |
+
|
12 |
+
<body>
|
13 |
+
<h1>
|
14 |
+
WebGPU real-time object detection w/
|
15 |
+
<a href="http://github.com/xenova/transformers.js" target="_blank">🤗 Transformers.js</a>
|
16 |
+
</h1>
|
17 |
+
<h4>
|
18 |
+
Runs locally in your browser, powered by
|
19 |
+
<a href="https://huggingface.co/Xenova/yolos-tiny" target="_blank">YOLOS</a>
|
20 |
+
</h4>
|
21 |
+
<div id="container">
|
22 |
+
<video id="video" autoplay muted playsinline></video>
|
23 |
+
<canvas id="canvas" width="360" height="240"></canvas>
|
24 |
+
<div id="overlay"></div>
|
25 |
+
</div>
|
26 |
+
<div id="controls">
|
27 |
+
<div title="Read frames from your webcam and process them at a lower size (lower = faster)">
|
28 |
+
<label>Stream scale</label>
|
29 |
+
(<label id="scale-value">0.5</label>)
|
30 |
+
<br>
|
31 |
+
<input id="scale" type="range" min="0.1" max="1" step="0.1" value="0.5" disabled>
|
32 |
+
</div>
|
33 |
+
<div title="The length of the longest edge of the image (lower = faster)">
|
34 |
+
<label>Image size</label>
|
35 |
+
(<label id="size-value">256</label>)
|
36 |
+
<br>
|
37 |
+
<input id="size" type="range" min="128" max="512" step="32" value="256" disabled>
|
38 |
+
</div>
|
39 |
+
<div>
|
40 |
+
<label>Threshold</label>
|
41 |
+
(<label id="threshold-value">0.7</label>)
|
42 |
+
<br>
|
43 |
+
<input id="threshold" type="range" min="0.01" max="1" step="0.01" value="0.7" disabled>
|
44 |
+
</div>
|
45 |
+
</div>
|
46 |
+
<label id="status"></label>
|
47 |
+
|
48 |
+
</body>
|
49 |
+
|
50 |
+
</html>
|