Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -43,7 +43,8 @@ def generate_mesh(image_path:str,
|
|
43 |
input_folder:str=None,
|
44 |
output_folder:str=None,
|
45 |
input_s3_id:str='input_image.png',
|
46 |
-
output_s3_id:str='output_mesh.obj'
|
|
|
47 |
) -> Tuple[Optional[str], Optional[str]] :
|
48 |
|
49 |
print('Process start')
|
@@ -76,11 +77,18 @@ def generate_mesh(image_path:str,
|
|
76 |
output_s3_key = output_folder + '/' + output_s3_id
|
77 |
else:
|
78 |
output_s3_key = output_s3_id
|
79 |
-
|
80 |
|
81 |
input_s3_url = upload_to_s3(image_path, bucket_name, input_s3_key)
|
82 |
output_s3_url = upload_to_s3(output_file_path, bucket_name, output_s3_key)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
|
84 |
-
print(f'Files uploaded to S3:\nInput Image: {input_s3_url}\nOutput Mesh: {output_s3_url}')
|
85 |
|
86 |
return output_file_path ,output_video_path
|
|
|
43 |
input_folder:str=None,
|
44 |
output_folder:str=None,
|
45 |
input_s3_id:str='input_image.png',
|
46 |
+
output_s3_id:str='output_mesh.obj',
|
47 |
+
output_video_s3_id:str=None
|
48 |
) -> Tuple[Optional[str], Optional[str]] :
|
49 |
|
50 |
print('Process start')
|
|
|
77 |
output_s3_key = output_folder + '/' + output_s3_id
|
78 |
else:
|
79 |
output_s3_key = output_s3_id
|
80 |
+
output_video_s3_key = output_video_s3_id
|
81 |
|
82 |
input_s3_url = upload_to_s3(image_path, bucket_name, input_s3_key)
|
83 |
output_s3_url = upload_to_s3(output_file_path, bucket_name, output_s3_key)
|
84 |
+
|
85 |
+
if output_video_path != None:
|
86 |
+
if output_folder != None:
|
87 |
+
output_video_s3_key = output_folder + '/' + output_video_s3_id
|
88 |
+
else:
|
89 |
+
output_video_s3_key = output_video_s3_id
|
90 |
+
output_video_s3_url = upload_to_s3(output_video_path, bucket_name, output_video_s3_key)
|
91 |
|
92 |
+
print(f'Files uploaded to S3:\nInput Image: {input_s3_url}\nOutput Mesh: {output_s3_url}\nOutput Video: {output_video_s3_url}')
|
93 |
|
94 |
return output_file_path ,output_video_path
|