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.38k stars 325 forks source link

Custom model training #303

Closed mexists closed 2 years ago

mexists commented 2 years ago

Hi Sir @vladmandic

Thanks for creating this awesome project! I have noticed in your example that you have the object detection model.

My question is:

  1. Is it possible to use human to train a specific custom object model? eg: Tesla Cybertruck.
  2. How do I import custom trained model into human so that the object detection model will recognize my custom object model?

Thanks!

vladmandic commented 2 years ago

you cannot use human for training directly

you could start with source of the same model that human uses and retrain it,
that way input and output would be in formats that human already understands

human currently implements variations of two object detection models:

and they both can be trained with custom data - then using resulting model in human is trivial.

alternatively, you can expand human with a custom model although its not trivial

you could add your own model by registering it in src/models.ts
each model must implement two methods:

load: trivial and it can be just copy & pasted from any existing one

async function load(config: Config): Promise<GraphModel>

predict: this is the important one as any model would require

async function predict(input: Tensor4D, config: Config): Promise<ObjectResult[]>

btw, i'm closing the issue as its not a product issue but more of a general question - but feel free to continue on this thread