yemount / pose-animator

Apache License 2.0
8.72k stars 962 forks source link

Get it running on Ubuntu (Documentation) #24

Open magdesign opened 4 years ago

magdesign commented 4 years ago

First install yarn:

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn

then replace the whole content of package.jsonwith:

{
  "name": "tfjs-models",
  "version": "0.0.1",
  "description": "",
  "main": "index.js",
  "license": "Apache-2.0",
  "private": true,
  "engines": {
    "node": ">=8.9.0"
  },
  "dependencies": {
    "@tensorflow-models/facemesh": "^0.0.1",
    "@tensorflow-models/posenet": "^2.2.1",
    "@tensorflow/tfjs": "^1.7.0",
    "@tensorflow/tfjs-converter": "^1.7.0",
    "@tensorflow/tfjs-core": "^1.7.0",
    "face-api.js": "^0.22.1",
    "paper": "^0.12.1",    
    "stats.js": "^0.17.0"
  },
  "scripts": {
    "watch": "cross-env NODE_ENV=development parcel index.html --no-source-maps --no-hmr --open ",
    "build": "cross-env NODE_ENV=production parcel build index.html --no-source-maps --public-url ./",
    "build-camera": "cross-env NODE_ENV=production parcel build camera.html --public-url ./",
    "lint": "eslint .",
    "link-local": "yalc link"
  },
  "browser": {
    "crypto": false
  },
  "devDependencies": {
    "babel-core": "^6.26.3",
    "babel-plugin-transform-runtime": "~6.23.0",
    "babel-polyfill": "~6.26.0",
    "babel-preset-env": "~1.6.1",
    "babel-preset-es2017": "^6.24.1",
    "clang-format": "~1.2.2",
    "cross-env": "^5.2.0",
    "dat.gui": "^0.7.2",
    "eslint": "^4.19.1",
    "eslint-config-google": "^0.9.1",
    "parcel-bundler": "~1.12.4",
    "yalc": "~1.0.0-pre.27"
  },
  "eslintConfig": {
    "extends": "google",
    "rules": {
      "require-jsdoc": 0,
      "valid-jsdoc": 0
    },
    "env": {
      "es6": true
    },
    "parserOptions": {
      "ecmaVersion": 8,
      "sourceType": "module"
    }
  },
  "eslintIgnore": [
    "dist/"
  ]
}

then:

yarn

it will download and install some stuff. when finished type:

yarn watch

your browser should pop-up and pose-animator is running.

SridharRamasami commented 3 years ago

Thanks a lot for this. I wasted quite a few hours trying to get it to run. Then found your approach and had it working in 5 minutes :-)

hpssjellis commented 3 years ago

Thanks @magdesign that was what was needed. By the way, your solution makes it work on Gitpod with just yarn and yarn watch.

Need to have a github login. This link will load it

https://gitpod.io/#github.com/yemount/pose-animator

Yakito commented 2 years ago

Hi! any ideas how to make it work with HTTPS? My server is running HTTPS fine, but as soon as I yarn watch it is like whatever is inside port 1234 runs outside HTTPS.

Any idea how to make it work? Thanks in advance!