feat: Standardized Time-Series Emotion Output Schema#10
Open
cc-fuyu wants to merge 1 commit intoruxailab:mainfrom
Open
feat: Standardized Time-Series Emotion Output Schema#10cc-fuyu wants to merge 1 commit intoruxailab:mainfrom
cc-fuyu wants to merge 1 commit intoruxailab:mainfrom
Conversation
Introduce a new StandardizedEmotionOutput schema that includes: - AnalysisMetadata: video name, analysis timestamp, frame/face counts, duration - EmotionEvent timeline: per-frame emotion label, timestamp, and confidence score - EmotionSummary: aggregated emotion percentages (backward-compatible) Add get_standardized_output() method to EmotionsAnalysisImp and a new /process_video_standardized endpoint that returns the structured output. The original /process_video endpoint remains unchanged for backward compatibility. This addresses the 'Standard Output Schemas' key feature of the GSoC 'Sentiment and Emotion Output Standardization' project.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a standardized, time-aware output format for the facial emotion analysis API. It directly addresses the "Standard Output Schemas" key feature described in the GSoC 2026 project "Sentiment and Emotion Output Standardization for Usability Reports".
Problem
The current
/process_videoendpoint returns only a flat dictionary of aggregated emotion percentages. While useful, this format lacks:Changes
New Schema (
schemas/standard_output_schema.py)Defines a structured Pydantic model
StandardizedEmotionOutputwith three sections:metadatatimelineEmotionEventobjects, each containingtimestamp_sec,emotionlabel, andconfidencescore (0.0–1.0)summaryUpdated Analysis Service
get_standardized_output()method toEmotionsAnalysisImpthat captures per-frame timestamps and model confidence during video processing.EmotionsAnalysisServicewith the new method signature.get_emotion_percentages()method remains unchanged for backward compatibility.New API Endpoint
POST /process_video_standardized— accepts the same request body as/process_videobut returns the full standardized output.Example Response
{ "metadata": { "video_name": "session_42.webm", "analysis_timestamp": "2026-02-27T11:30:00.000Z", "total_frames_processed": 120, "total_faces_detected": 115, "video_duration_sec": 60.0 }, "timeline": [ {"timestamp_sec": 0.5, "emotion": "Neutral", "confidence": 0.87}, {"timestamp_sec": 1.0, "emotion": "Happy", "confidence": 0.93} ], "summary": { "Angry": 2.5, "Disgusted": 0.0, "Fearful": 1.2, "Happy": 35.0, "Neutral": 55.3, "Sad": 4.0, "Surprised": 2.0 } }Backward Compatibility
The original
/process_videoendpoint andGetEmotionPercentagesResponseschema are not modified. Existing consumers will continue to work without any changes.Backward Compatibility
The original
/process_videoendpoint andGetEmotionPercentagesResponseschema are not modified. Existing consumers will continue to work without any changes.