File size: 718 Bytes
099d157
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import sys
sys.path.append("c:/Users/Vasanth kumar/OneDrive/Desktop/new_clg_project/backend")
import cv2
import numpy as np
import json
import traceback
from models.face_mesh import process_frame
from models.face_model import predict_emotion

try:
    print("Generating frame...")
    frame_rgb = np.zeros((480, 640, 3), dtype=np.uint8)
    print("Processing mesh...")
    mesh_result = process_frame(frame_rgb)
    landmarks = mesh_result.get("landmarks", [])
    
    print(f"Predicting emotion with {len(landmarks)} landmarks...")
    res = predict_emotion(frame_rgb, landmarks)
    print("Dumping JSON:", json.dumps(res))
    print("SUCCESS")
except Exception as e:
    print("CRASHED!")
    traceback.print_exc()