Servicio FastAPI que detecta y corrige automáticamente la rotación de imágenes usando OCR.
- Detecta orientación de texto en imágenes
- Corrige automáticamente imágenes rotadas (90°, 180°, 270°)
- Mantiene el formato original (JPG, PNG, etc.)
- API REST simple
- Python 3.11+
- Tesseract OCR
pip install -r requirements.txtuvicorn app.main:app --reloaddocker-compose up --buildSube una imagen y recibe la versión corregida.
Ejemplo con curl (PowerShell):
curl.exe -X POST "http://localhost:8000/fix_rotation" -F "file=@data/froga_2.png" --output data/froga_2_fixed.pngEjemplo con curl (Bash):
curl -X POST "http://localhost:8000/fix_rotation" \
-F "file=@data/froga_2.png" \
--output data/froga_2_fixed.pngVer headers de respuesta:
curl.exe -X POST "http://localhost:8000/fix_rotation" -F "file=@data/froga_2.png" -i --output data/froga_2_fixed.pngHeaders de respuesta:
X-Rotation-Applied: Grados de rotación aplicados (0, 90, 180, 270)
Verifica el estado del servicio.
curl http://localhost:8000/healthMAX_UPLOAD_SIZE: Tamaño máximo de archivo en bytes (default: 10MB)
img_biratu/
├── app/
│ └── main.py # Aplicación FastAPI
├── data/ # Imágenes de prueba
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── README.md