captcha.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:CAPTCHA_Identifier 作者: AlphaLFC 项目源码 文件源码
def __init__(self, image_set, devkit_path):
        imdb.__init__(self, image_set)
        self._image_set = image_set
        self._devkit_path = devkit_path
        self._data_path = self._devkit_path  # yeah!
        self._classes = tuple(['__background__'] +  # always index 0
                              list(string.digits + string.lowercase +
                                   string.uppercase))
        self._class_to_idx = dict(zip(self.classes,
                                      xrange(self.num_classes)))
        self._image_ext = ['.jpg', '.png']
        self._image_index = self._load_image_set_index()
        self._salt = str(uuid.uuid4())
        self._comp_id = 'comp4'

        self.config = {'cleanup': True,
                       'use_salt': True,
                       'top_k': 2000,
                       'use_diff': False,
                       'rpn_file': None}
        assert os.path.exists(self._devkit_path), \
            'Devkit path does not exist: {}'.format(self._devkit_path)
        assert os.path.exists(self._data_path), \
            'Path does not exist: {}'.format(self._data_path)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号