Coverage for src/bob/bio/face/database/mobio.py: 100%

14 statements  

« prev     ^ index     » next       coverage.py v7.6.0, created at 2024-07-13 00:04 +0200

1#!/usr/bin/env python 

2# vim: set fileencoding=utf-8 : 

3# Tiago de Freitas Pereira <tiago.pereira@idiap.ch> 

4 

5""" 

6 MOBIO database implementation 

7""" 

8 

9from clapper.rc import UserDefaults 

10from sklearn.pipeline import make_pipeline 

11 

12import bob.io.base 

13 

14from bob.bio.base.database import CSVDatabase, FileSampleLoader 

15from bob.bio.face.database.sample_loaders import EyesAnnotations 

16 

17rc = UserDefaults("bobrc.toml") 

18 

19 

20class MobioDatabase(CSVDatabase): 

21 """ 

22 The MOBIO dataset is a video database containing bimodal data (face/speaker). 

23 It is composed by 152 people (split in the two genders male and female), mostly Europeans, split in 5 sessions (few weeks time lapse between sessions). 

24 The database was recorded using two types of mobile devices: mobile phones (NOKIA N93i) and laptop 

25 computers(standard 2008 MacBook). 

26 

27 For face recognition images are used instead of videos. 

28 One image was extracted from each video by choosing the video frame after 10 seconds. 

29 The eye positions were manually labelled and distributed with the database. 

30 

31 

32 .. warning:: 

33 

34 To use this dataset protocol, you need to have the original files of the Mobio dataset. 

35 Once you have it downloaded, please run the following command to set the path for Bob 

36 

37 .. code-block:: sh 

38 

39 bob config set bob.db.mobio.directory [MOBIO PATH] 

40 

41 For more information check: 

42 

43 .. code-block:: latex 

44 

45 @article{McCool_IET_BMT_2013, 

46 title = {Session variability modelling for face authentication}, 

47 author = {McCool, Chris and Wallace, Roy and McLaren, Mitchell and El Shafey, Laurent and Marcel, S{\'{e}}bastien}, 

48 month = sep, 

49 journal = {IET Biometrics}, 

50 volume = {2}, 

51 number = {3}, 

52 year = {2013}, 

53 pages = {117-129}, 

54 issn = {2047-4938}, 

55 doi = {10.1049/iet-bmt.2012.0059}, 

56 } 

57 

58 """ 

59 

60 name = "mobio" 

61 category = "face" 

62 dataset_protocols_name = "mobio.tar.gz" 

63 dataset_protocols_urls = [ 

64 "https://www.idiap.ch/software/bob/databases/latest/face/mobio-0580d95a.tar.gz", 

65 "http://www.idiap.ch/software/bob/databases/latest/face/mobio-0580d95a.tar.gz", 

66 ] 

67 dataset_protocols_hash = "0580d95a" 

68 

69 def __init__( 

70 self, 

71 protocol, 

72 annotation_type="eyes-center", 

73 fixed_positions=None, 

74 dataset_original_directory=rc.get("bob.db.mobio.directory", ""), 

75 dataset_original_extension=rc.get("bob.db.mobio.extension", ".png"), 

76 ): 

77 super().__init__( 

78 name=self.name, 

79 protocol=protocol, 

80 transformer=make_pipeline( 

81 FileSampleLoader( 

82 data_loader=bob.io.base.load, 

83 dataset_original_directory=dataset_original_directory, 

84 extension=dataset_original_extension, 

85 ), 

86 EyesAnnotations(), 

87 ), 

88 templates_metadata=["gender"], 

89 annotation_type=annotation_type, 

90 fixed_positions=fixed_positions, 

91 )