0.4.0 • Public • Published

Quick Tensorflow.js on CLI

Node CI npm License

This is the command that makes it easy on cli to take advantage of TensorFlow.js pre-trained models in tfjs-models.
If you want to use more features, I recommend using tfjs-models.

Table of Contents


Output JSON.

$ qtf posenet input.jpg

Output image file.

$ qtf posenet input.jpg -o output.jpg
input.jpg output.jpg

Install (on Ubuntu)

$ npm i -g qtf
$ qtf save all

If you using node.js on volta or nodebrew. We have confirmed works on it.

from Repository

$ cd '<your any directory>'

$ git clone https://github.com/amanoese/qtf.git
$ cd qtf
$ npm install
$ npm link

## if you can not run 'npm link'.
$ echo "alias qtf=$PWD/src/index.js" >> ~/.bashrc
$ source ~/.bashrc

on Windows

support. but some features don't work.

Support models

Supports the following model now.

  • posenet
  • mobilenet
  • blazeface
  • BodyPix (Person segmentation)
  • DeepLab v3
## check support model.
$ qtf --help

Result Example


$ qtf posenet input.jpg -o output.jpg
input.jpg output.jpg


Output is JSON only.


$ qtf blazeface input.jpg -o output.jpg
input.jpg output.jpg


Person segmentation

$ qtf body-pix input.jpg -o output.jpg
input.jpg output.jpg

Person body part segmentation


DeepLab v3

$ qtf deeplab input.jpg -o output.jpg

If you not set loadOption. output size fixed 513x513.

input.jpg output.jpg

Save Models on Local

This command uses a trained model on the internet (Google Cloud Starage)...
If use offline or you use the command several times.
It's good idea to download trained model file to local.

$ qtf save all

But trained model data want to diskspace.
you can also choose the model to download.
See below for details.

$ qtf save --help


you can check suuport backend.

$ qtf backend
now      : tensorflow
supports : cpu,wasm,tensorflow

If you want to use the backend.set environment to 'QTF_BACKEND'

$ export QTF_BACKEND=wasm

$ qtf backend
now      : wasm
supports : cpu,wasm,tensorflow

This command support backends.

name project personal opinion
cpu tfjs-backend-cpu pureJS. slowly. but it's works in most environments. so cool.
wasm tfjs-backend-wasm WebAssembly. fast. environment independent. But that power was beyond my skill. It probably only works with "blazeface".
tensorflow tfjs-node C Library. fast. but It depends on node-gyp. if you want to install, please see this link.

A backend that fails to install does not appear in support.
may be increased by a global installation, like npm -g @tensorflow/tfjs-node
I haven't checked. It probably works.


$ npm install
$ npm link
$ qtf --help

CI on Local

$ act -n
$ act push

On the roadmap, but still missing

  • Support tfjs-models
    • PoseNet
      • Support ResNet50
      • different model stride
    • Coco SSD
    • BodyPix
      • segmentPersonParts
    • handpose
    • facemesh
  • Input Stream of UVC device.


qtf is not Qtransformers.

Package Sidebar


npm i qtf

Weekly Downloads






Unpacked Size

55.8 kB

Total Files


Last publish


  • amanoese