Mercurial Hosting > traffic-intelligence
comparison python/metadata.py @ 955:a15e843af55a
correcting errors in metadata names for backrefs
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 15 Aug 2017 16:15:27 -0400 |
parents | c70adaeeddf5 |
children | 5d9899504977 |
comparison
equal
deleted
inserted
replaced
954:030b16ab4f64 | 955:a15e843af55a |
---|---|
89 startTime = Column(DateTime) | 89 startTime = Column(DateTime) |
90 endTime = Column(DateTime) | 90 endTime = Column(DateTime) |
91 description = Column(String) # eg sunny, before, after | 91 description = Column(String) # eg sunny, before, after |
92 siteIdx = Column(Integer, ForeignKey('sites.idx')) | 92 siteIdx = Column(Integer, ForeignKey('sites.idx')) |
93 | 93 |
94 site = relationship("Site", backref=backref('environmental_factors', order_by = idx)) | 94 site = relationship("Site", backref = backref('environmentalFactors')) |
95 | 95 |
96 def __init__(self, startTime, endTime, description, site): | 96 def __init__(self, startTime, endTime, description, site): |
97 'startTime is passed as string in utils.datetimeFormat, eg 2011-06-22 10:00:39' | 97 'startTime is passed as string in utils.datetimeFormat, eg 2011-06-22 10:00:39' |
98 self.startTime = datetime.strptime(startTime, datetimeFormat) | 98 self.startTime = datetime.strptime(startTime, datetimeFormat) |
99 self.endTime = datetime.strptime(endTime, datetimeFormat) | 99 self.endTime = datetime.strptime(endTime, datetimeFormat) |
185 cameraTypeIdx = Column(Integer, ForeignKey('camera_types.idx')) | 185 cameraTypeIdx = Column(Integer, ForeignKey('camera_types.idx')) |
186 trackingConfigurationFilename = Column(String) # path to configuration .cfg file, relative to site name | 186 trackingConfigurationFilename = Column(String) # path to configuration .cfg file, relative to site name |
187 maskFilename = Column(String) # path to mask file, relative to site name | 187 maskFilename = Column(String) # path to mask file, relative to site name |
188 virtual = Column(Boolean) # indicates it is not a real camera view, eg merged | 188 virtual = Column(Boolean) # indicates it is not a real camera view, eg merged |
189 | 189 |
190 site = relationship("Site", backref=backref('sites', order_by = idx)) | 190 site = relationship("Site", backref = backref('cameraViews')) |
191 cameraType = relationship('CameraType', backref=backref('camera_types', order_by = idx)) | 191 cameraType = relationship('CameraType', backref = backref('cameraViews')) |
192 | 192 |
193 def __init__(self, description, homographyFilename, site, cameraType, trackingConfigurationFilename, maskFilename, virtual = False): | 193 def __init__(self, description, homographyFilename, site, cameraType, trackingConfigurationFilename, maskFilename, virtual = False): |
194 self.description = description | 194 self.description = description |
195 self.homographyFilename = homographyFilename | 195 self.homographyFilename = homographyFilename |
196 self.site = site | 196 self.site = site |
224 return self.site.worldDistanceUnit | 224 return self.site.worldDistanceUnit |
225 | 225 |
226 # class Alignment(Base): | 226 # class Alignment(Base): |
227 # __tablename__ = 'alignments' | 227 # __tablename__ = 'alignments' |
228 # idx = Column(Integer, primary_key=True) | 228 # idx = Column(Integer, primary_key=True) |
229 # cameraViewIdx = Column(Integer, ForeignKey('camera_views.idx')) # should be sites?? | 229 # siteIdx = Column(Integer, ForeignKey('sites.idx')) |
230 | 230 |
231 # cameraView = relationship("CameraView", backref=backref('alignments', order_by = idx)) | 231 # cameraView = relationship("Site", backref = backref('alignments')) |
232 | 232 |
233 # def __init__(self, cameraView): | 233 # def __init__(self, cameraView): |
234 # self.cameraView = cameraView | 234 # self.cameraView = cameraView |
235 | 235 |
236 # class Point(Base): | 236 # class Point(Base): |
238 # alignmentIdx = Column(Integer, ForeignKey('alignments.idx'), primary_key=True) | 238 # alignmentIdx = Column(Integer, ForeignKey('alignments.idx'), primary_key=True) |
239 # index = Column(Integer, primary_key=True) # order of points in this alignment | 239 # index = Column(Integer, primary_key=True) # order of points in this alignment |
240 # x = Column(Float) | 240 # x = Column(Float) |
241 # y = Column(Float) | 241 # y = Column(Float) |
242 | 242 |
243 # alignment = relationship("Alignment", backref=backref('alignments', order_by = index)) | 243 # alignment = relationship("Alignment", backref = backref('points', order_by = index)) |
244 | 244 |
245 # def __init__(self, alignmentIdx, index, x, y): | 245 # def __init__(self, alignmentIdx, index, x, y): |
246 # self.alignmentIdx = alignmentIdx | 246 # self.alignmentIdx = alignmentIdx |
247 # self.index = index | 247 # self.index = index |
248 # self.x = x | 248 # self.x = x |
256 duration = Column(Interval) # video sequence duration | 256 duration = Column(Interval) # video sequence duration |
257 databaseFilename = Column(String) # path to the database file relative to the the site name | 257 databaseFilename = Column(String) # path to the database file relative to the the site name |
258 virtual = Column(Boolean) # indicates it is not a real video sequence (no video file), eg merged | 258 virtual = Column(Boolean) # indicates it is not a real video sequence (no video file), eg merged |
259 cameraViewIdx = Column(Integer, ForeignKey('camera_views.idx')) | 259 cameraViewIdx = Column(Integer, ForeignKey('camera_views.idx')) |
260 | 260 |
261 cameraView = relationship("CameraView", backref=backref('camera_views', order_by = idx)) | 261 cameraView = relationship("CameraView", backref = backref('videoSequences', order_by = idx)) |
262 | 262 |
263 def __init__(self, name, startTime, duration, cameraView, databaseFilename = None, virtual = False): | 263 def __init__(self, name, startTime, duration, cameraView, databaseFilename = None, virtual = False): |
264 '''startTime is passed as string in utils.datetimeFormat, eg 2011-06-22 10:00:39 | 264 '''startTime is passed as string in utils.datetimeFormat, eg 2011-06-22 10:00:39 |
265 duration is a timedelta object''' | 265 duration is a timedelta object''' |
266 self.name = name | 266 self.name = name |
315 lastFrameNum = Column(Integer) | 315 lastFrameNum = Column(Integer) |
316 videoSequenceIdx = Column(Integer, ForeignKey('video_sequences.idx')) | 316 videoSequenceIdx = Column(Integer, ForeignKey('video_sequences.idx')) |
317 maskFilename = Column(String) # path to mask file (can be different from camera view, for annotations), relative to site name | 317 maskFilename = Column(String) # path to mask file (can be different from camera view, for annotations), relative to site name |
318 undistorted = Column(Boolean) # indicates whether the annotations were done in undistorted video space | 318 undistorted = Column(Boolean) # indicates whether the annotations were done in undistorted video space |
319 | 319 |
320 videoSequence = relationship("VideoSequence", backref=backref('video_sequences', order_by = idx)) | 320 videoSequence = relationship("VideoSequence", backref = backref('trackingAnnotations')) |
321 | 321 |
322 def __init__(self, description, groundTruthFilename, firstFrameNum, lastFrameNum, videoSequence, maskFilename, undistorted = True): | 322 def __init__(self, description, groundTruthFilename, firstFrameNum, lastFrameNum, videoSequence, maskFilename, undistorted = True): |
323 self.description = description | 323 self.description = description |
324 self.groundTruthFilename = groundTruthFilename | 324 self.groundTruthFilename = groundTruthFilename |
325 self.firstFrameNum = firstFrameNum | 325 self.firstFrameNum = firstFrameNum |