jbilcke-hf HF staff commited on
Commit
5cef10e
1 Parent(s): 65a0a47

file uploads

Browse files
Files changed (4) hide show
  1. README.md +10 -1
  2. package-lock.json +344 -0
  3. package.json +3 -0
  4. src/index.mts +56 -14
README.md CHANGED
@@ -12,10 +12,18 @@ app_port: 7860
12
 
13
  ### What is this project?
14
 
 
 
15
  Gaussian Splatting API is a REST API to generate 3D Gaussian Splatting scenes from a set of images.
16
 
17
  It is a wrapper around [MrNERF/gaussian-splatting-cuda](https://github.com/MrNeRF/gaussian-splatting-cuda).
18
 
 
 
 
 
 
 
19
  ### License
20
 
21
  The server wrapping code is open-source, but the code engine [gaussian-splatting-cuda](https://github.com/MrNeRF/gaussian-splatting-cuda) is based on [project by the Inria and the Max Planck Institut for Informatik (MPII)](https://github.com/graphdeco-inria/gaussian-splatting).
@@ -26,7 +34,8 @@ This is a [publicly funded project](https://repo-sam.inria.fr/fungraph/3d-gaussi
26
 
27
  You will have to talk with the original rightholders at the INRIA and MPII.
28
 
29
- Also, please tell if you know about any alternative project with a fully permissive open-source licensing.
 
30
 
31
  ## Running on your machine
32
 
 
12
 
13
  ### What is this project?
14
 
15
+ WARNING - This project is not finished!
16
+
17
  Gaussian Splatting API is a REST API to generate 3D Gaussian Splatting scenes from a set of images.
18
 
19
  It is a wrapper around [MrNERF/gaussian-splatting-cuda](https://github.com/MrNeRF/gaussian-splatting-cuda).
20
 
21
+ ### TODO
22
+
23
+ - [x] Compile gaussian-splatting-cuda with Docker
24
+ - [ ] Support upload of assets
25
+ - [ ] Support download of scenes
26
+
27
  ### License
28
 
29
  The server wrapping code is open-source, but the code engine [gaussian-splatting-cuda](https://github.com/MrNeRF/gaussian-splatting-cuda) is based on [project by the Inria and the Max Planck Institut for Informatik (MPII)](https://github.com/graphdeco-inria/gaussian-splatting).
 
34
 
35
  You will have to talk with the original rightholders at the INRIA and MPII.
36
 
37
+ Also, please tell me if you know about any alternative project with a fully permissive open-source licensing.
38
+
39
 
40
  ## Running on your machine
41
 
package-lock.json CHANGED
@@ -13,8 +13,11 @@
13
  "@gorgonjs/gorgon": "^1.4.1",
14
  "@types/express": "^4.17.17",
15
  "@types/uuid": "^9.0.2",
 
16
  "eventsource-parser": "^1.0.0",
17
  "express": "^4.18.2",
 
 
18
  "fs-extra": "^11.1.1",
19
  "node-fetch": "^3.3.1",
20
  "resize-base64": "^1.0.12",
@@ -214,6 +217,15 @@
214
  "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.4.tgz",
215
  "integrity": "sha512-zAuJWQflfx6dYJM62vna+Sn5aeSWhh3OB+wfUEACNcqUSc0AGc5JKl+ycL1vrH7frGTXhJchYjE1Hak8L819dA=="
216
  },
 
 
 
 
 
 
 
 
 
217
  "node_modules/accepts": {
218
  "version": "1.3.8",
219
  "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
@@ -245,6 +257,39 @@
245
  "node": ">=0.4.0"
246
  }
247
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  "node_modules/arg": {
249
  "version": "4.1.3",
250
  "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
@@ -255,11 +300,21 @@
255
  "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
256
  "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
257
  },
 
 
 
 
 
258
  "node_modules/b4a": {
259
  "version": "1.6.4",
260
  "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz",
261
  "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw=="
262
  },
 
 
 
 
 
263
  "node_modules/base64-js": {
264
  "version": "1.5.1",
265
  "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
@@ -317,6 +372,14 @@
317
  "npm": "1.2.8000 || >= 1.4.16"
318
  }
319
  },
 
 
 
 
 
 
 
 
320
  "node_modules/braces": {
321
  "version": "3.0.2",
322
  "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
@@ -351,6 +414,25 @@
351
  "ieee754": "^1.1.13"
352
  }
353
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
354
  "node_modules/bytes": {
355
  "version": "3.1.2",
356
  "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
@@ -418,6 +500,20 @@
418
  "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
419
  "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
420
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
421
  "node_modules/content-disposition": {
422
  "version": "0.5.4",
423
  "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
@@ -450,6 +546,34 @@
450
  "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
451
  "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
452
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
453
  "node_modules/create-readme": {
454
  "version": "1.2.0",
455
  "resolved": "https://registry.npmjs.org/create-readme/-/create-readme-1.2.0.tgz",
@@ -654,6 +778,57 @@
654
  "node": ">= 0.10.0"
655
  }
656
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
657
  "node_modules/fast-fifo": {
658
  "version": "1.3.2",
659
  "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz",
@@ -682,6 +857,14 @@
682
  "reusify": "^1.0.4"
683
  }
684
  },
 
 
 
 
 
 
 
 
685
  "node_modules/fetch-blob": {
686
  "version": "3.2.0",
687
  "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
@@ -777,6 +960,11 @@
777
  "node": ">=14.14"
778
  }
779
  },
 
 
 
 
 
780
  "node_modules/function-bind": {
781
  "version": "1.1.1",
782
  "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
@@ -796,6 +984,20 @@
796
  "url": "https://github.com/sponsors/ljharb"
797
  }
798
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
799
  "node_modules/github-from-package": {
800
  "version": "0.0.0",
801
  "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
@@ -809,6 +1011,24 @@
809
  "is-url": "^1.1.0"
810
  }
811
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
812
  "node_modules/glob-parent": {
813
  "version": "5.1.2",
814
  "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
@@ -903,6 +1123,15 @@
903
  }
904
  ]
905
  },
 
 
 
 
 
 
 
 
 
906
  "node_modules/inherits": {
907
  "version": "2.0.4",
908
  "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
@@ -958,6 +1187,11 @@
958
  "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz",
959
  "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww=="
960
  },
 
 
 
 
 
961
  "node_modules/jsonfile": {
962
  "version": "6.1.0",
963
  "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
@@ -969,6 +1203,49 @@
969
  "graceful-fs": "^4.1.6"
970
  }
971
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
972
  "node_modules/lru-cache": {
973
  "version": "6.0.0",
974
  "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
@@ -1067,6 +1344,17 @@
1067
  "url": "https://github.com/sponsors/sindresorhus"
1068
  }
1069
  },
 
 
 
 
 
 
 
 
 
 
 
1070
  "node_modules/minimist": {
1071
  "version": "1.2.8",
1072
  "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
@@ -1160,6 +1448,14 @@
1160
  "url": "https://opencollective.com/node-fetch"
1161
  }
1162
  },
 
 
 
 
 
 
 
 
1163
  "node_modules/object-inspect": {
1164
  "version": "1.12.3",
1165
  "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz",
@@ -1200,6 +1496,11 @@
1200
  "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
1201
  "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
1202
  },
 
 
 
 
 
1203
  "node_modules/picomatch": {
1204
  "version": "2.3.1",
1205
  "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
@@ -1262,6 +1563,11 @@
1262
  "node": ">=6"
1263
  }
1264
  },
 
 
 
 
 
1265
  "node_modules/proxy-addr": {
1266
  "version": "2.0.7",
1267
  "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
@@ -1370,6 +1676,14 @@
1370
  "node": ">= 6"
1371
  }
1372
  },
 
 
 
 
 
 
 
 
1373
  "node_modules/require-all": {
1374
  "version": "3.0.0",
1375
  "resolved": "https://registry.npmjs.org/require-all/-/require-all-3.0.0.tgz",
@@ -1596,6 +1910,14 @@
1596
  "node": ">= 0.8"
1597
  }
1598
  },
 
 
 
 
 
 
 
 
1599
  "node_modules/streamx": {
1600
  "version": "2.15.1",
1601
  "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.1.tgz",
@@ -1826,6 +2148,15 @@
1826
  "node": ">= 14"
1827
  }
1828
  },
 
 
 
 
 
 
 
 
 
1829
  "node_modules/yn": {
1830
  "version": "3.1.1",
1831
  "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
@@ -1833,6 +2164,19 @@
1833
  "engines": {
1834
  "node": ">=6"
1835
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
1836
  }
1837
  }
1838
  }
 
13
  "@gorgonjs/gorgon": "^1.4.1",
14
  "@types/express": "^4.17.17",
15
  "@types/uuid": "^9.0.2",
16
+ "archiver": "^6.0.1",
17
  "eventsource-parser": "^1.0.0",
18
  "express": "^4.18.2",
19
+ "express-fileupload": "^1.4.0",
20
+ "extract-zip": "^2.0.1",
21
  "fs-extra": "^11.1.1",
22
  "node-fetch": "^3.3.1",
23
  "resize-base64": "^1.0.12",
 
217
  "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.4.tgz",
218
  "integrity": "sha512-zAuJWQflfx6dYJM62vna+Sn5aeSWhh3OB+wfUEACNcqUSc0AGc5JKl+ycL1vrH7frGTXhJchYjE1Hak8L819dA=="
219
  },
220
+ "node_modules/@types/yauzl": {
221
+ "version": "2.10.0",
222
+ "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz",
223
+ "integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==",
224
+ "optional": true,
225
+ "dependencies": {
226
+ "@types/node": "*"
227
+ }
228
+ },
229
  "node_modules/accepts": {
230
  "version": "1.3.8",
231
  "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
 
257
  "node": ">=0.4.0"
258
  }
259
  },
260
+ "node_modules/archiver": {
261
+ "version": "6.0.1",
262
+ "resolved": "https://registry.npmjs.org/archiver/-/archiver-6.0.1.tgz",
263
+ "integrity": "sha512-CXGy4poOLBKptiZH//VlWdFuUC1RESbdZjGjILwBuZ73P7WkAUN0htfSfBq/7k6FRFlpu7bg4JOkj1vU9G6jcQ==",
264
+ "dependencies": {
265
+ "archiver-utils": "^4.0.1",
266
+ "async": "^3.2.4",
267
+ "buffer-crc32": "^0.2.1",
268
+ "readable-stream": "^3.6.0",
269
+ "readdir-glob": "^1.1.2",
270
+ "tar-stream": "^3.0.0",
271
+ "zip-stream": "^5.0.1"
272
+ },
273
+ "engines": {
274
+ "node": ">= 12.0.0"
275
+ }
276
+ },
277
+ "node_modules/archiver-utils": {
278
+ "version": "4.0.1",
279
+ "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-4.0.1.tgz",
280
+ "integrity": "sha512-Q4Q99idbvzmgCTEAAhi32BkOyq8iVI5EwdO0PmBDSGIzzjYNdcFn7Q7k3OzbLy4kLUPXfJtG6fO2RjftXbobBg==",
281
+ "dependencies": {
282
+ "glob": "^8.0.0",
283
+ "graceful-fs": "^4.2.0",
284
+ "lazystream": "^1.0.0",
285
+ "lodash": "^4.17.15",
286
+ "normalize-path": "^3.0.0",
287
+ "readable-stream": "^3.6.0"
288
+ },
289
+ "engines": {
290
+ "node": ">= 12.0.0"
291
+ }
292
+ },
293
  "node_modules/arg": {
294
  "version": "4.1.3",
295
  "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
 
300
  "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
301
  "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
302
  },
303
+ "node_modules/async": {
304
+ "version": "3.2.4",
305
+ "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz",
306
+ "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ=="
307
+ },
308
  "node_modules/b4a": {
309
  "version": "1.6.4",
310
  "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz",
311
  "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw=="
312
  },
313
+ "node_modules/balanced-match": {
314
+ "version": "1.0.2",
315
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
316
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
317
+ },
318
  "node_modules/base64-js": {
319
  "version": "1.5.1",
320
  "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
 
372
  "npm": "1.2.8000 || >= 1.4.16"
373
  }
374
  },
375
+ "node_modules/brace-expansion": {
376
+ "version": "2.0.1",
377
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
378
+ "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
379
+ "dependencies": {
380
+ "balanced-match": "^1.0.0"
381
+ }
382
+ },
383
  "node_modules/braces": {
384
  "version": "3.0.2",
385
  "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
 
414
  "ieee754": "^1.1.13"
415
  }
416
  },
417
+ "node_modules/buffer-crc32": {
418
+ "version": "0.2.13",
419
+ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
420
+ "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==",
421
+ "engines": {
422
+ "node": "*"
423
+ }
424
+ },
425
+ "node_modules/busboy": {
426
+ "version": "1.6.0",
427
+ "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz",
428
+ "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==",
429
+ "dependencies": {
430
+ "streamsearch": "^1.1.0"
431
+ },
432
+ "engines": {
433
+ "node": ">=10.16.0"
434
+ }
435
+ },
436
  "node_modules/bytes": {
437
  "version": "3.1.2",
438
  "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
 
500
  "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
501
  "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
502
  },
503
+ "node_modules/compress-commons": {
504
+ "version": "5.0.1",
505
+ "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-5.0.1.tgz",
506
+ "integrity": "sha512-MPh//1cERdLtqwO3pOFLeXtpuai0Y2WCd5AhtKxznqM7WtaMYaOEMSgn45d9D10sIHSfIKE603HlOp8OPGrvag==",
507
+ "dependencies": {
508
+ "crc-32": "^1.2.0",
509
+ "crc32-stream": "^5.0.0",
510
+ "normalize-path": "^3.0.0",
511
+ "readable-stream": "^3.6.0"
512
+ },
513
+ "engines": {
514
+ "node": ">= 12.0.0"
515
+ }
516
+ },
517
  "node_modules/content-disposition": {
518
  "version": "0.5.4",
519
  "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
 
546
  "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
547
  "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
548
  },
549
+ "node_modules/core-util-is": {
550
+ "version": "1.0.3",
551
+ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
552
+ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
553
+ },
554
+ "node_modules/crc-32": {
555
+ "version": "1.2.2",
556
+ "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz",
557
+ "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==",
558
+ "bin": {
559
+ "crc32": "bin/crc32.njs"
560
+ },
561
+ "engines": {
562
+ "node": ">=0.8"
563
+ }
564
+ },
565
+ "node_modules/crc32-stream": {
566
+ "version": "5.0.0",
567
+ "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-5.0.0.tgz",
568
+ "integrity": "sha512-B0EPa1UK+qnpBZpG+7FgPCu0J2ETLpXq09o9BkLkEAhdB6Z61Qo4pJ3JYu0c+Qi+/SAL7QThqnzS06pmSSyZaw==",
569
+ "dependencies": {
570
+ "crc-32": "^1.2.0",
571
+ "readable-stream": "^3.4.0"
572
+ },
573
+ "engines": {
574
+ "node": ">= 12.0.0"
575
+ }
576
+ },
577
  "node_modules/create-readme": {
578
  "version": "1.2.0",
579
  "resolved": "https://registry.npmjs.org/create-readme/-/create-readme-1.2.0.tgz",
 
778
  "node": ">= 0.10.0"
779
  }
780
  },
781
+ "node_modules/express-fileupload": {
782
+ "version": "1.4.0",
783
+ "resolved": "https://registry.npmjs.org/express-fileupload/-/express-fileupload-1.4.0.tgz",
784
+ "integrity": "sha512-RjzLCHxkv3umDeZKeFeMg8w7qe0V09w3B7oGZprr/oO2H/ISCgNzuqzn7gV3HRWb37GjRk429CCpSLS2KNTqMQ==",
785
+ "dependencies": {
786
+ "busboy": "^1.6.0"
787
+ },
788
+ "engines": {
789
+ "node": ">=12.0.0"
790
+ }
791
+ },
792
+ "node_modules/extract-zip": {
793
+ "version": "2.0.1",
794
+ "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz",
795
+ "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==",
796
+ "dependencies": {
797
+ "debug": "^4.1.1",
798
+ "get-stream": "^5.1.0",
799
+ "yauzl": "^2.10.0"
800
+ },
801
+ "bin": {
802
+ "extract-zip": "cli.js"
803
+ },
804
+ "engines": {
805
+ "node": ">= 10.17.0"
806
+ },
807
+ "optionalDependencies": {
808
+ "@types/yauzl": "^2.9.1"
809
+ }
810
+ },
811
+ "node_modules/extract-zip/node_modules/debug": {
812
+ "version": "4.3.4",
813
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
814
+ "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
815
+ "dependencies": {
816
+ "ms": "2.1.2"
817
+ },
818
+ "engines": {
819
+ "node": ">=6.0"
820
+ },
821
+ "peerDependenciesMeta": {
822
+ "supports-color": {
823
+ "optional": true
824
+ }
825
+ }
826
+ },
827
+ "node_modules/extract-zip/node_modules/ms": {
828
+ "version": "2.1.2",
829
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
830
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
831
+ },
832
  "node_modules/fast-fifo": {
833
  "version": "1.3.2",
834
  "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz",
 
857
  "reusify": "^1.0.4"
858
  }
859
  },
860
+ "node_modules/fd-slicer": {
861
+ "version": "1.1.0",
862
+ "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",
863
+ "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==",
864
+ "dependencies": {
865
+ "pend": "~1.2.0"
866
+ }
867
+ },
868
  "node_modules/fetch-blob": {
869
  "version": "3.2.0",
870
  "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
 
960
  "node": ">=14.14"
961
  }
962
  },
963
+ "node_modules/fs.realpath": {
964
+ "version": "1.0.0",
965
+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
966
+ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
967
+ },
968
  "node_modules/function-bind": {
969
  "version": "1.1.1",
970
  "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
 
984
  "url": "https://github.com/sponsors/ljharb"
985
  }
986
  },
987
+ "node_modules/get-stream": {
988
+ "version": "5.2.0",
989
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
990
+ "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
991
+ "dependencies": {
992
+ "pump": "^3.0.0"
993
+ },
994
+ "engines": {
995
+ "node": ">=8"
996
+ },
997
+ "funding": {
998
+ "url": "https://github.com/sponsors/sindresorhus"
999
+ }
1000
+ },
1001
  "node_modules/github-from-package": {
1002
  "version": "0.0.0",
1003
  "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
 
1011
  "is-url": "^1.1.0"
1012
  }
1013
  },
1014
+ "node_modules/glob": {
1015
+ "version": "8.1.0",
1016
+ "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz",
1017
+ "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==",
1018
+ "dependencies": {
1019
+ "fs.realpath": "^1.0.0",
1020
+ "inflight": "^1.0.4",
1021
+ "inherits": "2",
1022
+ "minimatch": "^5.0.1",
1023
+ "once": "^1.3.0"
1024
+ },
1025
+ "engines": {
1026
+ "node": ">=12"
1027
+ },
1028
+ "funding": {
1029
+ "url": "https://github.com/sponsors/isaacs"
1030
+ }
1031
+ },
1032
  "node_modules/glob-parent": {
1033
  "version": "5.1.2",
1034
  "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
 
1123
  }
1124
  ]
1125
  },
1126
+ "node_modules/inflight": {
1127
+ "version": "1.0.6",
1128
+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
1129
+ "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
1130
+ "dependencies": {
1131
+ "once": "^1.3.0",
1132
+ "wrappy": "1"
1133
+ }
1134
+ },
1135
  "node_modules/inherits": {
1136
  "version": "2.0.4",
1137
  "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
 
1187
  "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz",
1188
  "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww=="
1189
  },
1190
+ "node_modules/isarray": {
1191
+ "version": "1.0.0",
1192
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
1193
+ "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
1194
+ },
1195
  "node_modules/jsonfile": {
1196
  "version": "6.1.0",
1197
  "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
 
1203
  "graceful-fs": "^4.1.6"
1204
  }
1205
  },
1206
+ "node_modules/lazystream": {
1207
+ "version": "1.0.1",
1208
+ "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz",
1209
+ "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==",
1210
+ "dependencies": {
1211
+ "readable-stream": "^2.0.5"
1212
+ },
1213
+ "engines": {
1214
+ "node": ">= 0.6.3"
1215
+ }
1216
+ },
1217
+ "node_modules/lazystream/node_modules/readable-stream": {
1218
+ "version": "2.3.8",
1219
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
1220
+ "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
1221
+ "dependencies": {
1222
+ "core-util-is": "~1.0.0",
1223
+ "inherits": "~2.0.3",
1224
+ "isarray": "~1.0.0",
1225
+ "process-nextick-args": "~2.0.0",
1226
+ "safe-buffer": "~5.1.1",
1227
+ "string_decoder": "~1.1.1",
1228
+ "util-deprecate": "~1.0.1"
1229
+ }
1230
+ },
1231
+ "node_modules/lazystream/node_modules/safe-buffer": {
1232
+ "version": "5.1.2",
1233
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
1234
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
1235
+ },
1236
+ "node_modules/lazystream/node_modules/string_decoder": {
1237
+ "version": "1.1.1",
1238
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
1239
+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
1240
+ "dependencies": {
1241
+ "safe-buffer": "~5.1.0"
1242
+ }
1243
+ },
1244
+ "node_modules/lodash": {
1245
+ "version": "4.17.21",
1246
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
1247
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
1248
+ },
1249
  "node_modules/lru-cache": {
1250
  "version": "6.0.0",
1251
  "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
 
1344
  "url": "https://github.com/sponsors/sindresorhus"
1345
  }
1346
  },
1347
+ "node_modules/minimatch": {
1348
+ "version": "5.1.6",
1349
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
1350
+ "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
1351
+ "dependencies": {
1352
+ "brace-expansion": "^2.0.1"
1353
+ },
1354
+ "engines": {
1355
+ "node": ">=10"
1356
+ }
1357
+ },
1358
  "node_modules/minimist": {
1359
  "version": "1.2.8",
1360
  "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
 
1448
  "url": "https://opencollective.com/node-fetch"
1449
  }
1450
  },
1451
+ "node_modules/normalize-path": {
1452
+ "version": "3.0.0",
1453
+ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
1454
+ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
1455
+ "engines": {
1456
+ "node": ">=0.10.0"
1457
+ }
1458
+ },
1459
  "node_modules/object-inspect": {
1460
  "version": "1.12.3",
1461
  "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz",
 
1496
  "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
1497
  "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
1498
  },
1499
+ "node_modules/pend": {
1500
+ "version": "1.2.0",
1501
+ "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
1502
+ "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg=="
1503
+ },
1504
  "node_modules/picomatch": {
1505
  "version": "2.3.1",
1506
  "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
 
1563
  "node": ">=6"
1564
  }
1565
  },
1566
+ "node_modules/process-nextick-args": {
1567
+ "version": "2.0.1",
1568
+ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
1569
+ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
1570
+ },
1571
  "node_modules/proxy-addr": {
1572
  "version": "2.0.7",
1573
  "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
 
1676
  "node": ">= 6"
1677
  }
1678
  },
1679
+ "node_modules/readdir-glob": {
1680
+ "version": "1.1.3",
1681
+ "resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-1.1.3.tgz",
1682
+ "integrity": "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==",
1683
+ "dependencies": {
1684
+ "minimatch": "^5.1.0"
1685
+ }
1686
+ },
1687
  "node_modules/require-all": {
1688
  "version": "3.0.0",
1689
  "resolved": "https://registry.npmjs.org/require-all/-/require-all-3.0.0.tgz",
 
1910
  "node": ">= 0.8"
1911
  }
1912
  },
1913
+ "node_modules/streamsearch": {
1914
+ "version": "1.1.0",
1915
+ "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz",
1916
+ "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==",
1917
+ "engines": {
1918
+ "node": ">=10.0.0"
1919
+ }
1920
+ },
1921
  "node_modules/streamx": {
1922
  "version": "2.15.1",
1923
  "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.1.tgz",
 
2148
  "node": ">= 14"
2149
  }
2150
  },
2151
+ "node_modules/yauzl": {
2152
+ "version": "2.10.0",
2153
+ "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz",
2154
+ "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==",
2155
+ "dependencies": {
2156
+ "buffer-crc32": "~0.2.3",
2157
+ "fd-slicer": "~1.1.0"
2158
+ }
2159
+ },
2160
  "node_modules/yn": {
2161
  "version": "3.1.1",
2162
  "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
 
2164
  "engines": {
2165
  "node": ">=6"
2166
  }
2167
+ },
2168
+ "node_modules/zip-stream": {
2169
+ "version": "5.0.1",
2170
+ "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-5.0.1.tgz",
2171
+ "integrity": "sha512-UfZ0oa0C8LI58wJ+moL46BDIMgCQbnsb+2PoiJYtonhBsMh2bq1eRBVkvjfVsqbEHd9/EgKPUuL9saSSsec8OA==",
2172
+ "dependencies": {
2173
+ "archiver-utils": "^4.0.1",
2174
+ "compress-commons": "^5.0.1",
2175
+ "readable-stream": "^3.6.0"
2176
+ },
2177
+ "engines": {
2178
+ "node": ">= 12.0.0"
2179
+ }
2180
  }
2181
  }
2182
  }
package.json CHANGED
@@ -16,8 +16,11 @@
16
  "@gorgonjs/gorgon": "^1.4.1",
17
  "@types/express": "^4.17.17",
18
  "@types/uuid": "^9.0.2",
 
19
  "eventsource-parser": "^1.0.0",
20
  "express": "^4.18.2",
 
 
21
  "fs-extra": "^11.1.1",
22
  "node-fetch": "^3.3.1",
23
  "resize-base64": "^1.0.12",
 
16
  "@gorgonjs/gorgon": "^1.4.1",
17
  "@types/express": "^4.17.17",
18
  "@types/uuid": "^9.0.2",
19
+ "archiver": "^6.0.1",
20
  "eventsource-parser": "^1.0.0",
21
  "express": "^4.18.2",
22
+ "express-fileupload": "^1.4.0",
23
+ "extract-zip": "^2.0.1",
24
  "fs-extra": "^11.1.1",
25
  "node-fetch": "^3.3.1",
26
  "resize-base64": "^1.0.12",
src/index.mts CHANGED
@@ -1,11 +1,22 @@
 
1
  import express from "express"
 
 
 
 
 
 
2
 
3
  import { runGaussianSplattingCUDA, Options } from "./gaussian-splatting.mts"
4
 
5
- import { initFolders } from "./initFolders.mts"
6
-
7
  initFolders()
8
 
 
 
 
 
 
 
9
  const app = express()
10
  const port = 7860
11
 
@@ -14,6 +25,7 @@ let activeRequests = 0
14
 
15
  app.use(express.json({limit: '50mb'}))
16
  app.use(express.urlencoded({limit: '50mb', extended: true}))
 
17
 
18
  app.post("/", async (req, res) => {
19
  if(activeRequests >= maxActiveRequests) {
@@ -22,26 +34,57 @@ app.post("/", async (req, res) => {
22
  }
23
  activeRequests++
24
 
25
- let options: Options = req.body // Assuming the body contains the options
26
-
 
 
 
 
 
 
 
 
 
27
  try {
28
- const result = await runGaussianSplattingCUDA(options);
29
- res.status(200).json({
30
- success: true,
31
- message: result
32
- }).end();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  } catch (error) {
34
  res.status(500).json({
35
  error: "Couldn't generate gaussian splatting scene",
36
  message: error
37
  }).end()
 
 
38
  }
39
-
40
- activeRequests--
41
  });
42
 
43
  app.get("/", async (req, res) => {
44
- // this is what users will see in the space - but no need to show something scary
45
  res.status(200)
46
  res.write(`<html><head></head><body>
47
  Splatter API is a micro-service used to generate gaussian splatting scenes.
@@ -49,5 +92,4 @@ Splatter API is a micro-service used to generate gaussian splatting scenes.
49
  res.end()
50
  })
51
 
52
- app.listen(port, () => { console.log(`Open http://localhost:${port}`) })
53
-
 
1
+ import { initFolders } from "./initFolders.mts"
2
  import express from "express"
3
+ import fileUpload from "express-fileupload"
4
+ import path from "path"
5
+ import os from "os"
6
+ import fs from "fs"
7
+ import extract from "extract-zip"
8
+ import archiver from "archiver"
9
 
10
  import { runGaussianSplattingCUDA, Options } from "./gaussian-splatting.mts"
11
 
 
 
12
  initFolders()
13
 
14
+ declare module 'express-serve-static-core' {
15
+ interface Request {
16
+ files: any;
17
+ }
18
+ }
19
+
20
  const app = express()
21
  const port = 7860
22
 
 
25
 
26
  app.use(express.json({limit: '50mb'}))
27
  app.use(express.urlencoded({limit: '50mb', extended: true}))
28
+ app.use(fileUpload())
29
 
30
  app.post("/", async (req, res) => {
31
  if(activeRequests >= maxActiveRequests) {
 
34
  }
35
  activeRequests++
36
 
37
+ if (!req.files || !req.files.data) {
38
+ res.status(400).json({error: "Missing data file in request"}).end()
39
+ return
40
+ }
41
+
42
+ let options: Options = req.body // Other parameters come in the body
43
+ let dataFile: fileUpload.UploadedFile = req.files.data
44
+
45
+ let inputTempDir = path.join(os.tmpdir(), Math.random().toString().slice(2))
46
+ let outputTempDir = path.join(os.tmpdir(), Math.random().toString().slice(2))
47
+
48
  try {
49
+ fs.mkdirSync(inputTempDir) // Create input temp directory
50
+ fs.mkdirSync(outputTempDir) // Create output temp directory
51
+
52
+ await dataFile.mv(path.join(inputTempDir, dataFile.name)) // Move zip file to input temp directory
53
+ await extract(path.join(inputTempDir, dataFile.name), {dir: inputTempDir}) // Unzip file
54
+
55
+ fs.unlinkSync(path.join(inputTempDir, dataFile.name)) // Delete zip file after extracting
56
+
57
+ options.dataPath = inputTempDir // Set dataPath to temporary directory
58
+ options.outputPath = outputTempDir // Set outputPath to temporary directory
59
+
60
+ const result = await runGaussianSplattingCUDA(options)
61
+
62
+ // Create a zip file of the output directory
63
+ let outputFilePath = path.join(outputTempDir, 'output.zip')
64
+ let output = fs.createWriteStream(outputFilePath)
65
+ let archive = archiver('zip')
66
+
67
+ archive.directory(outputTempDir, false)
68
+ archive.pipe(output)
69
+ await archive.finalize()
70
+
71
+ // Send zip file in response
72
+ res.status(200)
73
+ res.download(outputFilePath, 'output.zip', (error) => {
74
+ if (!error) fs.rmSync(inputTempDir, {recursive: true, force: true}) // Delete input temp directory after sending response
75
+ fs.rmSync(outputTempDir, {recursive: true, force: true}) // Delete output temp directory after sending response
76
+ })
77
  } catch (error) {
78
  res.status(500).json({
79
  error: "Couldn't generate gaussian splatting scene",
80
  message: error
81
  }).end()
82
+ } finally {
83
+ activeRequests--
84
  }
 
 
85
  });
86
 
87
  app.get("/", async (req, res) => {
 
88
  res.status(200)
89
  res.write(`<html><head></head><body>
90
  Splatter API is a micro-service used to generate gaussian splatting scenes.
 
92
  res.end()
93
  })
94
 
95
+ app.listen(port, () => { console.log(`Open http://localhost:${port}`) })