Commit 2b86a4e9 authored by André Anjos's avatar André Anjos 💬
Browse files

[models] Add video loading routines

parent 5208ac66
......@@ -177,6 +177,19 @@ class File(object):
self.stem + (extension or self.default_extension()),
def load_video(self, directory):
"""Loads the colored video file associated to this object
Keyword parameters:
A directory name that will be prefixed to the returned result.
path = os.path.join(directory, self.basedir, self.video_stem + '.avi')
def save(self, data, directory=None, extension='.hdf5'):
"""Saves the input data at the specified location and using the given
......@@ -62,6 +62,14 @@ class HCITaggingTest(unittest.TestCase):
print('Physiological signal (%d seconds) is very different in size from estimated video duration (%d seconds) on sample `%s/%s\'' % (time, obj.duration, obj.basedir, obj.stem))
def test02_can_read_camera1_video(self):
for obj in self.db.objects()[:5]:
video = obj.load_video(DATABASE_LOCATION)
assert video.number_of_frames
class CmdLineTest(unittest.TestCase):
"""Makes sure our command-line is working properly."""
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment