コード例 #1
0
ファイル: test_image_processor.py プロジェクト: APSL/remotecv
 def test_with_multiple_detectors(self):
     image_processor = ImageProcessor()
     detect = image_processor.detect(
         'face+profile+glass',
         read_fixture('one_face.gif')
     )
     expect(detect).Not.to_be_empty()
コード例 #2
0
ファイル: pyres_tasks.py プロジェクト: lunsher/remotecv
class DetectTask:
    queue = "Detect"
    processor = ImageProcessor()

    @classmethod
    def perform(clz, detection_type, image_path, key):
        image_data = config.loader.load_sync(image_path)
        points = clz.processor.detect(detection_type, image_data)
        result_store = ResultStore(clz.resq.redis)
        result_store.store(key, points)
コード例 #3
0
class DetectTask:
    queue = "Detect"
    processor = ImageProcessor()

    @classmethod
    def perform(cls, detection_type, image_path, key):
        logger.info("Detecting %s for %s", detection_type, image_path)
        image_data = config.loader.load_sync(image_path)
        points = cls.processor.detect(detection_type, image_data)
        result_store = config.store.ResultStore(config)
        result_store.store(key, points)
コード例 #4
0
 def test_when_not_animated_gif(self):
     image_processor = ImageProcessor()
     detect = image_processor.detect('face', read_fixture('one_face.gif'))
     expect(detect).Not.to_be_empty()
コード例 #5
0
 def test_with_multiple_detectors(self):
     image_processor = ImageProcessor()
     detect = image_processor.detect('face+profile+glass',
                                     read_fixture('one_face.gif'))
     expect(detect).Not.to_be_empty()
コード例 #6
0
 def test_when_image_is_huge(self):
     image_processor = ImageProcessor()
     detect = image_processor.detect('all', read_fixture('huge_image.jpg'))
     expect(detect).Not.to_be_empty()
コード例 #7
0
 def test_when_detector_unavailable(self):
     image_processor = ImageProcessor()
     image_processor.detect('feat', read_fixture('broken.jpg'))
コード例 #8
0
ファイル: test_image_processor.py プロジェクト: APSL/remotecv
 def test_when_image_is_huge(self):
     image_processor = ImageProcessor()
     detect = image_processor.detect('all', read_fixture('huge_image.jpg'))
     expect(detect).Not.to_be_empty()
コード例 #9
0
 def topic(self):
     image_processor = ImageProcessor()
     return image_processor.detect('feat', read_fixture('broken.jpg'))
コード例 #10
0
 def test_should_be_empty_when_invalid_image(self):
     image_processor = ImageProcessor()
     detect = image_processor.detect('all', 'asdas')
     expect(detect).to_be_empty()
コード例 #11
0
ファイル: test_image_processor.py プロジェクト: APSL/remotecv
 def test_should_ignore_gif(self):
     image_processor = ImageProcessor()
     detect = image_processor.detect('all', 'asdas')
     expect(detect).to_be_empty()
コード例 #12
0
ファイル: test_image_processor.py プロジェクト: APSL/remotecv
 def test_should_be_empty_when_invalid_image(self):
     image_processor = ImageProcessor()
     detect = image_processor.detect('all', 'asdas')
     expect(detect).to_be_empty()
コード例 #13
0
ファイル: test_image_processor.py プロジェクト: APSL/remotecv
 def test_feature_detection(self):
     image_processor = ImageProcessor()
     detect = image_processor.detect('feature', read_fixture('broken.jpg'))
     expect(detect).Not.to_be_empty()
コード例 #14
0
ファイル: test_image_processor.py プロジェクト: APSL/remotecv
 def test_when_animated_gif(self):
     image_processor = ImageProcessor()
     detect = image_processor.detect('all', read_fixture('animated.gif'))
     expect(detect).to_be_empty()
コード例 #15
0
ファイル: test_image_processor.py プロジェクト: APSL/remotecv
 def test_when_not_animated_gif(self):
     image_processor = ImageProcessor()
     detect = image_processor.detect('face', read_fixture('one_face.gif'))
     expect(detect).Not.to_be_empty()
コード例 #16
0
 def test_when_animated_gif(self):
     image_processor = ImageProcessor()
     detect = image_processor.detect('all', read_fixture('animated.gif'))
     expect(detect).to_be_empty()
コード例 #17
0
 def test_feature_detection(self):
     image_processor = ImageProcessor()
     detect = image_processor.detect('feature', read_fixture('broken.jpg'))
     expect(detect).Not.to_be_empty()
コード例 #18
0
 def test_feature_detection(self):
     image_processor = ImageProcessor()
     detect = image_processor.detect("feature",
                                     read_fixture("one_face.jpg"))
     expect(detect).Not.to_be_empty()
コード例 #19
0
 def test_should_ignore_gif(self):
     image_processor = ImageProcessor()
     detect = image_processor.detect('all', 'asdas')
     expect(detect).to_be_empty()
コード例 #20
0
 def test_when_detector_unavailable(self):
     image_processor = ImageProcessor()
     with expect.error_to_happen(AttributeError):
         image_processor.detect("feat", read_fixture("broken.jpg"))
コード例 #21
0
 def topic(self):
     image_processor = ImageProcessor()
     for detector in ['all', 'face', 'feature', 'glass', 'profile']:
         yield image_processor.detect(detector, read_fixture('broken.jpg'))
コード例 #22
0
ファイル: test_image_processor.py プロジェクト: APSL/remotecv
 def test_when_detector_unavailable(self):
     image_processor = ImageProcessor()
     image_processor.detect('feat', read_fixture('broken.jpg'))