Summarization / appImage.py
ikraamkb's picture
Update appImage.py
889642a verified
raw
history blame
504 Bytes
@app.post("/imagecaption/")
async def caption_from_frontend(file: UploadFile = File(...)):
try:
# Process image and generate caption
caption = "This would be your generated image caption"
audio_path = "/files/caption_audio.mp3" # Generated audio path
return {
"answer": caption,
"audio": audio_path
}
except Exception as e:
return JSONResponse(
{"detail": str(e)},
status_code=500
)