Pujan-Dev's picture
feat: updated detector using Ela fft and meta
0b8f50d
raw
history blame contribute delete
402 Bytes
from fastapi import HTTPException,File,UploadFile
from .preprocess import preprocess_image
from .inferencer import classify_image
async def Classify_Image_router(file: UploadFile = File(...)):
try:
image_array = preprocess_image(file)
result = classify_image(image_array)
return result
except Exception as e:
raise HTTPException(status_code=400, detail=str(e))