akhaliq HF Staff commited on
Commit
fa49b89
·
verified ·
1 Parent(s): 3215ade

Upload index.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +94 -22
index.html CHANGED
@@ -1,29 +1,101 @@
1
  <!DOCTYPE html>
2
  <html lang="en">
3
-
4
  <head>
5
- <meta charset="UTF-8" />
6
- <link rel="stylesheet" href="style.css" />
7
-
8
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
9
- <title>Transformers.js - Object Detection</title>
10
  </head>
11
-
12
  <body>
13
- <h1>Object Detection w/ 🤗 Transformers.js</h1>
14
- <label id="container" for="upload">
15
- <svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
16
- <path fill="#000"
17
- d="M3.5 24.3a3 3 0 0 1-1.9-.8c-.5-.5-.8-1.2-.8-1.9V2.9c0-.7.3-1.3.8-1.9.6-.5 1.2-.7 2-.7h18.6c.7 0 1.3.2 1.9.7.5.6.7 1.2.7 2v18.6c0 .7-.2 1.4-.7 1.9a3 3 0 0 1-2 .8H3.6Zm0-2.7h18.7V2.9H3.5v18.7Zm2.7-2.7h13.3c.3 0 .5 0 .6-.3v-.7l-3.7-5a.6.6 0 0 0-.6-.2c-.2 0-.4 0-.5.3l-3.5 4.6-2.4-3.3a.6.6 0 0 0-.6-.3c-.2 0-.4.1-.5.3l-2.7 3.6c-.1.2-.2.4 0 .7.1.2.3.3.6.3Z">
18
- </path>
19
- </svg>
20
- Click to upload image
21
- <label id="example">(or try example)</label>
22
- </label>
23
- <label id="status">Loading model...</label>
24
- <input id="upload" type="file" accept="image/*" />
25
-
26
- <script src="index.js" type="module"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  </body>
28
-
29
  </html>
 
1
  <!DOCTYPE html>
2
  <html lang="en">
 
3
  <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Video Caption AI</title>
7
+ <link rel="stylesheet" href="style.css">
 
8
  </head>
 
9
  <body>
10
+ <div class="container">
11
+ <div class="video-container">
12
+ <video id="videoPlayer" controls></video>
13
+
14
+ <div class="overlay-ui">
15
+ <div class="header">
16
+ <h1>Video Caption AI</h1>
17
+ <p class="subtitle">Powered by FastVLM</p>
18
+ </div>
19
+
20
+ <div class="upload-area" id="uploadArea">
21
+ <svg class="upload-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
22
+ <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
23
+ <polyline points="17 8 12 3 7 8"></polyline>
24
+ <line x1="12" y1="3" x2="12" y2="15"></line>
25
+ </svg>
26
+ <h2>Upload Video</h2>
27
+ <p>Drag and drop or click to browse</p>
28
+ <input type="file" id="videoInput" accept="video/*" hidden>
29
+ </div>
30
+
31
+ <div class="controls" id="controls">
32
+ <button id="processBtn" class="primary-btn">
33
+ <span class="btn-text">Generate Captions</span>
34
+ <div class="spinner"></div>
35
+ </button>
36
+
37
+ <div class="settings">
38
+ <label class="setting-item">
39
+ <span>Frames to analyze</span>
40
+ <select id="frameCount">
41
+ <option value="4">4 frames</option>
42
+ <option value="8" selected>8 frames</option>
43
+ <option value="12">12 frames</option>
44
+ <option value="16">16 frames</option>
45
+ </select>
46
+ </label>
47
+
48
+ <label class="setting-item">
49
+ <span>Device</span>
50
+ <select id="deviceSelect">
51
+ <option value="cpu">CPU</option>
52
+ <option value="webgpu">GPU (WebGPU)</option>
53
+ </select>
54
+ </label>
55
+ </div>
56
+ </div>
57
+
58
+ <div class="results" id="results">
59
+ <div class="results-header">
60
+ <h3>Video Captions</h3>
61
+ <button id="copyBtn" class="icon-btn">
62
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
63
+ <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
64
+ <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
65
+ </svg>
66
+ </button>
67
+ </div>
68
+
69
+ <div class="frame-captions" id="frameCaptions"></div>
70
+
71
+ <div class="final-caption" id="finalCaption">
72
+ <h4>Video Summary</h4>
73
+ <p id="summaryText"></p>
74
+ </div>
75
+ </div>
76
+
77
+ <div class="progress-overlay" id="progressOverlay">
78
+ <div class="progress-content">
79
+ <div class="progress-ring">
80
+ <svg viewBox="0 0 100 100">
81
+ <circle cx="50" cy="50" r="45" fill="none" stroke="#e5e5e7" stroke-width="8"/>
82
+ <circle id="progressCircle" cx="50" cy="50" r="45" fill="none" stroke="url(#gradient)" stroke-width="8" stroke-linecap="round" transform="rotate(-90 50 50)"/>
83
+ <defs>
84
+ <linearGradient id="gradient" x1="0%" y1="0%" x2="100%" y2="100%">
85
+ <stop offset="0%" style="stop-color:#007AFF"/>
86
+ <stop offset="100%" style="stop-color:#5856D6"/>
87
+ </linearGradient>
88
+ </defs>
89
+ </svg>
90
+ <span class="progress-text" id="progressText">0%</span>
91
+ </div>
92
+ <p id="progressStatus">Initializing...</p>
93
+ </div>
94
+ </div>
95
+ </div>
96
+ </div>
97
+ </div>
98
+
99
+ <script type="module" src="index.js"></script>
100
  </body>
 
101
  </html>