update hand annotations

pull/356/head
Vladimir Mandic 2021-12-30 12:14:09 -05:00
parent 5a6ef389a6
commit 15ff1efc4b
2 changed files with 9 additions and 2 deletions

View File

@ -38,9 +38,7 @@ export async function predict(input: Tensor, config: Config): Promise<HandResult
annotations[key] = meshAnnotations[key].map((index) => predictions[i].landmarks[index]);
}
}
const keypoints = predictions[i].landmarks as unknown as Array<Point>;
let box: Box = [Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, 0, 0]; // maximums so conditionals work
let boxRaw: Box = [0, 0, 0, 0];
if (keypoints && keypoints.length > 0) { // if we have landmarks, calculate box based on landmarks

View File

@ -51,12 +51,21 @@ const cache: {
};
const fingerMap = {
/*
thumb: [0, 1, 2, 3, 4],
index: [0, 5, 6, 7, 8],
middle: [0, 9, 10, 11, 12],
ring: [0, 13, 14, 15, 16],
pinky: [0, 17, 18, 19, 20],
palm: [0],
*/
thumb: [1, 2, 3, 4],
index: [5, 6, 7, 8],
middle: [9, 10, 11, 12],
ring: [13, 14, 15, 16],
pinky: [17, 18, 19, 20],
base: [0],
palm: [0, 17, 13, 9, 5, 1, 0],
};
export async function loadDetect(config: Config): Promise<GraphModel> {