Ported LFW database

Removed useles code from GBU bob/bio/face/config/database/gbu_bad.py bob/bio/face/config/database/gbu_good.py bob/bio/face/config/database/gbu_ugly.py

Rebasing
parent c623b2f6
Pipeline #53585 passed with stage
in 53 minutes and 25 seconds
#!/usr/bin/env python
from bob.bio.face.database import LFWBioDatabase
from bob.bio.base.pipelines.vanilla_biometrics import DatabaseConnector
from bob.extension import rc
lfw_directory = rc["bob.db.lfw.directory"]
database = DatabaseConnector(
LFWBioDatabase(
original_directory=lfw_directory,
annotation_type="funneled",
protocol="view1",
training_depends_on_protocol=True,
models_depend_on_protocol=True,
all_files_options={"world_type": "restricted"},
extractor_training_options={
"world_type": "restricted"
}, # 'subworld' : 'twofolds'
projector_training_options={
"world_type": "restricted"
}, # 'subworld' : 'twofolds'
enroller_training_options={
"world_type": "restricted"
}, # 'subworld' : 'twofolds'
),
allow_scoring_with_all_biometric_references=False,
)
#!/usr/bin/env python
from bob.bio.face.database import LFWBioDatabase
from bob.bio.base.pipelines.vanilla_biometrics import DatabaseConnector
from bob.extension import rc
lfw_directory = rc["bob.db.lfw.directory"]
database = DatabaseConnector(
LFWBioDatabase(
original_directory=lfw_directory,
annotation_type="funneled",
protocol="view1",
training_depends_on_protocol=True,
models_depend_on_protocol=True,
all_files_options={"world_type": "unrestricted"},
extractor_training_options={
"world_type": "unrestricted"
}, # 'subworld' : 'twofolds'
projector_training_options={
"world_type": "unrestricted"
}, # 'subworld' : 'twofolds'
enroller_training_options={
"world_type": "unrestricted"
}, # 'subworld' : 'twofolds'
),
allow_scoring_with_all_biometric_references=False,
)
from bob.bio.face.database import LFWDatabase
database = LFWDatabase(protocol="view2")
......@@ -6,7 +6,8 @@ from .mobio import MobioDatabase
from .replay import ReplayBioDatabase
from .atnt import AtntBioDatabase
from .gbu import GBUDatabase
from .lfw import LFWBioDatabase
from .arface import ARFaceDatabase
from .lfw import LFWDatabase
from .multipie import MultipieDatabase
from .ijbc import IJBCDatabase
from .replaymobile import ReplayMobileBioDatabase
......@@ -46,7 +47,8 @@ __appropriate__(
ReplayBioDatabase,
AtntBioDatabase,
GBUDatabase,
LFWBioDatabase,
ARFaceDatabase,
LFWDatabase,
MultipieDatabase,
ReplayMobileBioDatabase,
FargoBioDatabase,
......
This diff is collapsed.
......@@ -77,41 +77,6 @@ def test_atnt():
)
@db_available("lfw")
def test_lfw():
database = bob.bio.base.load_resource(
"lfw-restricted", "database", preferred_package="bob.bio.face"
)
try:
check_database(database, training_depends=True, models_depend=True)
check_database(
database,
groups=("dev", "eval"),
protocol="fold1",
training_depends=True,
models_depend=True,
)
check_database(
bob.bio.base.load_resource(
"lfw-unrestricted", "database", preferred_package="bob.bio.face"
),
training_depends=True,
models_depend=True,
)
except IOError as e:
pytest.skip(
"The database could not queried; probably the db.sql3 file is missing. Here is the error: '%s'"
% e
)
try:
_check_annotations(database, limit_files=1000)
except IOError as e:
pytest.skip(
"The annotations could not be queried; probably the annotation files are missing. Here is the error: '%s'"
% e
)
def test_mobio():
from bob.bio.face.database import MobioDatabase
......@@ -682,3 +647,19 @@ def test_arface():
references=("sunglasses", "scarf"),
)
@pytest.mark.skipif(
rc.get("bob.bio.face.lfw.directory") is None,
reason="LFW original protocols not available. Please do `bob config set bob.bio.face.gbu.directory [GBU PATH]` to set the GBU data path.",
)
def test_lfw():
from bob.bio.face.database import LFWDatabase
database = LFWDatabase(protocol="view2")
references = database.references()
probes = database.probes()
assert len(references) == 4564
assert len(probes) == 4576
# We need to have 6000 comparisons
assert sum([len(p.references) for p in probes]) == 6000
......@@ -18,7 +18,7 @@ Databases
bob.bio.face.database.ReplayBioDatabase
bob.bio.face.database.ReplayMobileBioDatabase
bob.bio.face.database.GBUDatabase
bob.bio.face.database.LFWBioDatabase
bob.bio.face.database.LFWDatabase
bob.bio.face.database.MultipieDatabase
bob.bio.face.database.FargoBioDatabase
bob.bio.face.database.MEDSDatabase
......
......@@ -119,8 +119,7 @@ setup(
"ijbc-test2 = bob.bio.face.config.database.ijbc_test2:database",
"ijbc-test4-g1 = bob.bio.face.config.database.ijbc_test4_g1:database",
"ijbc-test4-g2 = bob.bio.face.config.database.ijbc_test4_g2:database",
"lfw-restricted = bob.bio.face.config.database.lfw_restricted:database",
"lfw-unrestricted = bob.bio.face.config.database.lfw_unrestricted:database",
"lfw-view2 = bob.bio.face.config.database.lfw_view2:database",
"meds = bob.bio.face.config.database.meds:database",
"mobio-all = bob.bio.face.config.database.mobio_all:database",
"mobio-male = bob.bio.face.config.database.mobio_male:database",
......@@ -203,8 +202,7 @@ setup(
"ijbc-test2 = bob.bio.face.config.database.ijbc_test2",
"ijbc-test4-g1 = bob.bio.face.config.database.ijbc_test4_g1",
"ijbc-test4-g2 = bob.bio.face.config.database.ijbc_test4_g2",
"lfw-restricted = bob.bio.face.config.database.lfw_restricted",
"lfw-unrestricted = bob.bio.face.config.database.lfw_unrestricted",
"lfw-view2 = bob.bio.face.config.database.lfw_view2",
"meds = bob.bio.face.config.database.meds",
"mobio-all = bob.bio.face.config.database.mobio_all",
"mobio-male = bob.bio.face.config.database.mobio_male",
......
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