MCPcopy Index your code
hub / github.com/diffgram/diffgram / Sequence

Class Sequence

shared/database/video/sequence.py:14–499  ·  view source on GitHub ↗

A sequence of instances. ie in A video A sequence has multiple instances A label has multiple sequences TODO sequence should store a project id A video_file_id + label_file_id + number is globally unique

Source from the content-addressed store, hash-verified

12import traceback
13
14class Sequence(Base):
15 """
16 A sequence of instances. ie in A video
17 A sequence has multiple instances
18 A label has multiple sequences
19
20 TODO sequence should store a project id
21
22 A video_file_id + label_file_id + number is globally unique
23
24 """
25
26 __tablename__ = 'sequence'
27
28 __table_args__ = (
29 Index('index__video_file_id__and__label_file_id',
30 "video_file_id", "label_file_id"),
31 )
32
33 id = Column(Integer, primary_key = True)
34
35 label_file_id = Column(Integer, ForeignKey('file.id'))
36 label_file = relationship("File", foreign_keys = [label_file_id])
37
38 has_changes = Column(Boolean)
39 single_frame = Column(Boolean, default = False)
40
41 """
42 apparently using this instead of instance_list
43
44 instance_list = Instance.list( # Using this checks for soft deleted by default
45 session = session,
46 sequence_id = sequence.id)
47
48 BUT caution we still use this in other places.
49 It does work as expected so long as there are sequences there.
50 """
51 instance_list = relationship("Instance", back_populates = "sequence")
52
53 # frame numbers
54 # more of a UI thing?
55 # keyframe_list['frame_number_list'] to access numbers of keyframes
56 # Could maybe put other info here in future too
57 keyframe_list = Column(MutableDict.as_mutable(JSONEncodedDict),
58 default = {})
59
60 # Can't attach to video directly,
61 # as sequence may change in source control?
62 # TODO clarify this is the VIDEO file it's attached to?
63 video_file_id = Column(Integer, ForeignKey('file.id'))
64 video_file = relationship("File", foreign_keys = [video_file_id]) # back_populates="sequence_list"
65
66 number = Column(Integer, default = -1)
67
68 instance_preview_cache = Column(MutableDict.as_mutable(JSONEncodedDict),
69 default = {})
70 cache_expiry = Column(Integer)
71 archived = Column(Boolean, default = False)

Callers 3

create_sequenceFunction · 0.90
newMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected