From 4a8d53269fc6fc91e0af9e48fb0661977e4f2c4d Mon Sep 17 00:00:00 2001
From: Samuel Gaist <samuel.gaist@idiap.ch>
Date: Wed, 3 Oct 2018 13:51:55 +0200
Subject: [PATCH] [advanced][databases][mobio] Fix paths for Templates and
 Probes

---
 advanced/databases/mobio/4.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/advanced/databases/mobio/4.py b/advanced/databases/mobio/4.py
index f2c94b1..1cbb8fa 100644
--- a/advanced/databases/mobio/4.py
+++ b/advanced/databases/mobio/4.py
@@ -159,6 +159,10 @@ class Templates(View):
         if not os.path.isabs(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)
 
         template_ids = db.model_ids(protocol=parameters['protocol'],
@@ -173,7 +177,7 @@ class Templates(View):
                               model_ids=[template_id])
 
             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 ])
 
         return sorted(entries, key=lambda x: (x.client_id, x.template_id, x.file_id))
@@ -262,6 +266,10 @@ class Probes(View):
         if not os.path.isabs(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)
 
         template_ids = sorted(db.model_ids(protocol=parameters['protocol'],
@@ -290,7 +298,7 @@ class Probes(View):
                                       if obj.id in template_probes[template_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,
                                               x.client_id, x.probe_id))
-- 
GitLab