Spaces:
Running
Running
| from fastapi import FastAPI, File, UploadFile | |
| # from depth_est_deprecated import DepthEstimation | |
| from depth_est import DepthEstimation | |
| import base64 | |
| app = FastAPI() | |
| def home(): | |
| return {"message":"Hello World"} | |
| 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} |