This FastAPI-based service provides an endpoint for classifying whether uploaded photos satisfy a given task using Claude AI. It accepts a list of image files along with a task description and returns a JSON response with classification results.
- ✅ Accepts multiple image uploads for classification
- 🔍 Uses Claude AI to analyze photos against a given task
- 📡 FastAPI-based for lightweight and scalable deployment
- 📤 Returns structured JSON response with classification results and reasoning
- Python 3.8+
- FastAPI
- Uvicorn
# Clone the repository (if applicable)
git clone https://github.com/your-repo/photo-verification-api.git
cd photo-verification-api
# Install dependencies
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
The API will be available at http://localhost:8000
.
Endpoint: POST /classify-photos/
Description: Classifies if the uploaded photos meet the specified task requirements using Claude AI.
Parameter | Type | Description |
---|---|---|
task |
string |
Description of what the photos should show/contain |
photos |
List[UploadFile] |
List of image files to classify |
curl -X 'POST' \
'http://localhost:8000/classify-photos/' \
-F 'task="Show a sunset over the ocean"' \
-F '[email protected]' \
-F '[email protected]'
{
"success": true,
"reason": "The uploaded photos clearly depict a sunset over the ocean."
}
.
├── main.py # FastAPI app entry point
├── services/
│ ├── classification_service.py # Handles photo classification logic
├── schemas.py # Defines request and response schemas
├── requirements.txt # Dependencies
└── README.md # API Documentation
MIT License - see the LICENSE
file for details.
Contributions are welcome! Please submit a pull request with any improvements.
For questions or issues, open an issue on GitHub or contact the maintainer.