Skip to content
Snippets Groups Projects
Commit 192eb5af authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Make verafinger file load both image and mask from annotations

parent e0efe30b
No related branches found
No related tags found
1 merge request!18Simplifications
......@@ -24,14 +24,23 @@ class File(BioFile):
self.__f = f
def roi(self):
def mask(self):
"""Returns the binary mask from the ROI annotations available"""
from ..preprocessor.utils import poly_to_mask
# The size of images in this database is (250, 665) pixels (h, w)
return poly_to_mask((250, 665), self.__f.roi())
def load(self, *args, **kwargs):
"""(Overrides base method) Loads both image and mask"""
image = super(File, self).load(*args, **kwargs)
return image, self.mask()
class Database(BioDatabase):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment