File size: 504 Bytes
1795a1a
889642a
1795a1a
889642a
 
 
 
 
1795a1a
889642a
 
1795a1a
889642a
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
@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
        )