Пример #1
0
def create_segment(s, v):
    ds = Segment()
    ds.video_id = v.pk
    ds.segment_index = s.get('segment_index', '-1')
    ds.start_time = s.get('start_time', 0)
    ds.end_time = s.get('end_time', 0)
    ds.metadata = s.get('metadata', "")
    ds.frame_count = s.get('frame_count', 0)
    ds.start_index = s.get('start_index', 0)
    return ds
Пример #2
0
def create_segment(s,v):
    ds = Segment()
    ds.video_id = v.pk
    ds.segment_index = s.get('segment_index','-1')
    ds.start_time = s.get('start_time',0)
    ds.end_time = s.get('end_time',0)
    ds.metadata = s.get('metadata',"")
    ds.frame_count = s.get('frame_count',0)
    ds.start_index = s.get('start_index',0)
    return ds
Пример #3
0
 def create_segment(self, s):
     ds = Segment()
     ds.video_id = self.video.pk
     ds.segment_index = s.get('segment_index', '-1')
     ds.start_time = s.get('start_time', 0)
     ds.end_time = s.get('end_time', 0)
     ds.metadata = s.get('metadata', "")
     if s.get('event', None):
         ds.event_id = self.event_to_pk[s['event']]
     ds.frame_count = s.get('frame_count', 0)
     ds.start_index = s.get('start_index', 0)
     return ds