-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata_structures.py
More file actions
37 lines (32 loc) · 1.09 KB
/
Copy pathdata_structures.py
File metadata and controls
37 lines (32 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from __future__ import annotations
from dataclasses import dataclass, field
from typing import List, Optional, Union
import numpy as np
@dataclass
class Frame:
"""Frame data structure - add if missing"""
image: Optional[np.ndarray] = None
timestamp: float = 0.0
frame_index: int = 0
@dataclass
class Scene:
scene_id: int
start_time: float
end_time: float
frames: List[Frame] = field(default_factory=list)
representative_frame: Optional[Union[Frame, np.ndarray]] = None
# Duration and motion metrics
duration: float = 0.0
motion_mean: float = 0.0 # ✅ ADDED - was missing
motion_peak: float = 0.0 # ✅ ADDED - was missing
motion_std: float = 0.0 # ✅ ADDED - was missing
motion_intensity: float = 0.0
suddenness: float = 0.0
# Object/context metrics
object_count_start: int = 0
object_count_end: int = 0
object_delta: int = 0
# Importance metrics
importance_score: float = 0.0
importance_label: Optional[str] = None
emotion_score: float = 0.0 # ✅ ADDED - for emotion analysis