Cropilot is an AI-powered tool for automatically cropping scanned documents.
It provides a web application and backend service that detect document page boundaries, correct orientation, and generate crop instructions for uploaded scans. Cropilot is designed to simplify the processing of large batches of scanned documents by using machine learning models to identify page coordinates and apply rotation correction when needed.
Cropilot combines a FastAPI backend, asynchronous task processing, MongoDB storage, and fine-tuned computer vision models. Uploaded images are processed through a machine learning pipeline that detects page boundaries, determines whether rotation correction is required, and stores the resulting crop metadata.
The backend exposes an API used by the Cropilot frontend and can also be accessed through the separate Cropilot Tools repository.
If you want to self-host, the app can be deployed using Docker Compose or Kubernetes. The production setup includes the backend API, worker, Hatchet queue manager, MongoDB, and frontend services. Cropilot releases are also published as Docker images on Docker Hub under names trinera/smart-crop and trinera/cropilot-frontend.
See the Docker Deployment Guide or Kubernetes Deployment Guide for full setup instructions.
The web UI provides a simple upload interface for image files up to 4 MB. For larger scan batches, Cropilot can also be used through Cropilot Tools: a separate repository of utility scripts that interact with the Cropilot API and support bulk automated workflows.
Cropilot Tools can be used to:
- Upload scan batches to Cropilot editor.
- Crop images using Cropilot-generated instructions.
- Fine-tune custom models for your own document datasets.
Example of bulk image processing workflow using the uploader.py script
See the Cropilot Tools Guide for usage instructions.
Cropilot's crop and rotation models are shared through the open-source Cropilot Community on Hugging Face. You can download ready-to-use models there, or train and publish your own to share with other users. See the community's contributing guide for how to add a model.
Contributing to Cropilot? Check out our Development section.

