Exemplo n.º 1
0
 def test_should_run_on_cmyk_images(self):
     detection_result = FaceDetector().detect(
         create_image("one_face_cmyk.jpg"))
     expect(detection_result[0][0]).to_be_numeric()
     expect(detection_result[0][1]).to_be_numeric()
     expect(detection_result[0][2]).to_be_numeric()
     expect(detection_result[0][3]).to_be_numeric()
Exemplo n.º 2
0
 def test_should_detect_one_face(self):
     detection_result = ProfileDetector().detect(create_image('profile_face.jpg'))
     expect(detection_result).to_length(1)
     expect(detection_result[0][0]).to_be_numeric()
     expect(detection_result[0][1]).to_be_numeric()
     expect(detection_result[0][2]).to_be_numeric()
     expect(detection_result[0][3]).to_be_numeric()
Exemplo n.º 3
0
 def test_should_detect_something(self):
     detection_result = CompleteDetector().detect(create_image('profile_face.jpg'))
     expect(detection_result).to_be_greater_than(20)
     expect(detection_result[0][0]).to_be_numeric()
     expect(detection_result[0][1]).to_be_numeric()
     expect(detection_result[0][2]).to_be_numeric()
     expect(detection_result[0][3]).to_be_numeric()
Exemplo n.º 4
0
 def test_should_run_on_grayscale_images(self):
     detection_result = FaceDetector().detect(create_image('multiple_faces_bw.jpg'))
     expect(detection_result).to_be_greater_than(4)
     expect(detection_result[0][0]).to_be_numeric()
     expect(detection_result[0][1]).to_be_numeric()
     expect(detection_result[0][2]).to_be_numeric()
     expect(detection_result[0][3]).to_be_numeric()
Exemplo n.º 5
0
 def test_should_detect_something(self):
     detection_result = CompleteDetector().detect(
         create_image('profile_face.jpg'))
     expect(detection_result).to_be_greater_than(20)
     expect(detection_result[0][0]).to_be_numeric()
     expect(detection_result[0][1]).to_be_numeric()
     expect(detection_result[0][2]).to_be_numeric()
     expect(detection_result[0][3]).to_be_numeric()
Exemplo n.º 6
0
 def test_should_run_on_grayscale_images(self):
     # Group Smile picture - Credit Richard Foster / Flickr Creative Commons
     detection_result = FaceDetector().detect(
         create_image("group-smile-bw.jpg"))
     expect(len(detection_result)).to_be_greater_than(4)
     expect(detection_result[0][0]).to_be_numeric()
     expect(detection_result[0][1]).to_be_numeric()
     expect(detection_result[0][2]).to_be_numeric()
     expect(detection_result[0][3]).to_be_numeric()
Exemplo n.º 7
0
 def test_should_detect_glasses(self):
     detection_result = GlassesDetector().detect(create_image('glasses.jpg'))
     expect(detection_result).to_length(2)
     expect(detection_result[0][0]).to_be_numeric()
     expect(detection_result[0][1]).to_be_numeric()
     expect(detection_result[0][2]).to_be_numeric()
     expect(detection_result[0][3]).to_be_numeric()
     expect(detection_result[1][0]).to_be_numeric()
     expect(detection_result[1][1]).to_be_numeric()
     expect(detection_result[1][2]).to_be_numeric()
     expect(detection_result[1][3]).to_be_numeric()
Exemplo n.º 8
0
 def test_should_detect_glasses(self):
     detection_result = GlassesDetector().detect(
         create_image("glasses.jpg"))
     expect(detection_result).to_length(2)
     expect(detection_result[0][0]).to_be_numeric()
     expect(detection_result[0][1]).to_be_numeric()
     expect(detection_result[0][2]).to_be_numeric()
     expect(detection_result[0][3]).to_be_numeric()
     expect(detection_result[1][0]).to_be_numeric()
     expect(detection_result[1][1]).to_be_numeric()
     expect(detection_result[1][2]).to_be_numeric()
     expect(detection_result[1][3]).to_be_numeric()
Exemplo n.º 9
0
 def test_when_image_is_broken(self):
     im = create_image('broken.jpg')
     expect(im).Not.to_be_null()
     expect(im.size).to_equal((600, 769))
Exemplo n.º 10
0
 def test_should_read_a_psd(self):
     im = create_image('why_not_a.psd')
     expect(im).Not.to_be_null()
     expect(im.size).to_equal((620, 413))
Exemplo n.º 11
0
 def test_when_image_is_pallete(self):
     im = create_image('pallete.png')
     expect(im).Not.to_be_null()
     expect(im.size).to_equal((3317, 2083))
Exemplo n.º 12
0
 def test_when_image_is_broken(self):
     im = create_image('broken.jpg')
     expect(im).Not.to_be_null()
     expect(im.size).to_equal((600, 769))
Exemplo n.º 13
0
 def test_should_not_detect_points(self):
     detection_result = FeatureDetector().detect(create_image("white-block.png"))
     expect(detection_result).to_be_false()
Exemplo n.º 14
0
 def test_should_detect_multiple_points(self):
     detection_result = FeatureDetector().detect(create_image("no_face.jpg"))
     expect(len(detection_result)).to_be_greater_than(4)
Exemplo n.º 15
0
 def test_should_detect_multiple_points(self):
     detection_result = FeatureDetector().detect(create_image('no_face.jpg'))
     expect(detection_result).to_be_greater_than(4)
Exemplo n.º 16
0
 def test_when_image_is_pallete(self):
     im = create_image('pallete.png')
     expect(im).Not.to_be_null()
     expect(im.size).to_equal((3317, 2083))
Exemplo n.º 17
0
 def test_should_not_detect(self):
     detection_result = FaceDetector().detect(create_image('no_face.jpg'))
     expect(detection_result).to_be_empty()
Exemplo n.º 18
0
 def test_should_not_detect_points(self):
     detection_result = FeatureDetector().detect(create_image('white-block.png'))
     expect(detection_result).to_be_false()
Exemplo n.º 19
0
 def test_should_read_a_psd(self):
     im = create_image('why_not_a.psd')
     expect(im).Not.to_be_null()
     expect(im.size).to_equal((620, 413))
Exemplo n.º 20
0
 def test_should_run_on_cmyk_images(self):
     detection_result = FaceDetector().detect(create_image('one_face_cmyk.jpg'))
     expect(detection_result[0][0]).to_be_numeric()
     expect(detection_result[0][1]).to_be_numeric()
     expect(detection_result[0][2]).to_be_numeric()
     expect(detection_result[0][3]).to_be_numeric()
Exemplo n.º 21
0
 def test_should_not_detect(self):
     detection_result = ProfileDetector().detect(create_image('no_face.jpg'))
     expect(detection_result).to_length(0)
Exemplo n.º 22
0
 def test_should_run_on_images_with_alpha(self):
     detection_result = FaceDetector().detect(create_image('one_face.png'))
     expect(detection_result[0][0]).to_be_numeric()
     expect(detection_result[0][1]).to_be_numeric()
     expect(detection_result[0][2]).to_be_numeric()
     expect(detection_result[0][3]).to_be_numeric()