From e110f66c6e7b3413cdd520c31da9d93bf4665ebe Mon Sep 17 00:00:00 2001
From: Tiago Freitas Pereira <tiagofrepereira@gmail.com>
Date: Tue, 24 Mar 2020 19:11:22 +0100
Subject: [PATCH] Solved database issue

---
 .../pipelines/vanilla_biometrics/legacy.py    | 22 +++++++++----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/bob/bio/base/pipelines/vanilla_biometrics/legacy.py b/bob/bio/base/pipelines/vanilla_biometrics/legacy.py
index df5bb27e..2ab9b553 100644
--- a/bob/bio/base/pipelines/vanilla_biometrics/legacy.py
+++ b/bob/bio/base/pipelines/vanilla_biometrics/legacy.py
@@ -75,7 +75,7 @@ class DatabaseConnector:
                             self.database.original_directory,
                             self.database.original_extension,
                         ),
-                        key=str(k.id),
+                        key=k.path,
                         path=k.path,
                     )
                 ],
@@ -121,12 +121,12 @@ class DatabaseConnector:
                                 self.database.original_directory,
                                 self.database.original_extension,
                             ),
-                            key=str(k.id),
+                            key=k.path,
                             path=k.path,
                         )
                         for k in objects
                     ],
-                    key=m,
+                    key=str(m),
                     path=str(m),
                     subject=str(objects[0].client_id),
                 )
@@ -176,14 +176,14 @@ class DatabaseConnector:
                                     self.database.original_directory,
                                     self.database.original_extension,
                                 ),
-                                key=str(o.id),
+                                key=o.path,
                                 path=o.path,
                             )
                         ],
                         key=str(o.client_id),
                         path=o.path,
                         subject=str(o.client_id),
-                        references=[m],
+                        references=[str(m)],
                     )
                 else:
                     probes[o.id].references.append(m)
@@ -265,7 +265,7 @@ class DatabaseConnectorAnnotated(DatabaseConnector):
                         load=functools.partial(
                             _load_data_and_annotations, k, self.database.annotations(k), self.database.original_directory, self.database.original_extension
                         ),
-                        key=str(k.id),
+                        key=k.path,
                         path=k.path,
                         annotations=self.database.annotations(k),
                     )
@@ -313,7 +313,7 @@ class DatabaseConnectorAnnotated(DatabaseConnector):
                             load=functools.partial(
                                 _load_data_and_annotations, k, self.database.annotations(k), self.database.original_directory, self.database.original_extension
                             ),
-                            key=k.id,
+                            key=k.path,
                             path=k.path,
                             subject=str(objects[0].client_id),
                             annotations=self.database.annotations(k),
@@ -370,18 +370,18 @@ class DatabaseConnectorAnnotated(DatabaseConnector):
                                 load=functools.partial(
                                     _load_data_and_annotations, o, self.database.annotations(o), self.database.original_directory, self.database.original_extension
                                 ),
-                                key=o.id,
+                                key=o.path,
                                 path=o.path,
                                 annotations=self.database.annotations(o),
                             )
                         ],
-                        key=o.id,
+                        key=str(o.client_id),
                         path=o.path,
                         subject=o.client_id,
-                        references=[m],
+                        references=[str(m)],
                     )
                 else:
-                    probes[o.id].references.append(m)
+                    probes[o.id].references.append(str(m))
 
         return list(probes.values())
 
-- 
GitLab