Home

Awesome

SSTK: SmartScenes ToolKit

The (S)STK provides:

  1. Web-based framework for viewing models and scenes.
  2. Various web-based annotation interfaces for annotating models and scenes
  3. Batch processing component for doing analysis on scenes and offscreen rendering (see ssc/README.md)
  4. Server-side rendering

Getting Started

  1. The SSTK can be used on Linux, MacOS and Windows systems.

    Prerequisites for Ubuntu: sudo apt-get install build-essential libxi-dev libglu1-mesa-dev libglew-dev libvips

    Prerequisites for MacOS: Please install Xcode

    For some older version of node (v10.x.x) and on some platforms, node-gyp may require python 2.7 so if you get an error with node-gyp, make sure the python in your path is python 2.7.

  2. Install node.js v14.16.0. Using the Node Version Manager (nvm) is the easiest way to install node.js on most systems.

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
    source ~/.bashrc
    nvm install v14.16.0
    

    If you use zsh instead of bash, replace source ~/.bashrc with source ~/.zshrc. Confirm above works using node -v at the terminal.

  3. Build the STK library. Enter the root directory of the repo (${STK})

    cd ${STK} 
    ./build.sh
    

    This will build the STK library that is needed by the server and command line scripts.

    Note 1: We are using an older version of node with pinned packages that may have vulnerabilities. So you may get a warning indicating that there are vulnerabilities.

    DO NOT run npm audit fix - that will upgrade some of the packages and cause the code to break.

    Note 2: if node-gyp gl build issue is encountered due to missing angle submodule, this is due to a bug (https://github.com/npm/cli/issues/2774). To resolve this, downgrade to an older npm through npm install -g npm@'^6.4.11' prior to running build.

  4. Running the server (see server/README.md for details

    cd server
    ./run.sh
    

    Visit http://localhost:8010 in your browser (Chrome is recommended)!

  5. Running command line scripts

    See ssc/README.md.

Assets

To use the STK, you will need to get yourself some assets. There are several open-source datasets that you can use with the STK. Many of these datasets require agreeing to a license and terms of use,

  1. 3D Models
  1. Synthetic Scenes
  1. Reconstructions

The STK has been developed to be able to easily view and annotate 3D assets. Specifically, parts of ShapeNet, SUNCG, ScanNet, and Matterport3D were all developed using the STK.

Entry Points

Development flow

If you are developing and changing the STK, the following will monitor changes to the client / server code.

  1. In the /client folder, run this command:
NODE_ENV=dev npm run build
  1. In the /server folder, run this command:
npm run watch

You can also specify the remote instance to use for various webservices (such as solr search) by specifying

STK_REMOTE_HOST=https://<remote-server-name>/scene-toolkit  npm run watch

Advanced Build Instructions

Different builds of client STK

To build different builds of the client STK library

For convenience a build.sh script is provided that will run the two steps above. You will need to repeat the build step every time the client source files are changed or use NODE_ENV=dev npm run build to watch and rebuild as you develop!

Build the documentation

Running the server

Once you have built the client library, to start the server do the following from the root repository directory:

cd server
npm install                 
npm start          # or use "npm watch" to run the server using nodemon and automatically restart the server on changes

The server/run.sh script is provided that will run the above steps together.

See server/README.md for details, including how to deploy a new instance.

Development Workflow

For routine local development, here are the usual steps:

Versioning conventions:

Annotation Assets and Database

The annotation tools use a MySQL database for storing annotations and an Apache solr index for indexing assets.

SQL DDL scripts for creating data tables are in scripts/db. See MySQL installation instructions for installing your own instance of MySQL and run the provided DDL scripts in scripts/db to create the annotation tables.

See wiki for how to prepare your assets for annotation. Once you have setup a MySQL server, you should edit config.annDb in server/config/index.js to point to your MySQL instance.

Access remote servers using reverse proxying and SSH tunneling

The server uses reverse proxying to access various other resources and web services. Edit server/app/routes/proxy-rules.js to add your own proxy rules for accessing your own resources.

If you run your own solr instance locally, you should set the environment variable USE_LOCAL=1. This can be done by manually or by copying the env.example.sh to env.sh and modifying it as necessary. It will be used in the provided build.sh and run.sh.

For storing annotations, you will need to setup your own MySQL server. Once you have setup a MySQL server, you should edit config.annDb in server/config/index.js to point to your MySQL instance.

If your MySQL server is limited to access by localhost only, you can use ssh tunneling to forward 3306 from a remote machine to localhost through SSH connection:

ssh -L 3306:localhost:3306 -L <host> -N

Building the documentation

Changelog

Refer to CHANGELOG.md for a record of notable changes.