Skip to content

Commit

Permalink
clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasGonzalez committed Apr 9, 2024
1 parent 890dadc commit 45e1baf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/hands-capture/hooks/useKeyPointClassifier.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { useEffect, useRef } from 'react';
import { Landmark, Results } from '@mediapipe/hands';

import * as tf from '@tensorflow/tfjs';

import _ from 'lodash';

const calcLandmarkList = (image, landmarks) => {
Expand Down Expand Up @@ -51,13 +53,11 @@ function useKeyPointClassifier() {
const model = useRef<any>();

const keyPointClassifier = async (landmarkList) => {
const result = await model.current
return await model.current
.execute(tf.tensor2d([landmarkList]))
.squeeze()
.argMax()
.data();

return result;
};

const processLandmark = async (handLandmarks: Results, image) => {
Expand Down

0 comments on commit 45e1baf

Please sign in to comment.