- Fork this repository
- Create a new file
mobilenet_1/README.md
- Extract
model.zip
- Upload all files into
mobilenet_1
folder - Click
model.json
>Raw
- Copy raw URL of model.json
- Download and extract this forked repository
- Replace the model URL in index.js at tf.loadModel()
- Install Docker
- Ubuntu: https://docs.docker.com/install/linux/docker-ce/ubuntu/
- macOS: https://docs.docker.com/docker-for-mac/install/
- Microsoft Windows: https://docs.docker.com/docker-for-windows/install/
- Pull Docker image (~200MB)
docker pull mrteera/tfjs:base
- Run Docker
docker run -it --rm -v <tfjs-pacman-full-path>:/root/tfjs-pacman -p 1234:1234 mrteera/tfjs:base /bin/bash
For Windows
docker run -it --rm -v 'C:\ Downloads\tfjs-pacman:/root/tfjs-pacman' -p 1234:1234 mrteera/tfjs:base /bin/bash
For Windows (Legacy Docker)
docker run -it --rm -v '/c/ Downloads/tfjs-pacman:/root/tfjs-pacman/my_code' -p 1234:1234 mrteera/tfjs:base /bin/bash
- install TensorFlow.js
cd /root/tfjs-pacman
cat index.js | grep dense_3 # only for windows legacy
yarn add @tensorflow/tfjs
yarn add @tensorflow/tfjs-node
yarn
- Run
yarn watch