| 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() | |