PHPackages                             phpcfdi/image-captcha-resolver-boxfactura-ai - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. phpcfdi/image-captcha-resolver-boxfactura-ai

ActiveLibrary

phpcfdi/image-captcha-resolver-boxfactura-ai
============================================

Resolución de captchas del SAT usando Inteligencia Artificial

v0.2.0(8mo ago)84.4k—2.5%41MITPHPPHP ^8.2CI failing

Since Oct 3Pushed 8mo ago4 watchersCompare

[ Source](https://github.com/phpcfdi/image-captcha-resolver-boxfactura-ai)[ Packagist](https://packagist.org/packages/phpcfdi/image-captcha-resolver-boxfactura-ai)[ Docs](https://github.com/phpcfdi/image-captcha-resolver-boxfactura-ai)[ RSS](/packages/phpcfdi-image-captcha-resolver-boxfactura-ai/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (1)

phpcfdi/image-captcha-resolver-boxfactura-ai
============================================

[](#phpcfdiimage-captcha-resolver-boxfactura-ai)

[![Source Code](https://camo.githubusercontent.com/4a4efe67898be23f983057ba2b125e144378cc6eac6718783c132812641b25fa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d706870636664692f696d6167652d2d636170746368612d2d7265736f6c7665722d2d626f78666163747572612d2d61692d626c75653f6c6f676f3d676974687562)](https://github.com/phpcfdi/image-captcha-resolver-boxfactura-ai)[![Packagist PHP Version Support](https://camo.githubusercontent.com/7000f83356b5b20e8862cbfbb281530eb3b239b6aa0776743701646faf45ca28/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f706870636664692f696d6167652d636170746368612d7265736f6c7665722d626f78666163747572612d61693f6c6f676f3d706870)](https://packagist.org/packages/phpcfdi/image-captcha-resolver-boxfactura-ai)[![Discord](https://camo.githubusercontent.com/e7d280832b4bb781e0e83dc7b04440636ea6a67d076133da0938b79caab9d6dd/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3435393836303535343039303238333031393f6c6f676f3d646973636f7264)](https://discord.gg/aFGYXvX)[![Latest Version](https://camo.githubusercontent.com/f0f199501876f101161f3b181e0519a4449e9de0dd1dd6f534a70eae33f2a39d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f706870636664692f696d6167652d636170746368612d7265736f6c7665722d626f78666163747572612d61693f6c6f676f3d676974)](https://github.com/phpcfdi/image-captcha-resolver-boxfactura-ai/releases)[![Software License](https://camo.githubusercontent.com/9da0887929184036af2fdce4bef136ca349be886ac27b6a5b3d01dea17f0f83b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f706870636664692f696d6167652d636170746368612d7265736f6c7665722d626f78666163747572612d61693f6c6f676f3d6f70656e2d736f757263652d696e6974696174697665)](https://github.com/phpcfdi/image-captcha-resolver-boxfactura-ai/blob/main/LICENSE)[![Build Status](https://camo.githubusercontent.com/497b87bc6ff26709d75a92505f740fb7dee191068e64e1466686315e5b23b33b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f706870636664692f696d6167652d636170746368612d7265736f6c7665722d626f78666163747572612d61692f6275696c642e796d6c3f6272616e63683d6d61696e266c6f676f3d6769746875622d616374696f6e73)](https://github.com/phpcfdi/image-captcha-resolver-boxfactura-ai/actions/workflows/build.yml?query=branch:main)[![Reliability](https://camo.githubusercontent.com/cc43288f5039463bda2b50ef01f2055d1c790b56659a94d9b481e3066c2464ac/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d706870636664695f696d6167652d636170746368612d7265736f6c7665722d626f78666163747572612d6169266d65747269633d72656c696162696c6974795f726174696e67)](https://sonarcloud.io/component_measures?id=phpcfdi_image-captcha-resolver-boxfactura-ai&metric=Reliability)[![Maintainability](https://camo.githubusercontent.com/e9361b412a4759c69ef85ecb4f3f333c5f1daf6432a70c7e335166e273abf3fe/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d706870636664695f696d6167652d636170746368612d7265736f6c7665722d626f78666163747572612d6169266d65747269633d7371616c655f726174696e67)](https://sonarcloud.io/component_measures?id=phpcfdi_image-captcha-resolver-boxfactura-ai&metric=Maintainability)[![Code Coverage](https://camo.githubusercontent.com/46c5d55e3eb06f27a73092c9048196e7f3b38da0393c58f331f49feb87638d1b/68747470733a2f2f696d672e736869656c64732e696f2f736f6e61722f636f7665726167652f706870636664695f696d6167652d636170746368612d7265736f6c7665722d626f78666163747572612d61692f6d61696e3f6c6f676f3d736f6e617271756265636c6f7564267365727665723d6874747073253341253246253246736f6e6172636c6f75642e696f)](https://sonarcloud.io/component_measures?id=phpcfdi_image-captcha-resolver-boxfactura-ai&metric=Coverage)[![Violations](https://camo.githubusercontent.com/aa31de924793c29debbfda13a12559ce51a88b65890438d300a39853eed88d1e/68747470733a2f2f696d672e736869656c64732e696f2f736f6e61722f76696f6c6174696f6e732f706870636664695f696d6167652d636170746368612d7265736f6c7665722d626f78666163747572612d61692f6d61696e3f666f726d61743d6c6f6e67266c6f676f3d736f6e617271756265636c6f7564267365727665723d6874747073253341253246253246736f6e6172636c6f75642e696f)](https://sonarcloud.io/project/issues?id=phpcfdi_image-captcha-resolver-boxfactura-ai&resolved=false)[![Total Downloads](https://camo.githubusercontent.com/54d41d690a024450dc73635a323ce85f5d451003087079b79ca261fd47049909/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706870636664692f696d6167652d636170746368612d7265736f6c7665722d626f78666163747572612d61693f6c6f676f3d7061636b6167697374)](https://packagist.org/packages/phpcfdi/image-captcha-resolver-boxfactura-ai)

> Resolución de captchas del SAT usando Inteligencia Artificial

🇺🇸 The documentation of this project is in spanish as this is the natural language for the intended audience.

Acerca de
---------

[](#acerca-de)

Esta librería permite resolver captchas del SAT usando un modelo Onnx de Inteligencia Artificial. El modelo de AI está basado en [Onnx](https://onnx.ai/) y ha sido alimentado con los captchas de tipo mancha de color.

[![captcha sample](tests/_files/BK22PD.png)](tests/_files/BK22PD.png)

El modelo ha sido entrenado por [BOX Factura](https://www.boxfactura.com/) y se encuentra disponible en el repositorio [`BoxFactura/sat-captcha-ai-model`](https://github.com/BoxFactura/sat-captcha-ai-model).

Esta implementación está directamente relacionada con [`phpcfdi/image-captcha-resolver`](https://github.com/phpcfdi/image-captcha-resolver)al tratarse de un resolvedor adicional para este proyecto.

Instalación
-----------

[](#instalación)

Usa [composer](https://getcomposer.org/)

```
composer require phpcfdi/image-captcha-resolver-boxfactura-ai
```

### Instalación del modelo

[](#instalación-del-modelo)

El modelo que permite resolver los captchas se encuentra en el proyecto [`BoxFactura/sat-captcha-ai-model`](https://github.com/BoxFactura/sat-captcha-ai-model). En este repositorio está el script de *BASH* `bin/download-model` que descarga los archivos necesarios.

El siguiente comando instala el modelo en el directorio `storage/sat-captcha-ai-model`.

```
bin/download-model storage/sat-captcha-ai-model
```

Ejemplos de uso
---------------

[](#ejemplos-de-uso)

### Resolver un captcha con `phpcfdi/image-captcha-resolver`

[](#resolver-un-captcha-con-phpcfdiimage-captcha-resolver)

Para este ejemplo se asume que la imagen del captcha se encuentra como imagen embedida y su contenido en `$theImgElementSrcAtributte`. También asume que el archivo de configuraciones del modelo está en `storage/sat-captcha-ai-model/configs.yaml`.

```
