remove draw landmark

This commit is contained in:
mphstar 2025-02-04 15:29:16 +07:00
parent 4e5e65c83d
commit 793d0ca73e
1 changed files with 0 additions and 24 deletions

View File

@ -108,28 +108,6 @@ const Home = () => {
prediction.dispose(); prediction.dispose();
}; };
const drawLandmarks = (landmarks: any[]) => {
if (!canvasRef.current) return;
const canvas = canvasRef.current;
const ctx = canvas.getContext("2d");
if (ctx) {
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = "red";
landmarks.forEach((landmark) => {
ctx.beginPath();
ctx.arc(
landmark.x * canvas.width,
landmark.y * canvas.height,
2,
0,
2 * Math.PI
);
ctx.fill();
});
}
};
const detectHands = async () => { const detectHands = async () => {
if (videoRef.current && videoRef.current.readyState >= 2) { if (videoRef.current && videoRef.current.readyState >= 2) {
@ -150,8 +128,6 @@ const Home = () => {
const calt = calcLandmarkList(videoRef.current, landm); const calt = calcLandmarkList(videoRef.current, landm);
const finalResult = preProcessLandmark(calt); const finalResult = preProcessLandmark(calt);
// drawLandmarks(landm);
makePrediction(finalResult); makePrediction(finalResult);
} else { } else {
setHandPresence(false); setHandPresence(false);