-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.py
34 lines (28 loc) · 1.23 KB
/
models.py
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
from flask_sqlalchemy import SQLAlchemy
import sqlalchemy_jsonfield
db = SQLAlchemy()
class EmotionIndicesAnnotation(db.Model):
id = db.Column(db.Integer, primary_key=True)
video_file_name = db.Column(db.String(150), unique=False, nullable=False)
emotion_zone = db.Column(db.String(80), unique=False, nullable=False)
time_of_video_seconds = db.Column(db.Float, unique=False, nullable=False)
behaviour_markes = db.Column(db.JSON)
timestamp_annotation = db.Column(db.DateTime, nullable=False)
annotator = db.Column(db.String(150), unique=False, nullable=False)
behaviour_markes = db.Column(
sqlalchemy_jsonfield.JSONField(
enforce_string=True,
enforce_unicode=False
),
nullable=False
)
# example of format for behaviour markers json
# {
# jumping: 0,
# other : " hshsjhsksjslsklsk "
# }
def __repr__(self):
return f"<id: {self.id}, video_file: {self.video_file_name}, emotion_zone: {self.emotion_zone}, " \
f"time_seconds: {self.time_of_video_seconds}, behaviour markers: {self.behaviour_markes}," \
f"timestamp_annotation: {self.timestamp_annotation}," \
f"annotator: {self.annotator}>"