vladmandic / human

Human: AI-powered 3D Face Detection & Rotation Tracking, Face Description & Recognition, Body Pose Tracking, 3D Hand & Finger Tracking, Iris Analysis, Age & Gender & Emotion Prediction, Gaze Tracking, Gesture Recognition
https://vladmandic.github.io/human/demo/index.html
MIT License
2.36k stars 323 forks source link

Library depends too much on the user/developer #220

Closed ghost closed 2 years ago

ghost commented 2 years ago

This makes it very confusing

vladmandic commented 2 years ago

what is the problem? which part? what do you suggest? whats the alternative? this is not a constructive issue.

ghost commented 2 years ago

right, im trying to use this, but there is no minimal example ("simplest" example is over 215 LOC!), and i see most of the functions are helper functions, (log and status make sense though)

vladmandic commented 2 years ago

shortest full demo for browsers is 100 LOC and most of it is comments and initialization of the webcam which has nothing to do with the library

shortest full demo for nodejs is 200 LOC because of all pretty-printing of results. if you want just a quick start, here:

const fs = require('fs');
const Human = require('@vladmandic/human').default;

async function main(inputFile) {
  const human = new Human(); // create instance of human using default configuration
  const buffer = fs.readFileSync(inputFile); // read file data into buffer
  const tensor = human.tf.node.decodeImage(buffer); // decode jpg data
  const result = await human.detect(tensor); // run detection; will load models on-demand and initialize backend
  console.log(result);
}

main('samples/in/ai-body.jpg');