Spaces:
Running
on
Zero
Running
on
Zero
demo
Browse files
app.py
CHANGED
|
@@ -1,10 +1,17 @@
|
|
| 1 |
-
# Copyright
|
| 2 |
-
# https://github.com/weijielyu/FaceLift
|
| 3 |
#
|
| 4 |
-
#
|
| 5 |
-
#
|
|
|
|
| 6 |
#
|
| 7 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
"""
|
| 10 |
FaceLift: Single Image 3D Face Reconstruction
|
|
@@ -24,9 +31,6 @@ if os.environ.get("HF_HUB_ENABLE_HF_TRANSFER") == "1":
|
|
| 24 |
import json
|
| 25 |
from pathlib import Path
|
| 26 |
from datetime import datetime
|
| 27 |
-
import uuid
|
| 28 |
-
import time
|
| 29 |
-
import shutil
|
| 30 |
|
| 31 |
import gradio as gr
|
| 32 |
import numpy as np
|
|
@@ -325,8 +329,7 @@ class FaceLiftPipeline:
|
|
| 325 |
# Final CUDA cache clear
|
| 326 |
torch.cuda.empty_cache()
|
| 327 |
|
| 328 |
-
return str(
|
| 329 |
-
str(turntable_path), str(ply_path)
|
| 330 |
|
| 331 |
except Exception as e:
|
| 332 |
import traceback
|
|
@@ -348,7 +351,7 @@ def main():
|
|
| 348 |
|
| 349 |
# Wrapper to return outputs for display
|
| 350 |
def _generate_and_filter_outputs(image_path, auto_crop, guidance_scale, random_seed, num_steps):
|
| 351 |
-
|
| 352 |
pipeline.generate_3d_head(image_path, auto_crop, guidance_scale, random_seed, num_steps)
|
| 353 |
|
| 354 |
return output_path, turntable_path, str(ply_path), ply_path
|
|
|
|
| 1 |
+
# Copyright 2025 Adobe Inc.
|
|
|
|
| 2 |
#
|
| 3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
# you may not use this file except in compliance with the License.
|
| 5 |
+
# You may obtain a copy of the License at
|
| 6 |
#
|
| 7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
#
|
| 9 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
# See the License for the specific language governing permissions and
|
| 13 |
+
# limitations under the License.
|
| 14 |
+
|
| 15 |
|
| 16 |
"""
|
| 17 |
FaceLift: Single Image 3D Face Reconstruction
|
|
|
|
| 31 |
import json
|
| 32 |
from pathlib import Path
|
| 33 |
from datetime import datetime
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
import gradio as gr
|
| 36 |
import numpy as np
|
|
|
|
| 329 |
# Final CUDA cache clear
|
| 330 |
torch.cuda.empty_cache()
|
| 331 |
|
| 332 |
+
return str(output_path), str(turntable_path), str(ply_path)
|
|
|
|
| 333 |
|
| 334 |
except Exception as e:
|
| 335 |
import traceback
|
|
|
|
| 351 |
|
| 352 |
# Wrapper to return outputs for display
|
| 353 |
def _generate_and_filter_outputs(image_path, auto_crop, guidance_scale, random_seed, num_steps):
|
| 354 |
+
output_path, turntable_path, ply_path = \
|
| 355 |
pipeline.generate_3d_head(image_path, auto_crop, guidance_scale, random_seed, num_steps)
|
| 356 |
|
| 357 |
return output_path, turntable_path, str(ply_path), ply_path
|