mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix
This commit is contained in:
@@ -48,7 +48,7 @@ module.exports = class EyesCommand extends Command {
|
||||
for (const face of faces) {
|
||||
const landmarks = face.landmark;
|
||||
const leftWidth = landmarks.left_eye_right_corner.x - landmarks.left_eye_left_corner.x;
|
||||
const leftRatio = eyes.width / leftWidth;
|
||||
const leftRatio = base.width / leftWidth;
|
||||
const leftHeight = eyes.height * leftRatio;
|
||||
ctx.drawImage(
|
||||
eyes,
|
||||
@@ -58,7 +58,7 @@ module.exports = class EyesCommand extends Command {
|
||||
leftHeight
|
||||
);
|
||||
const rightWidth = landmarks.right_eye_right_corner.x - landmarks.right_eye_left_corner.x;
|
||||
const rightRatio = eyes.width / rightWidth;
|
||||
const rightRatio = base.width / rightWidth;
|
||||
const rightHeight = eyes.height * rightRatio;
|
||||
ctx.drawImage(
|
||||
eyes,
|
||||
|
||||
Reference in New Issue
Block a user