dylanebert HF staff commited on
Commit
68fad97
β€’
0 Parent(s):
Files changed (13) hide show
  1. .gitattributes +35 -0
  2. 4d/.gitignore +24 -0
  3. 4d/index.html +22 -0
  4. 4d/package-lock.json +572 -0
  5. 4d/package.json +18 -0
  6. 4d/src/main.ts +65 -0
  7. 4d/src/vite-env.d.ts +1 -0
  8. 4d/style.css +50 -0
  9. 4d/tsconfig.json +23 -0
  10. Dockerfile +11 -0
  11. README.md +14 -0
  12. index.html +19 -0
  13. style.css +28 -0
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
4d/.gitignore ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .idea
19
+ .DS_Store
20
+ *.suo
21
+ *.ntvs*
22
+ *.njsproj
23
+ *.sln
24
+ *.sw?
4d/index.html ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="stylesheet" href="style.css" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>gsplat.js - Viewer Demo</title>
8
+ </head>
9
+ <body>
10
+ <div id="progress-container">
11
+ <dialog open id="progress-dialog">
12
+ <p>
13
+ <label for="progress-indicator">Loading scene...</label>
14
+ </p>
15
+ <progress max="100" id="progress-indicator"></progress>
16
+ </dialog>
17
+ </div>
18
+
19
+ <canvas id="canvas"></canvas>
20
+ <script type="module" src="/src/main.ts"></script>
21
+ </body>
22
+ </html>
4d/package-lock.json ADDED
@@ -0,0 +1,572 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "simple-server",
3
+ "version": "0.0.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "simple-server",
9
+ "version": "0.0.0",
10
+ "dependencies": {
11
+ "gsplat": "^1.2.0"
12
+ },
13
+ "devDependencies": {
14
+ "typescript": "^5.0.2",
15
+ "vite": "^4.4.5"
16
+ }
17
+ },
18
+ "node_modules/@esbuild/android-arm": {
19
+ "version": "0.18.20",
20
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz",
21
+ "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==",
22
+ "cpu": [
23
+ "arm"
24
+ ],
25
+ "dev": true,
26
+ "optional": true,
27
+ "os": [
28
+ "android"
29
+ ],
30
+ "engines": {
31
+ "node": ">=12"
32
+ }
33
+ },
34
+ "node_modules/@esbuild/android-arm64": {
35
+ "version": "0.18.20",
36
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz",
37
+ "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==",
38
+ "cpu": [
39
+ "arm64"
40
+ ],
41
+ "dev": true,
42
+ "optional": true,
43
+ "os": [
44
+ "android"
45
+ ],
46
+ "engines": {
47
+ "node": ">=12"
48
+ }
49
+ },
50
+ "node_modules/@esbuild/android-x64": {
51
+ "version": "0.18.20",
52
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz",
53
+ "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==",
54
+ "cpu": [
55
+ "x64"
56
+ ],
57
+ "dev": true,
58
+ "optional": true,
59
+ "os": [
60
+ "android"
61
+ ],
62
+ "engines": {
63
+ "node": ">=12"
64
+ }
65
+ },
66
+ "node_modules/@esbuild/darwin-arm64": {
67
+ "version": "0.18.20",
68
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz",
69
+ "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==",
70
+ "cpu": [
71
+ "arm64"
72
+ ],
73
+ "dev": true,
74
+ "optional": true,
75
+ "os": [
76
+ "darwin"
77
+ ],
78
+ "engines": {
79
+ "node": ">=12"
80
+ }
81
+ },
82
+ "node_modules/@esbuild/darwin-x64": {
83
+ "version": "0.18.20",
84
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz",
85
+ "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==",
86
+ "cpu": [
87
+ "x64"
88
+ ],
89
+ "dev": true,
90
+ "optional": true,
91
+ "os": [
92
+ "darwin"
93
+ ],
94
+ "engines": {
95
+ "node": ">=12"
96
+ }
97
+ },
98
+ "node_modules/@esbuild/freebsd-arm64": {
99
+ "version": "0.18.20",
100
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz",
101
+ "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==",
102
+ "cpu": [
103
+ "arm64"
104
+ ],
105
+ "dev": true,
106
+ "optional": true,
107
+ "os": [
108
+ "freebsd"
109
+ ],
110
+ "engines": {
111
+ "node": ">=12"
112
+ }
113
+ },
114
+ "node_modules/@esbuild/freebsd-x64": {
115
+ "version": "0.18.20",
116
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz",
117
+ "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==",
118
+ "cpu": [
119
+ "x64"
120
+ ],
121
+ "dev": true,
122
+ "optional": true,
123
+ "os": [
124
+ "freebsd"
125
+ ],
126
+ "engines": {
127
+ "node": ">=12"
128
+ }
129
+ },
130
+ "node_modules/@esbuild/linux-arm": {
131
+ "version": "0.18.20",
132
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz",
133
+ "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==",
134
+ "cpu": [
135
+ "arm"
136
+ ],
137
+ "dev": true,
138
+ "optional": true,
139
+ "os": [
140
+ "linux"
141
+ ],
142
+ "engines": {
143
+ "node": ">=12"
144
+ }
145
+ },
146
+ "node_modules/@esbuild/linux-arm64": {
147
+ "version": "0.18.20",
148
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz",
149
+ "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==",
150
+ "cpu": [
151
+ "arm64"
152
+ ],
153
+ "dev": true,
154
+ "optional": true,
155
+ "os": [
156
+ "linux"
157
+ ],
158
+ "engines": {
159
+ "node": ">=12"
160
+ }
161
+ },
162
+ "node_modules/@esbuild/linux-ia32": {
163
+ "version": "0.18.20",
164
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz",
165
+ "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==",
166
+ "cpu": [
167
+ "ia32"
168
+ ],
169
+ "dev": true,
170
+ "optional": true,
171
+ "os": [
172
+ "linux"
173
+ ],
174
+ "engines": {
175
+ "node": ">=12"
176
+ }
177
+ },
178
+ "node_modules/@esbuild/linux-loong64": {
179
+ "version": "0.18.20",
180
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz",
181
+ "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==",
182
+ "cpu": [
183
+ "loong64"
184
+ ],
185
+ "dev": true,
186
+ "optional": true,
187
+ "os": [
188
+ "linux"
189
+ ],
190
+ "engines": {
191
+ "node": ">=12"
192
+ }
193
+ },
194
+ "node_modules/@esbuild/linux-mips64el": {
195
+ "version": "0.18.20",
196
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz",
197
+ "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==",
198
+ "cpu": [
199
+ "mips64el"
200
+ ],
201
+ "dev": true,
202
+ "optional": true,
203
+ "os": [
204
+ "linux"
205
+ ],
206
+ "engines": {
207
+ "node": ">=12"
208
+ }
209
+ },
210
+ "node_modules/@esbuild/linux-ppc64": {
211
+ "version": "0.18.20",
212
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz",
213
+ "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==",
214
+ "cpu": [
215
+ "ppc64"
216
+ ],
217
+ "dev": true,
218
+ "optional": true,
219
+ "os": [
220
+ "linux"
221
+ ],
222
+ "engines": {
223
+ "node": ">=12"
224
+ }
225
+ },
226
+ "node_modules/@esbuild/linux-riscv64": {
227
+ "version": "0.18.20",
228
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz",
229
+ "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==",
230
+ "cpu": [
231
+ "riscv64"
232
+ ],
233
+ "dev": true,
234
+ "optional": true,
235
+ "os": [
236
+ "linux"
237
+ ],
238
+ "engines": {
239
+ "node": ">=12"
240
+ }
241
+ },
242
+ "node_modules/@esbuild/linux-s390x": {
243
+ "version": "0.18.20",
244
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz",
245
+ "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==",
246
+ "cpu": [
247
+ "s390x"
248
+ ],
249
+ "dev": true,
250
+ "optional": true,
251
+ "os": [
252
+ "linux"
253
+ ],
254
+ "engines": {
255
+ "node": ">=12"
256
+ }
257
+ },
258
+ "node_modules/@esbuild/linux-x64": {
259
+ "version": "0.18.20",
260
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz",
261
+ "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==",
262
+ "cpu": [
263
+ "x64"
264
+ ],
265
+ "dev": true,
266
+ "optional": true,
267
+ "os": [
268
+ "linux"
269
+ ],
270
+ "engines": {
271
+ "node": ">=12"
272
+ }
273
+ },
274
+ "node_modules/@esbuild/netbsd-x64": {
275
+ "version": "0.18.20",
276
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz",
277
+ "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==",
278
+ "cpu": [
279
+ "x64"
280
+ ],
281
+ "dev": true,
282
+ "optional": true,
283
+ "os": [
284
+ "netbsd"
285
+ ],
286
+ "engines": {
287
+ "node": ">=12"
288
+ }
289
+ },
290
+ "node_modules/@esbuild/openbsd-x64": {
291
+ "version": "0.18.20",
292
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz",
293
+ "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==",
294
+ "cpu": [
295
+ "x64"
296
+ ],
297
+ "dev": true,
298
+ "optional": true,
299
+ "os": [
300
+ "openbsd"
301
+ ],
302
+ "engines": {
303
+ "node": ">=12"
304
+ }
305
+ },
306
+ "node_modules/@esbuild/sunos-x64": {
307
+ "version": "0.18.20",
308
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz",
309
+ "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==",
310
+ "cpu": [
311
+ "x64"
312
+ ],
313
+ "dev": true,
314
+ "optional": true,
315
+ "os": [
316
+ "sunos"
317
+ ],
318
+ "engines": {
319
+ "node": ">=12"
320
+ }
321
+ },
322
+ "node_modules/@esbuild/win32-arm64": {
323
+ "version": "0.18.20",
324
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz",
325
+ "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==",
326
+ "cpu": [
327
+ "arm64"
328
+ ],
329
+ "dev": true,
330
+ "optional": true,
331
+ "os": [
332
+ "win32"
333
+ ],
334
+ "engines": {
335
+ "node": ">=12"
336
+ }
337
+ },
338
+ "node_modules/@esbuild/win32-ia32": {
339
+ "version": "0.18.20",
340
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz",
341
+ "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==",
342
+ "cpu": [
343
+ "ia32"
344
+ ],
345
+ "dev": true,
346
+ "optional": true,
347
+ "os": [
348
+ "win32"
349
+ ],
350
+ "engines": {
351
+ "node": ">=12"
352
+ }
353
+ },
354
+ "node_modules/@esbuild/win32-x64": {
355
+ "version": "0.18.20",
356
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz",
357
+ "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==",
358
+ "cpu": [
359
+ "x64"
360
+ ],
361
+ "dev": true,
362
+ "optional": true,
363
+ "os": [
364
+ "win32"
365
+ ],
366
+ "engines": {
367
+ "node": ">=12"
368
+ }
369
+ },
370
+ "node_modules/esbuild": {
371
+ "version": "0.18.20",
372
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz",
373
+ "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==",
374
+ "dev": true,
375
+ "hasInstallScript": true,
376
+ "bin": {
377
+ "esbuild": "bin/esbuild"
378
+ },
379
+ "engines": {
380
+ "node": ">=12"
381
+ },
382
+ "optionalDependencies": {
383
+ "@esbuild/android-arm": "0.18.20",
384
+ "@esbuild/android-arm64": "0.18.20",
385
+ "@esbuild/android-x64": "0.18.20",
386
+ "@esbuild/darwin-arm64": "0.18.20",
387
+ "@esbuild/darwin-x64": "0.18.20",
388
+ "@esbuild/freebsd-arm64": "0.18.20",
389
+ "@esbuild/freebsd-x64": "0.18.20",
390
+ "@esbuild/linux-arm": "0.18.20",
391
+ "@esbuild/linux-arm64": "0.18.20",
392
+ "@esbuild/linux-ia32": "0.18.20",
393
+ "@esbuild/linux-loong64": "0.18.20",
394
+ "@esbuild/linux-mips64el": "0.18.20",
395
+ "@esbuild/linux-ppc64": "0.18.20",
396
+ "@esbuild/linux-riscv64": "0.18.20",
397
+ "@esbuild/linux-s390x": "0.18.20",
398
+ "@esbuild/linux-x64": "0.18.20",
399
+ "@esbuild/netbsd-x64": "0.18.20",
400
+ "@esbuild/openbsd-x64": "0.18.20",
401
+ "@esbuild/sunos-x64": "0.18.20",
402
+ "@esbuild/win32-arm64": "0.18.20",
403
+ "@esbuild/win32-ia32": "0.18.20",
404
+ "@esbuild/win32-x64": "0.18.20"
405
+ }
406
+ },
407
+ "node_modules/fsevents": {
408
+ "version": "2.3.3",
409
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
410
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
411
+ "dev": true,
412
+ "hasInstallScript": true,
413
+ "optional": true,
414
+ "os": [
415
+ "darwin"
416
+ ],
417
+ "engines": {
418
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
419
+ }
420
+ },
421
+ "node_modules/gsplat": {
422
+ "version": "1.2.0",
423
+ "resolved": "https://registry.npmjs.org/gsplat/-/gsplat-1.2.0.tgz",
424
+ "integrity": "sha512-/UWq3815FwR2GuiySOfNX8BbyAX19+/gSWnFk7t2lhdeXMEZTSUn3+tlPP7XSKkPc2x26zZ37jV1kboJdjuTpg=="
425
+ },
426
+ "node_modules/nanoid": {
427
+ "version": "3.3.6",
428
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",
429
+ "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",
430
+ "dev": true,
431
+ "funding": [
432
+ {
433
+ "type": "github",
434
+ "url": "https://github.com/sponsors/ai"
435
+ }
436
+ ],
437
+ "bin": {
438
+ "nanoid": "bin/nanoid.cjs"
439
+ },
440
+ "engines": {
441
+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
442
+ }
443
+ },
444
+ "node_modules/picocolors": {
445
+ "version": "1.0.0",
446
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
447
+ "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
448
+ "dev": true
449
+ },
450
+ "node_modules/postcss": {
451
+ "version": "8.4.31",
452
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",
453
+ "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",
454
+ "dev": true,
455
+ "funding": [
456
+ {
457
+ "type": "opencollective",
458
+ "url": "https://opencollective.com/postcss/"
459
+ },
460
+ {
461
+ "type": "tidelift",
462
+ "url": "https://tidelift.com/funding/github/npm/postcss"
463
+ },
464
+ {
465
+ "type": "github",
466
+ "url": "https://github.com/sponsors/ai"
467
+ }
468
+ ],
469
+ "dependencies": {
470
+ "nanoid": "^3.3.6",
471
+ "picocolors": "^1.0.0",
472
+ "source-map-js": "^1.0.2"
473
+ },
474
+ "engines": {
475
+ "node": "^10 || ^12 || >=14"
476
+ }
477
+ },
478
+ "node_modules/rollup": {
479
+ "version": "3.29.4",
480
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz",
481
+ "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==",
482
+ "dev": true,
483
+ "bin": {
484
+ "rollup": "dist/bin/rollup"
485
+ },
486
+ "engines": {
487
+ "node": ">=14.18.0",
488
+ "npm": ">=8.0.0"
489
+ },
490
+ "optionalDependencies": {
491
+ "fsevents": "~2.3.2"
492
+ }
493
+ },
494
+ "node_modules/source-map-js": {
495
+ "version": "1.0.2",
496
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
497
+ "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
498
+ "dev": true,
499
+ "engines": {
500
+ "node": ">=0.10.0"
501
+ }
502
+ },
503
+ "node_modules/typescript": {
504
+ "version": "5.2.2",
505
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
506
+ "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
507
+ "dev": true,
508
+ "bin": {
509
+ "tsc": "bin/tsc",
510
+ "tsserver": "bin/tsserver"
511
+ },
512
+ "engines": {
513
+ "node": ">=14.17"
514
+ }
515
+ },
516
+ "node_modules/vite": {
517
+ "version": "4.5.2",
518
+ "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.2.tgz",
519
+ "integrity": "sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==",
520
+ "dev": true,
521
+ "dependencies": {
522
+ "esbuild": "^0.18.10",
523
+ "postcss": "^8.4.27",
524
+ "rollup": "^3.27.1"
525
+ },
526
+ "bin": {
527
+ "vite": "bin/vite.js"
528
+ },
529
+ "engines": {
530
+ "node": "^14.18.0 || >=16.0.0"
531
+ },
532
+ "funding": {
533
+ "url": "https://github.com/vitejs/vite?sponsor=1"
534
+ },
535
+ "optionalDependencies": {
536
+ "fsevents": "~2.3.2"
537
+ },
538
+ "peerDependencies": {
539
+ "@types/node": ">= 14",
540
+ "less": "*",
541
+ "lightningcss": "^1.21.0",
542
+ "sass": "*",
543
+ "stylus": "*",
544
+ "sugarss": "*",
545
+ "terser": "^5.4.0"
546
+ },
547
+ "peerDependenciesMeta": {
548
+ "@types/node": {
549
+ "optional": true
550
+ },
551
+ "less": {
552
+ "optional": true
553
+ },
554
+ "lightningcss": {
555
+ "optional": true
556
+ },
557
+ "sass": {
558
+ "optional": true
559
+ },
560
+ "stylus": {
561
+ "optional": true
562
+ },
563
+ "sugarss": {
564
+ "optional": true
565
+ },
566
+ "terser": {
567
+ "optional": true
568
+ }
569
+ }
570
+ }
571
+ }
572
+ }
4d/package.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "simple-server",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "tsc && vite build",
9
+ "preview": "vite preview"
10
+ },
11
+ "devDependencies": {
12
+ "typescript": "^5.0.2",
13
+ "vite": "^4.4.5"
14
+ },
15
+ "dependencies": {
16
+ "gsplat": "^1.2.0"
17
+ }
18
+ }
4d/src/main.ts ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import * as SPLAT from "gsplat";
2
+
3
+ const canvas = document.getElementById("canvas") as HTMLCanvasElement;
4
+ const progressDialog = document.getElementById("progress-dialog") as HTMLDialogElement;
5
+ const progressIndicator = document.getElementById("progress-indicator") as HTMLProgressElement;
6
+
7
+ const renderer = new SPLAT.WebGLRenderer(canvas);
8
+ renderer.addProgram(new SPLAT.VideoRenderProgram(renderer));
9
+
10
+ const scene = new SPLAT.Scene();
11
+ const camera = new SPLAT.Camera();
12
+ const controls = new SPLAT.OrbitControls(camera, canvas);
13
+
14
+ let loading = false;
15
+
16
+ async function selectFile(file: File) {
17
+ if (loading) return;
18
+ loading = true;
19
+ // Check if .splatv file
20
+ if (file.name.endsWith(".splatv")) {
21
+ scene.reset();
22
+ progressDialog.showModal();
23
+ await SPLAT.SplatvLoader.LoadFromFileAsync(file, scene, camera, (progress: number) => {
24
+ progressIndicator.value = progress * 100;
25
+ });
26
+ progressDialog.close();
27
+ }
28
+ loading = false;
29
+ }
30
+
31
+ async function main() {
32
+ const url = "https://huggingface.co/datasets/dylanebert/3dgs/resolve/main/4d/flame/flame.splatv";
33
+ await SPLAT.SplatvLoader.LoadAsync(url, scene, camera, (progress) => (progressIndicator.value = progress * 100));
34
+ controls.setCameraTarget(camera.position.add(camera.forward.multiply(5)));
35
+ progressDialog.close();
36
+
37
+ const handleResize = () => {
38
+ renderer.setSize(canvas.clientWidth, canvas.clientHeight);
39
+ };
40
+
41
+ const frame = () => {
42
+ controls.update();
43
+ renderer.render(scene, camera);
44
+
45
+ requestAnimationFrame(frame);
46
+ };
47
+
48
+ handleResize();
49
+ window.addEventListener("resize", handleResize);
50
+
51
+ requestAnimationFrame(frame);
52
+
53
+ // Listen for file drops
54
+ document.addEventListener("drop", (e) => {
55
+ e.preventDefault();
56
+ e.stopPropagation();
57
+
58
+ if (e.dataTransfer != null) {
59
+ scene.reset();
60
+ selectFile(e.dataTransfer.files[0]);
61
+ }
62
+ });
63
+ }
64
+
65
+ main();
4d/src/vite-env.d.ts ADDED
@@ -0,0 +1 @@
 
 
1
+ /// <reference types="vite/client" />
4d/style.css ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body,
2
+ html {
3
+ margin: 0;
4
+ padding: 0;
5
+ overflow: hidden;
6
+ background-color: #fff;
7
+ font-family: sans-serif;
8
+ }
9
+
10
+ canvas {
11
+ width: 100vw;
12
+ height: 100vh;
13
+ }
14
+
15
+ dialog {
16
+ width: 100%;
17
+ text-align: center;
18
+ max-width: 20em;
19
+ color: white;
20
+ background-color: #000;
21
+ border: none;
22
+ position: relative;
23
+ transform: translate(-50%, -50%);
24
+ }
25
+
26
+ #progress-container {
27
+ position: absolute;
28
+ top: 50%;
29
+ left: 50%;
30
+ }
31
+
32
+ progress {
33
+ width: 100%;
34
+ height: 1em;
35
+ border: none;
36
+ background-color: #fff;
37
+ color: #eee;
38
+ }
39
+
40
+ progress::-webkit-progress-bar {
41
+ background-color: #333;
42
+ }
43
+
44
+ progress::-webkit-progress-value {
45
+ background-color: #eee;
46
+ }
47
+
48
+ progress::-moz-progress-bar {
49
+ background-color: #eee;
50
+ }
4d/tsconfig.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "useDefineForClassFields": true,
5
+ "module": "ESNext",
6
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
7
+ "skipLibCheck": true,
8
+
9
+ /* Bundler mode */
10
+ "moduleResolution": "bundler",
11
+ "allowImportingTsExtensions": true,
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "noEmit": true,
15
+
16
+ /* Linting */
17
+ "strict": true,
18
+ "noUnusedLocals": true,
19
+ "noUnusedParameters": true,
20
+ "noFallthroughCasesInSwitch": true
21
+ },
22
+ "include": ["src"]
23
+ }
Dockerfile ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:alpine
2
+
3
+ WORKDIR /app
4
+ COPY 4d/package.json package.json
5
+ RUN npm install
6
+
7
+ COPY 4d/ /app
8
+ RUN npm run build
9
+
10
+ EXPOSE 3000
11
+ CMD ["npm", "start"]
README.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: 4DGS Demo
3
+ emoji: πŸ“š
4
+ colorFrom: yellow
5
+ colorTo: indigo
6
+ sdk: docker
7
+ pinned: false
8
+ license: mit
9
+ app_port: 3000
10
+ ---
11
+
12
+ # 4DGS Demo
13
+
14
+ This demo showcases the 4D Gaussian Splatting capabilities of gsplat.js v1.2.0.
index.html ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width" />
6
+ <title>My static Space</title>
7
+ <link rel="stylesheet" href="style.css" />
8
+ </head>
9
+ <body>
10
+ <div class="card">
11
+ <h1>Welcome to your static Space!</h1>
12
+ <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
+ <p>
14
+ Also don't forget to check the
15
+ <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
+ </p>
17
+ </div>
18
+ </body>
19
+ </html>
style.css ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body {
2
+ padding: 2rem;
3
+ font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
4
+ }
5
+
6
+ h1 {
7
+ font-size: 16px;
8
+ margin-top: 0;
9
+ }
10
+
11
+ p {
12
+ color: rgb(107, 114, 128);
13
+ font-size: 15px;
14
+ margin-bottom: 10px;
15
+ margin-top: 5px;
16
+ }
17
+
18
+ .card {
19
+ max-width: 620px;
20
+ margin: 0 auto;
21
+ padding: 16px;
22
+ border: 1px solid lightgray;
23
+ border-radius: 16px;
24
+ }
25
+
26
+ .card p:last-child {
27
+ margin-bottom: 0;
28
+ }