July 2019
Intermediate to advanced
416 pages
10h 6m
English
Getting back to our PoseClassifier class, our constructor deals with exactly the same WebGLTexture issue that we discussed for our ImageClassifier implementation:
constructor() { // If running on Windows, there can be issues // loading WebGL textures properly. // Running the following command solves this. tf.ENV.set('WEBGL_PACK', false);}
We are now going to write an asynchronous Pose method that returns either an array of Keypoint items, or null if the PoseNet model fails to load or find any poses. As well as accepting an image, this method will also accept the canvas that provides the context that we are going to draw our points on:
public async Pose(image: HTMLImageElement, canvas: HTMLCanvasElement): ...
Read now
Unlock full access