A simple, containerized FastAPI service that uses a trained SVM model to solve 6‑character uppercase CAPTCHA images.
unlock/
├── datasource/
│ └── zeta/
│ └── run.py # decrypt logic for 'zeta' model
├── routes/
│ └── decripto.py # API route definitions
├── schemas/
│ └── decripto.py # Pydantic request schemas
├── services/
│ └── decripto_service.py # dynamic loader for run.py
├── resources/
│ └── tmp/ # saved uploads, renamed as <decoded>.png
├── postman_decripto.json # Postman collection for /decripto
├── main.py # FastAPI app entrypoint
├── docker-compose.yml
└── IaC/
├── fastAPI/
│ └── Dockerfile # FastAPI service image
├── python/
│ └── Dockerfile # Python helper container image
└── requirements.txt # all Python dependencies
-
Build & run all services:
docker compose up --build
-
API docs: Visit
http://localhost:8000/docsfor the interactive Swagger UI. -
MongoDB ping:
GET http://localhost:8000/ping-db
POST /decripto
Accepts JSON with one of:
- `` (Base64 payload)
- `` (link to Base64 string or PNG image)
| Field | Type | Description |
|---|---|---|
modelo |
string | Model folder name under datasource/ (e.g. "zeta") |
type |
string | "base64" or "image" |
content |
string | Optional Base64 string (data:image/png;base64,...) |
url |
string | Optional URL returning Base64 or PNG image |
-
If `` is provided, it is used directly.
-
If `` is provided:
type="base64"→ response body text treated as Base64.type="image"→ response bytes converted to Base64 automatically.
Success response:
{ "resultado": "ABCXYZ" }Import the postman_decripto.json file in Postman:
- File → Import
- Select
postman_decripto.json - Run the provided examples for each scenario.
- Python 3 & FastAPI
- Docker & docker-compose
- Machine Learning: scikit‑learn, scikit‑image, joblib
- CV: opencv‑python‑headless, numpy
- FastAPI: https://fastapi.tiangolo.com/
- Pydantic: https://docs.pydantic.dev/
- Docker Compose: https://docs.docker.com/compose/
- scikit‑image HOG: https://scikit-image.org/