Skip to content
Snippets Groups Projects
Commit 4a8d5326 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[advanced][databases][mobio] Fix paths for Templates and Probes

parent 0f83f0b6
Branches
No related tags found
1 merge request!16Fix paths for Templates and Probes for mobio 4
...@@ -159,6 +159,10 @@ class Templates(View): ...@@ -159,6 +159,10 @@ class Templates(View):
if not os.path.isabs(annotations): if not os.path.isabs(annotations):
annotations = os.path.join(root_folder, annotations) annotations = os.path.join(root_folder, annotations)
images = parameters['images']
if not os.path.isabs(images):
images = os.path.join(root_folder, images)
db = bob.db.mobio.Database(annotation_directory=annotations) db = bob.db.mobio.Database(annotation_directory=annotations)
template_ids = db.model_ids(protocol=parameters['protocol'], template_ids = db.model_ids(protocol=parameters['protocol'],
...@@ -173,7 +177,7 @@ class Templates(View): ...@@ -173,7 +177,7 @@ class Templates(View):
model_ids=[template_id]) model_ids=[template_id])
entries.extend([ Entry(x.client_id, template_id, x.id, db.annotations(x), entries.extend([ Entry(x.client_id, template_id, x.id, db.annotations(x),
x.make_path(root_folder, '.png')) x.make_path(images, '.png'))
for x in objs ]) for x in objs ])
return sorted(entries, key=lambda x: (x.client_id, x.template_id, x.file_id)) return sorted(entries, key=lambda x: (x.client_id, x.template_id, x.file_id))
...@@ -262,6 +266,10 @@ class Probes(View): ...@@ -262,6 +266,10 @@ class Probes(View):
if not os.path.isabs(annotations): if not os.path.isabs(annotations):
annotations = os.path.join(root_folder, annotations) annotations = os.path.join(root_folder, annotations)
images = parameters['images']
if not os.path.isabs(images):
images = os.path.join(root_folder, images)
db = bob.db.mobio.Database(annotation_directory=annotations) db = bob.db.mobio.Database(annotation_directory=annotations)
template_ids = sorted(db.model_ids(protocol=parameters['protocol'], template_ids = sorted(db.model_ids(protocol=parameters['protocol'],
...@@ -290,7 +298,7 @@ class Probes(View): ...@@ -290,7 +298,7 @@ class Probes(View):
if obj.id in template_probes[template_id] ] if obj.id in template_probes[template_id] ]
entries.append( Entry(templates, obj.client_id, obj.id, obj.id, entries.append( Entry(templates, obj.client_id, obj.id, obj.id,
db.annotations(obj), obj.make_path(root_folder, '.png')) ) db.annotations(obj), obj.make_path(images, '.png')) )
return sorted(entries, key=lambda x: (len(x.template_ids), x.template_ids, return sorted(entries, key=lambda x: (len(x.template_ids), x.template_ids,
x.client_id, x.probe_id)) x.client_id, x.probe_id))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment