mirror of https://github.com/vladmandic/human
breaking changes to results.object output properties
parent
92926aa134
commit
57ad0c886f
|
@ -8668,12 +8668,9 @@ async function process2(res, inputSize, outputShape, config3) {
|
|||
];
|
||||
const result = {
|
||||
id: id++,
|
||||
strideSize,
|
||||
score: Math.round(100 * score3) / 100,
|
||||
class: j + 1,
|
||||
label: labels[j].label,
|
||||
center: [Math.trunc(outputShape[0] * cx), Math.trunc(outputShape[1] * cy)],
|
||||
centerRaw: [cx, cy],
|
||||
box: box6.map((a) => Math.trunc(a)),
|
||||
boxRaw: boxRaw3
|
||||
};
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -66604,12 +66604,9 @@ async function process2(res, inputSize, outputShape, config3) {
|
|||
];
|
||||
const result = {
|
||||
id: id++,
|
||||
strideSize,
|
||||
score: Math.round(100 * score3) / 100,
|
||||
class: j + 1,
|
||||
label: labels[j].label,
|
||||
center: [Math.trunc(outputShape[0] * cx), Math.trunc(outputShape[1] * cy)],
|
||||
centerRaw: [cx, cy],
|
||||
box: box6.map((a) => Math.trunc(a)),
|
||||
boxRaw: boxRaw3
|
||||
};
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -66612,12 +66612,9 @@ return a / b;`;
|
|||
];
|
||||
const result = {
|
||||
id: id++,
|
||||
strideSize,
|
||||
score: Math.round(100 * score3) / 100,
|
||||
class: j + 1,
|
||||
label: labels[j].label,
|
||||
center: [Math.trunc(outputShape[0] * cx), Math.trunc(outputShape[1] * cy)],
|
||||
centerRaw: [cx, cy],
|
||||
box: box6.map((a) => Math.trunc(a)),
|
||||
boxRaw: boxRaw3
|
||||
};
|
||||
|
|
|
@ -8699,12 +8699,9 @@ async function process2(res, inputSize, outputShape, config3) {
|
|||
];
|
||||
const result = {
|
||||
id: id++,
|
||||
strideSize,
|
||||
score: Math.round(100 * score3) / 100,
|
||||
class: j + 1,
|
||||
label: labels[j].label,
|
||||
center: [Math.trunc(outputShape[0] * cx), Math.trunc(outputShape[1] * cy)],
|
||||
centerRaw: [cx, cy],
|
||||
box: box6.map((a) => Math.trunc(a)),
|
||||
boxRaw: boxRaw3
|
||||
};
|
||||
|
|
|
@ -8700,12 +8700,9 @@ async function process2(res, inputSize, outputShape, config3) {
|
|||
];
|
||||
const result = {
|
||||
id: id++,
|
||||
strideSize,
|
||||
score: Math.round(100 * score3) / 100,
|
||||
class: j + 1,
|
||||
label: labels[j].label,
|
||||
center: [Math.trunc(outputShape[0] * cx), Math.trunc(outputShape[1] * cy)],
|
||||
centerRaw: [cx, cy],
|
||||
box: box6.map((a) => Math.trunc(a)),
|
||||
boxRaw: boxRaw3
|
||||
};
|
||||
|
|
|
@ -8699,12 +8699,9 @@ async function process2(res, inputSize, outputShape, config3) {
|
|||
];
|
||||
const result = {
|
||||
id: id++,
|
||||
strideSize,
|
||||
score: Math.round(100 * score3) / 100,
|
||||
class: j + 1,
|
||||
label: labels[j].label,
|
||||
center: [Math.trunc(outputShape[0] * cx), Math.trunc(outputShape[1] * cy)],
|
||||
centerRaw: [cx, cy],
|
||||
box: box6.map((a) => Math.trunc(a)),
|
||||
boxRaw: boxRaw3
|
||||
};
|
||||
|
|
|
@ -91,10 +91,10 @@ export function calc(newResult: Result): Result {
|
|||
bufferedResult.object = JSON.parse(JSON.stringify(newResult.object as Item[])); // deep clone once
|
||||
} else {
|
||||
for (let i = 0; i < newResult.object.length; i++) {
|
||||
const box = newResult.object[i].box // update box
|
||||
.map((b, j) => ((bufferedFactor - 1) * bufferedResult.object[i].box[j] + b) / bufferedFactor);
|
||||
const boxRaw = newResult.object[i].boxRaw // update boxRaw
|
||||
.map((b, j) => ((bufferedFactor - 1) * bufferedResult.object[i].boxRaw[j] + b) / bufferedFactor);
|
||||
const box = (newResult.object[i].box // update box
|
||||
.map((b, j) => ((bufferedFactor - 1) * bufferedResult.object[i].box[j] + b) / bufferedFactor)) as [number, number, number, number];
|
||||
const boxRaw = (newResult.object[i].boxRaw // update boxRaw
|
||||
.map((b, j) => ((bufferedFactor - 1) * bufferedResult.object[i].boxRaw[j] + b) / bufferedFactor)) as [number, number, number, number];
|
||||
bufferedResult.object[i] = { ...newResult.object[i], box, boxRaw }; // shallow clone plus updated values
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,13 +52,13 @@ async function process(res, inputSize, outputShape, config) {
|
|||
detections[0][id][1] / inputSize,
|
||||
detections[0][id][2] / inputSize,
|
||||
detections[0][id][3] / inputSize,
|
||||
];
|
||||
] as [number, number, number, number];
|
||||
const box = [
|
||||
Math.trunc(boxRaw[0] * outputShape[0]),
|
||||
Math.trunc(boxRaw[1] * outputShape[1]),
|
||||
Math.trunc(boxRaw[2] * outputShape[0]),
|
||||
Math.trunc(boxRaw[3] * outputShape[1]),
|
||||
];
|
||||
] as [number, number, number, number];
|
||||
results.push({ id: i++, score, class: classVal, label, box, boxRaw });
|
||||
}
|
||||
return results;
|
||||
|
|
|
@ -63,14 +63,14 @@ async function process(res, inputSize, outputShape, config) {
|
|||
];
|
||||
const result = {
|
||||
id: id++,
|
||||
strideSize,
|
||||
// strideSize,
|
||||
score: Math.round(100 * score) / 100,
|
||||
class: j + 1,
|
||||
label: labels[j].label,
|
||||
center: [Math.trunc(outputShape[0] * cx), Math.trunc(outputShape[1] * cy)],
|
||||
centerRaw: [cx, cy],
|
||||
box: box.map((a) => Math.trunc(a)),
|
||||
boxRaw,
|
||||
// center: [Math.trunc(outputShape[0] * cx), Math.trunc(outputShape[1] * cy)],
|
||||
// centerRaw: [cx, cy],
|
||||
box: (box.map((a) => Math.trunc(a))) as [number, number, number, number],
|
||||
boxRaw: boxRaw as [number, number, number, number],
|
||||
};
|
||||
results.push(result);
|
||||
}
|
||||
|
|
|
@ -116,13 +116,10 @@ export interface Hand {
|
|||
export interface Item {
|
||||
id: number,
|
||||
score: number,
|
||||
strideSize?: number,
|
||||
class: number,
|
||||
label: string,
|
||||
center?: number[],
|
||||
centerRaw?: number[],
|
||||
box: number[],
|
||||
boxRaw: number[],
|
||||
box: [number, number, number, number],
|
||||
boxRaw: [number, number, number, number],
|
||||
}
|
||||
|
||||
/** Gesture results
|
||||
|
|
Loading…
Reference in New Issue