Skip to content

Commit

Permalink
test: add back logging to debug predicting on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
Lena Ebner committed Dec 14, 2023
1 parent 2aed4a1 commit a83fbd0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions robot_ui/src/utils/useDetector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const useFaceLandmarkDetector = (): FaceLandmarkDetectorType => {
}, [storeCalibrations]);

const doCalibration = useCallback(async () => {
// console.log('doCalibration', video, faceLandmarkerService.faceLandmarker);
//console.log('doCalibration', video, faceLandmarkerService.faceLandmarker);
if (!faceLandmarkerService.faceLandmarker || !video) return;

if (calibrationBlendValues.mouthSmileLeft.length >= CALIBRATION_FRAMES) {
Expand Down Expand Up @@ -253,7 +253,7 @@ export const useFaceLandmarkDetector = (): FaceLandmarkDetectorType => {
};

const predictWebcam = useCallback(() => {
// console.log('predictWebcam', faceLandmarkerService.faceLandmarker, video, predictionRunning);
console.log('predictWebcam', faceLandmarkerService.faceLandmarker, video, predictionRunning);
if (!predictionRunning) return;

if (!faceLandmarkerService.faceLandmarker || !video) return;
Expand All @@ -267,6 +267,9 @@ export const useFaceLandmarkDetector = (): FaceLandmarkDetectorType => {
if (results && results.faceBlendshapes?.length > 0) {
const { faceBlendshapes } = results;
calculateBlendValuesOnSpectrum(faceBlendshapes);
} else {
console.log('predicting error', results);
setErrorMessage("Prediction failed. Couldn't detect face. Trying again in next attempt.");
}

if (isPredicting) {
Expand Down

0 comments on commit a83fbd0

Please sign in to comment.