-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
25 lines (21 loc) · 859 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from fastapi import FastAPI, File, UploadFile
from typing import List
from services.verification_service import ClassificationService
from schemas import ClassificationRequest, ClassificationResponse
app = FastAPI()
verification_service = ClassificationService()
@app.post("/classify-photos/", response_model=ClassificationResponse)
async def classify_photos(
task: str,
photos: List[UploadFile] = File(...)
) -> ClassificationResponse:
"""
classify if uploaded photos satisfy the given task using Claude
Args:
task: Description of what the photos should show/contain
photos: List of image files to classify
Returns:
JSON response with verification result and reason
"""
request = ClassificationRequest(task=task, photos=photos)
return await verification_service.classify_photos(request)