from fastapi import FastAPI, File, UploadFile # from depth_est_deprecated import DepthEstimation from depth_est import DepthEstimation import base64 app = FastAPI() @app.get("/") def home(): return {"message":"Hello World"} @app.post("/depth") async def depth(file: UploadFile): file_data = await file.read() encoded_file_data = base64.b64encode(file_data).decode('utf-8') depth_base64 = DepthEstimation(encoded_file_data).run_depth() return {"file_data": depth_base64}