Coverage for src/bob/bio/face/database/scface.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# Laurent Colbois <laurent.colbois@idiap.ch> 

4 

5""" 

6 SCFace 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 SCFaceDatabase(CSVDatabase): 

21 """ 

22 Surveillance Camera Face dataset 

23 

24 SCface is a database of static images of human faces.\ 

25 Images were taken in uncontrolled indoor environment using five video surveillance cameras of various qualities. 

26 Database contains 4160 static images (in visible and infrared spectrum) of 130 subjects. 

27 Images from different quality cameras mimic the real-world conditions and enable robust face recognition algorithms testing, emphasizing different 

28 law enforcement and surveillance use case scenarios. 

29 

30 """ 

31 

32 name = "scface" 

33 category = "face" 

34 dataset_protocols_name = "scface.tar.gz" 

35 dataset_protocols_urls = [ 

36 "https://www.idiap.ch/software/bob/databases/latest/face/scface-e6ffa822.tar.gz", 

37 "http://www.idiap.ch/software/bob/databases/latest/face/scface-e6ffa822.tar.gz", 

38 ] 

39 dataset_protocols_hash = "e6ffa822" 

40 

41 def __init__( 

42 self, protocol, annotation_type="eyes-center", fixed_positions=None 

43 ): 

44 super().__init__( 

45 name=self.name, 

46 protocol=protocol, 

47 transformer=make_pipeline( 

48 FileSampleLoader( 

49 data_loader=bob.io.base.load, 

50 dataset_original_directory=rc.get( 

51 "bob.bio.face.scface.directory", "" 

52 ), 

53 extension=rc.get("bob.bio.face.scface.extension", ""), 

54 ), 

55 EyesAnnotations(), 

56 ), 

57 annotation_type=annotation_type, 

58 fixed_positions=fixed_positions, 

59 score_all_vs_all=True, 

60 )