mirror of https://github.com/vladmandic/human
update hand annotations
parent
5a6ef389a6
commit
15ff1efc4b
|
@ -38,9 +38,7 @@ export async function predict(input: Tensor, config: Config): Promise<HandResult
|
||||||
annotations[key] = meshAnnotations[key].map((index) => predictions[i].landmarks[index]);
|
annotations[key] = meshAnnotations[key].map((index) => predictions[i].landmarks[index]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const keypoints = predictions[i].landmarks as unknown as Array<Point>;
|
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 box: Box = [Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, 0, 0]; // maximums so conditionals work
|
||||||
let boxRaw: Box = [0, 0, 0, 0];
|
let boxRaw: Box = [0, 0, 0, 0];
|
||||||
if (keypoints && keypoints.length > 0) { // if we have landmarks, calculate box based on landmarks
|
if (keypoints && keypoints.length > 0) { // if we have landmarks, calculate box based on landmarks
|
||||||
|
|
|
@ -51,12 +51,21 @@ const cache: {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fingerMap = {
|
const fingerMap = {
|
||||||
|
/*
|
||||||
thumb: [0, 1, 2, 3, 4],
|
thumb: [0, 1, 2, 3, 4],
|
||||||
index: [0, 5, 6, 7, 8],
|
index: [0, 5, 6, 7, 8],
|
||||||
middle: [0, 9, 10, 11, 12],
|
middle: [0, 9, 10, 11, 12],
|
||||||
ring: [0, 13, 14, 15, 16],
|
ring: [0, 13, 14, 15, 16],
|
||||||
pinky: [0, 17, 18, 19, 20],
|
pinky: [0, 17, 18, 19, 20],
|
||||||
palm: [0],
|
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> {
|
export async function loadDetect(config: Config): Promise<GraphModel> {
|
||||||
|
|
Loading…
Reference in New Issue