decrypt
decrypt
decrypt: predict labels for captcha images using a trained CRNN model.
Functions
| Name | Description |
|---|---|
| decrypt | Predict labels for one or more captcha images. |
decrypt
decrypt.decrypt(
files,
model=None,
mask=None,
case_sensitive=True,
length=None,
device=None,
)Predict labels for one or more captcha images.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| files | Union[PathLike, Sequence[PathLike], Captcha] | required | |
| model | Optional[Union[CRNN, str]] | or None. When None, the default unified checkpoint (:data:txtcaptcha.hub.DEFAULT_REPO_ID) is downloaded from the HF Hub on first call and cached thereafter — the cache lives in ~/.cache/huggingface/hub and is shared with every other huggingface_hub user on the machine. |
None |
| mask | MaskType | characters (e.g. ['a','b','c']), a regex character class (e.g. '[0-9a-z]' or '0-9'), or a compiled re.Pattern. |
None |
| case_sensitive | bool | are accepted; output is also lowercased. | True |
| length | Optional[int] | characters. Uses an exact CTC DP over constrained paths — strictly better than greedy when you know the captcha length up-front, since it never emits a wrong-length prediction. Leave as None to use the (variable-length) greedy CTC decoder. |
None |
| device | Optional[Union[str, torch.device]] | None |