Commit aeead8fc authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Merge branch 'refactoring_2016' into 'master'

Implements the annotations

See merge request !21
parents 56821692 6ad2f13e
Pipeline #6445 passed with stages
in 13 minutes and 5 seconds
.. vim: set fileencoding=utf-8 : .. vim: set fileencoding=utf-8 :
.. Fri 19 Aug 2016 13:32:51 CEST .. Fri 19 Aug 2016 13:32:51 CEST
.. image:: http://img.shields.io/badge/docs-stable-yellow.png .. image:: http://img.shields.io/badge/docs-stable-yellow.svg
:target: http://pythonhosted.org/bob.bio.vein/index.html :target: http://pythonhosted.org/bob.bio.vein/index.html
.. image:: http://img.shields.io/badge/docs-latest-orange.png .. image:: http://img.shields.io/badge/docs-latest-orange.svg
:target: https://www.idiap.ch/software/bob/docs/latest/bob/bob.bio.vein/master/index.html :target: https://www.idiap.ch/software/bob/docs/latest/bob/bob.bio.vein/master/index.html
.. image:: https://gitlab.idiap.ch/bob/bob.bio.vein/badges/v2.1.0/build.svg .. image:: https://gitlab.idiap.ch/bob/bob.bio.vein/badges/v2.1.0/build.svg
:target: https://gitlab.idiap.ch/bob/bob.bio.vein/commits/v2.1.0 :target: https://gitlab.idiap.ch/bob/bob.bio.vein/commits/v2.1.0
...@@ -44,6 +44,6 @@ development `mailing list`_. ...@@ -44,6 +44,6 @@ development `mailing list`_.
.. Place your references here: .. Place your references here:
.. _bob: https://www.idiap.ch/software/bob .. _bob: https://www.idiap.ch/software/bob
.. _installation: https://gitlab.idiap.ch/bob/bob/wikis/Installation .. _installation: https://www.idiap.ch/software/bob/install
.. _mailing list: https://groups.google.com/forum/?fromgroups#!forum/bob-devel .. _mailing list: https://groups.google.com/forum/?fromgroups#!forum/bob-devel
.. _bob.bio.base: https://pypi.python.org/pypi/bob.bio.base .. _bob.bio.base: https://pypi.python.org/pypi/bob.bio.base
...@@ -32,18 +32,19 @@ class Database(BioDatabase): ...@@ -32,18 +32,19 @@ class Database(BioDatabase):
super(Database, self).__init__(name='utfvp', **kwargs) super(Database, self).__init__(name='utfvp', **kwargs)
from bob.db.utfvp.query import Database as LowLevelDatabase from bob.db.utfvp.query import Database as LowLevelDatabase
self.__db = LowLevelDatabase() self._db = LowLevelDatabase()
def model_ids_with_protocol(self, groups=None, protocol=None, **kwargs): def model_ids_with_protocol(self, groups=None, protocol=None, **kwargs):
protocol = protocol if protocol is not None else self.protocol protocol = protocol if protocol is not None else self.protocol
return self.__db.model_ids(groups=groups, protocol=protocol) return self._db.model_ids(groups=groups, protocol=protocol)
def objects(self, groups=None, protocol=None, purposes=None, def objects(self, groups=None, protocol=None, purposes=None,
model_ids=None, **kwargs): model_ids=None, **kwargs):
retval = self.__db.objects(groups=groups, protocol=protocol, retval = self._db.objects(groups=groups, protocol=protocol,
purposes=purposes, model_ids=model_ids, **kwargs) purposes=purposes, model_ids=model_ids, **kwargs)
return [File(f) for f in retval] return [File(f) for f in retval]
def annotations(self, file):
return None
...@@ -23,7 +23,6 @@ class File(BioFile): ...@@ -23,7 +23,6 @@ class File(BioFile):
file_id=f.id) file_id=f.id)
self.__f = f self.__f = f
def mask(self): def mask(self):
"""Returns the binary mask from the ROI annotations available""" """Returns the binary mask from the ROI annotations available"""
...@@ -32,7 +31,6 @@ class File(BioFile): ...@@ -32,7 +31,6 @@ class File(BioFile):
# The size of images in this database is (250, 665) pixels (h, w) # The size of images in this database is (250, 665) pixels (h, w)
return poly_to_mask((250, 665), self.__f.roi()) return poly_to_mask((250, 665), self.__f.roi())
def load(self, *args, **kwargs): def load(self, *args, **kwargs):
"""(Overrides base method) Loads both image and mask""" """(Overrides base method) Loads both image and mask"""
...@@ -41,7 +39,6 @@ class File(BioFile): ...@@ -41,7 +39,6 @@ class File(BioFile):
return image, self.mask() return image, self.mask()
class Database(BioDatabase): class Database(BioDatabase):
""" """
Implements verification API for querying Vera Fingervein database. Implements verification API for querying Vera Fingervein database.
...@@ -51,37 +48,36 @@ class Database(BioDatabase): ...@@ -51,37 +48,36 @@ class Database(BioDatabase):
super(Database, self).__init__(name='verafinger', **kwargs) super(Database, self).__init__(name='verafinger', **kwargs)
from bob.db.verafinger.query import Database as LowLevelDatabase from bob.db.verafinger.query import Database as LowLevelDatabase
self.__db = LowLevelDatabase() self._db = LowLevelDatabase()
self.low_level_group_names = ('train', 'dev') self.low_level_group_names = ('train', 'dev')
self.high_level_group_names = ('world', 'dev') self.high_level_group_names = ('world', 'dev')
def groups(self): def groups(self):
return self.convert_names_to_highlevel(self.__db.groups(), return self.convert_names_to_highlevel(self._db.groups(),
self.low_level_group_names, self.high_level_group_names) self.low_level_group_names, self.high_level_group_names)
def client_id_from_model_id(self, model_id, group='dev'): def client_id_from_model_id(self, model_id, group='dev'):
"""Required as ``model_id != client_id`` on this database""" """Required as ``model_id != client_id`` on this database"""
return self.__db.finger_name_from_model_id(model_id) return self._db.finger_name_from_model_id(model_id)
def model_ids_with_protocol(self, groups=None, protocol=None, **kwargs): def model_ids_with_protocol(self, groups=None, protocol=None, **kwargs):
groups = self.convert_names_to_lowlevel(groups, groups = self.convert_names_to_lowlevel(groups,
self.low_level_group_names, self.high_level_group_names) self.low_level_group_names, self.high_level_group_names)
return self.__db.model_ids(groups=groups, protocol=protocol) return self._db.model_ids(groups=groups, protocol=protocol)
def objects(self, groups=None, protocol=None, purposes=None, def objects(self, groups=None, protocol=None, purposes=None,
model_ids=None, **kwargs): model_ids=None, **kwargs):
groups = self.convert_names_to_lowlevel(groups, groups = self.convert_names_to_lowlevel(groups,
self.low_level_group_names, self.high_level_group_names) self.low_level_group_names, self.high_level_group_names)
retval = self.__db.objects(groups=groups, protocol=protocol, retval = self._db.objects(groups=groups, protocol=protocol,
purposes=purposes, model_ids=model_ids, **kwargs) purposes=purposes, model_ids=model_ids, **kwargs)
return [File(f) for f in retval] return [File(f) for f in retval]
def annotations(self, file):
return None
python
bob.db.base
...@@ -5,12 +5,7 @@ ...@@ -5,12 +5,7 @@
.. This file contains all links we use for documentation in a centralized place .. This file contains all links we use for documentation in a centralized place
.. _idiap: http://www.idiap.ch .. _idiap: http://www.idiap.ch
.. _github: http://www.github.com/idiap
.. _bob: http://www.idiap.ch/software/bob .. _bob: http://www.idiap.ch/software/bob
.. _github bug reporting system: http://github.com/bioidiap/fingervein/issues
.. _idiap at github: http://www.github.com/bioidiap
.. _bob's github page: http://idiap.github.com/bob
.. _gridtk: http://github.com/idiap/gridtk
.. _buildout: http://www.buildout.org .. _buildout: http://www.buildout.org
.. _nist: http://www.nist.gov/itl/iad/ig/focs.cfm .. _nist: http://www.nist.gov/itl/iad/ig/focs.cfm
.. _pypi: http://pypi.python.org .. _pypi: http://pypi.python.org
...@@ -20,7 +15,7 @@ ...@@ -20,7 +15,7 @@
.. _vera fingervein: https://www.idiap.ch/dataset/vera-fingervein .. _vera fingervein: https://www.idiap.ch/dataset/vera-fingervein
.. _utfvp: http://scs.ewi.utwente.nl/downloads/show,Finger%20Vein/ .. _utfvp: http://scs.ewi.utwente.nl/downloads/show,Finger%20Vein/
.. _put: http://biometrics.put.poznan.pl/vein-dataset/ .. _put: http://biometrics.put.poznan.pl/vein-dataset/
.. _installation: https://gitlab.idiap.ch/bob/bob/wikis/Installation .. _installation: https://www.idiap.ch/software/bob/install
.. _dependencies: https://gitlab.idiap.ch/bob/bob/wikis/Dependencies .. _dependencies: https://gitlab.idiap.ch/bob/bob/wikis/Dependencies
.. _mailing list: https://groups.google.com/forum/?fromgroups#!forum/bob-devel .. _mailing list: https://groups.google.com/forum/?fromgroups#!forum/bob-devel
.. _bob.bio.base: https://pypi.python.org/pypi/bob.bio.base .. _bob.bio.base: https://pypi.python.org/pypi/bob.bio.base
......
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