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

[advanced][databases][mobio] Fix root path handling

The root path of a database must be the top level folder where
its data can be found. All other paths should be going from there.

This patch fixes that by adding the image folder as a parameter of
a set and therefore making root_path a real root_path.
parent dff99a25
No related branches found
No related tags found
No related merge requests found
{
"description": "The MOBIO Database of Faces",
"root_folder": "/idiap/resource/database/mobio/IMAGES_PNG",
"root_folder": "/idiap/resource/database/mobio",
"protocols": [
{
"name": "male",
......@@ -12,7 +12,8 @@
"view": "Train",
"parameters": {
"protocol": "male",
"annotations": "../IMAGE_ANNOTATIONS"
"images": "IMAGES_PNG",
"annotations": "IMAGE_ANNOTATIONS"
},
"outputs": {
"file_id": "{{ system_user.username }}/uint64/1",
......@@ -28,7 +29,8 @@
"parameters": {
"protocol": "male",
"group": "dev",
"annotations": "../IMAGE_ANNOTATIONS"
"images": "IMAGES_PNG",
"annotations": "IMAGE_ANNOTATIONS"
},
"outputs": {
"file_id": "{{ system_user.username }}/uint64/1",
......@@ -45,7 +47,8 @@
"parameters": {
"protocol": "male",
"group": "dev",
"annotations": "../IMAGE_ANNOTATIONS"
"images": "IMAGES_PNG",
"annotations": "IMAGE_ANNOTATIONS"
},
"outputs": {
"file_id": "{{ system_user.username }}/uint64/1",
......@@ -63,7 +66,8 @@
"parameters": {
"protocol": "male",
"group": "eval",
"annotations": "../IMAGE_ANNOTATIONS"
"images": "IMAGES_PNG",
"annotations": "IMAGE_ANNOTATIONS"
},
"outputs": {
"file_id": "{{ system_user.username }}/uint64/1",
......@@ -80,7 +84,8 @@
"parameters": {
"protocol": "male",
"group": "eval",
"annotations": "../IMAGE_ANNOTATIONS"
"images": "IMAGES_PNG",
"annotations": "IMAGE_ANNOTATIONS"
},
"outputs": {
"file_id": "{{ system_user.username }}/uint64/1",
......@@ -103,7 +108,8 @@
"view": "Train",
"parameters": {
"protocol": "female",
"annotations": "../IMAGE_ANNOTATIONS"
"images": "IMAGES_PNG",
"annotations": "IMAGE_ANNOTATIONS"
},
"outputs": {
"file_id": "{{ system_user.username }}/uint64/1",
......@@ -119,7 +125,8 @@
"parameters": {
"protocol": "female",
"group": "dev",
"annotations": "../IMAGE_ANNOTATIONS"
"images": "IMAGES_PNG",
"annotations": "IMAGE_ANNOTATIONS"
},
"outputs": {
"file_id": "{{ system_user.username }}/uint64/1",
......@@ -136,7 +143,8 @@
"parameters": {
"protocol": "female",
"group": "dev",
"annotations": "../IMAGE_ANNOTATIONS"
"images": "IMAGES_PNG",
"annotations": "IMAGE_ANNOTATIONS"
},
"outputs": {
"file_id": "{{ system_user.username }}/uint64/1",
......@@ -154,7 +162,8 @@
"parameters": {
"protocol": "female",
"group": "eval",
"annotations": "../IMAGE_ANNOTATIONS"
"images": "IMAGES_PNG",
"annotations": "IMAGE_ANNOTATIONS"
},
"outputs": {
"file_id": "{{ system_user.username }}/uint64/1",
......@@ -171,7 +180,8 @@
"parameters": {
"protocol": "female",
"group": "eval",
"annotations": "../IMAGE_ANNOTATIONS"
"images": "IMAGES_PNG",
"annotations": "IMAGE_ANNOTATIONS"
},
"outputs": {
"file_id": "{{ system_user.username }}/uint64/1",
......
......@@ -69,6 +69,10 @@ class Train(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)
objs = sorted(db.objects(protocol=parameters['protocol'],
......@@ -76,7 +80,7 @@ class Train(View):
purposes='train'),
key=lambda x: (x.client_id, x.id))
return [ Entry(x.client_id, x.id, db.annotations(x), x.make_path(root_folder, '.png'))
return [ Entry(x.client_id, x.id, db.annotations(x), x.make_path(images, '.png'))
for x in objs ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment