Sentinel-Multimodal-Emotion-AI / backend /test_integration.py
r-vasanthkumar73-dev's picture
Deploying backend and frontend folder modules.
099d157 verified
Raw
History Blame Contribute Delete
718 Bytes
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()