huggingface / gsplat.js

JavaScript Gaussian Splatting library.
MIT License
1.26k stars 77 forks source link

What if we want to access file in our own private hugging face dataset repo? #72

Closed Maxiviper117 closed 3 months ago

Maxiviper117 commented 3 months ago

Currently, the await SPLAT.Loader.LoadAsync expects a public download URL to load the splat. But what if we want to access our own private repo splat file?

Maxiviper117 commented 3 months ago

Figured it out.

const url = 'https://huggingface.co/datasets/path/to/dataset/file';
const response = await fetch(url, {
    headers: {
        Authorization: `Bearer <access_token>`
    }
});
const data = await response.blob();
const blobUrl = URL.createObjectURL(data);

await SPLAT.Loader.LoadAsync(blobUrl , scene, () => {});