Update app.py
Browse files
app.py
CHANGED
|
@@ -30,6 +30,8 @@ from fastapi import FastAPI, File, UploadFile, HTTPException
|
|
| 30 |
from fastapi.responses import JSONResponse
|
| 31 |
import datetime
|
| 32 |
import tempfile
|
|
|
|
|
|
|
| 33 |
|
| 34 |
|
| 35 |
app = FastAPI()
|
|
@@ -280,7 +282,8 @@ async def upload_image(file: UploadFile = File(...)):
|
|
| 280 |
obj_file_path = step_1_generate_obj(image)
|
| 281 |
|
| 282 |
# Generate a unique name for the S3 object
|
| 283 |
-
|
|
|
|
| 284 |
|
| 285 |
# Upload the OBJ file to S3
|
| 286 |
s3_url = upload_file_to_s3(obj_file_path, 'framebucket3d', obj_name)
|
|
|
|
| 30 |
from fastapi.responses import JSONResponse
|
| 31 |
import datetime
|
| 32 |
import tempfile
|
| 33 |
+
import time
|
| 34 |
+
|
| 35 |
|
| 36 |
|
| 37 |
app = FastAPI()
|
|
|
|
| 282 |
obj_file_path = step_1_generate_obj(image)
|
| 283 |
|
| 284 |
# Generate a unique name for the S3 object
|
| 285 |
+
timestamp = int(time.time())
|
| 286 |
+
obj_name = f"object{timestamp}.obj"
|
| 287 |
|
| 288 |
# Upload the OBJ file to S3
|
| 289 |
s3_url = upload_file_to_s3(obj_file_path, 'framebucket3d', obj_name)
|