Closed anaelshomrai closed 2 months ago
nice! if you want to add it to draw:
create a new module in src/draw
which exports a draw function with signature
for example modelName.ts
with
export function modelName(inCanvas: AnyCanvas, result: ObjectResult[], drawOptions?: Partial<DrawOptions>) { }
take a look at object.ts
for example.
next add that module to imports section in src/draw/draw.ts
and re-export it
import { modelName } from './modelName';
export { modelName} from './modelName';
that's enough that you can now use it using as human.draw.modelName()
and if you want it to run automatically along other draw functions, add it to promise loop in function all
:
modelName(inCanvas, result.modelName, localOptions),
i'm closing the issue as its not a product issue, but feel free to continue with conversation here.
@vladmandic Thank you for the quick response. I've added the relevant methods and it's working.
I'm wondering on a different subject regarding the FPS, is there a way for me to specify the target FPS or even better the target FPS for each model ?
per-model? no.
globally? its not part of the lib as assumption is that human.detect
(or other methods) are called by some other parent app so its really up to parent app to decide how often to call human.
We are in the process of adding a custom model into Human. Seems like the model is being loaded, running and returning results and I'm now wondering what is the process for being able to draw the results ? similar to the other models.
For integrating the new models, we've followed the steps in here https://github.com/vladmandic/human/wiki/Module
In specific:
Thank you !