npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gsplat

v1.2.4

Published

JavaScript Gaussian Splatting library

Downloads

2,640

Readme

gsplat.js

JavaScript Gaussian Splatting library

gsplat.js is an easy-to-use, general-purpose, open-source 3D Gaussian Splatting library, providing functionality similar to three.js but for Gaussian Splatting.

Quick Start

  • Live Viewer Demo: Explore this library in action in the 🤗 Hugging Face demo. Note: May not work on all devices; use Bonsai for the lowest memory requirements.
  • Editor Demo: Try new real-time updates and editing features in the gsplat.js editor.
  • Code Example: Start coding immediately with this jsfiddle example.

Installation

Prerequisites: Ensure your development environment supports ES6 modules.

  1. Set Up a Project: (If not already set up)

    Install Node.js and NPM, then initialize a new project using a module bundler like Vite:

    npm create vite@latest gsplat -- --template vanilla-ts
  2. Test Your Environment:

    cd gsplat
    npm install
    npm run dev
  3. Install gsplat.js:

    npm install --save gsplat

Usage

Creating a Scene

  • Import gsplat.js components and set up a basic scene.
  • Load Gaussian Splatting data and start a rendering loop.

(in src/main.ts if you followed the Vite setup)

import * as SPLAT from "gsplat";

const scene = new SPLAT.Scene();
const camera = new SPLAT.Camera();
const renderer = new SPLAT.WebGLRenderer();
const controls = new SPLAT.OrbitControls(camera, renderer.canvas);

async function main() {
    const url = "https://huggingface.co/datasets/dylanebert/3dgs/resolve/main/bonsai/bonsai-7k.splat";

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

    const frame = () => {
        controls.update();
        renderer.render(scene, camera);

        requestAnimationFrame(frame);
    };

    requestAnimationFrame(frame);
}

main();

This script sets up a basic scene with Gaussian Splatting data loaded from URL and starts a rendering loop.

FAQ

Q: Can I use .ply files?

A: Yes, gsplat.js supports .ply files. See the ply-converter example for details on how to convert .ply to .splat. Alternatively, convert PLY files from URL in this jsfiddle example.

Q: What are .splat files?

A: .splat files are a compact form of the splat data, offering quicker loading times than .ply files. They consist of a raw Uint8Array buffer.

⚠️ The .splat format does not contain SH coefficients, so colors are not view-dependent.

Q: Can I convert .splat files to .ply?

A: Yes, see the commented code in the ply-converter example. Alternatively, convert .splat to .ply from URL in this jsfiddle example.

⚠️ When converting .ply -> .splat -> .ply, SH coefficients will be lost.

License

This project is released under the MIT license. It is built upon several other open-source projects:

Please note that the license of the original 3D Gaussian Splatting research project is non-commercial. While this library provides an open-source rendering implementation, users should consider the source of the splat data separately.

Contact

Feel free to open issues, join the Hugging Face Discord, or email me directly at [email protected].