Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,14 +3,14 @@ import tempfile
|
|
3 |
import time
|
4 |
from functools import lru_cache
|
5 |
from typing import Any
|
6 |
-
|
7 |
import gradio as gr
|
8 |
import numpy as np
|
9 |
import rembg
|
10 |
import torch
|
11 |
from gradio_litmodel3d import LitModel3D
|
12 |
from PIL import Image
|
13 |
-
|
14 |
import sf3d.utils as sf3d_utils
|
15 |
from sf3d.system import SF3D
|
16 |
|
@@ -19,6 +19,13 @@ from fastapi.responses import FileResponse
|
|
19 |
|
20 |
import datetime
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
app = FastAPI()
|
23 |
|
24 |
rembg_session = rembg.new_session()
|
@@ -196,7 +203,7 @@ async def process_image(file: UploadFile = File(...), foreground_ratio: float =
|
|
196 |
|
197 |
if upload_file_to_s3(glb_file, 'framebucket3d',object_name):
|
198 |
return {
|
199 |
-
"glb_path": f"https://framebucket3d.s3.amazonaws.com/{
|
200 |
}
|
201 |
|
202 |
if __name__ == "__main__":
|
|
|
3 |
import time
|
4 |
from functools import lru_cache
|
5 |
from typing import Any
|
6 |
+
import boto3
|
7 |
import gradio as gr
|
8 |
import numpy as np
|
9 |
import rembg
|
10 |
import torch
|
11 |
from gradio_litmodel3d import LitModel3D
|
12 |
from PIL import Image
|
13 |
+
from botocore.exceptions import NoCredentialsError, PartialCredentialsError
|
14 |
import sf3d.utils as sf3d_utils
|
15 |
from sf3d.system import SF3D
|
16 |
|
|
|
19 |
|
20 |
import datetime
|
21 |
|
22 |
+
ACCESS = os.getenv("ACCESS")
|
23 |
+
SECRET = os.getenv("SECRET")
|
24 |
+
bedrock = boto3.client(service_name='bedrock', aws_access_key_id = ACCESS, aws_secret_access_key = SECRET, region_name='us-east-1')
|
25 |
+
bedrock_runtime = boto3.client(service_name='bedrock-runtime', aws_access_key_id = ACCESS, aws_secret_access_key = SECRET, region_name='us-east-1')
|
26 |
+
s3_client = boto3.client('s3',aws_access_key_id = ACCESS, aws_secret_access_key = SECRET, region_name='us-east-1')
|
27 |
+
|
28 |
+
|
29 |
app = FastAPI()
|
30 |
|
31 |
rembg_session = rembg.new_session()
|
|
|
203 |
|
204 |
if upload_file_to_s3(glb_file, 'framebucket3d',object_name):
|
205 |
return {
|
206 |
+
"glb_path": f"https://framebucket3d.s3.amazonaws.com/{object_name}"
|
207 |
}
|
208 |
|
209 |
if __name__ == "__main__":
|