Haiyu Wu
commited on
Commit
·
c620b88
1
Parent(s):
90ad1e9
update
Browse files- .gitignore +2 -0
- app.py +4 -4
- examples/human1.png +0 -0
- examples/human2.png +0 -0
- examples/human3.png +0 -0
- examples/human4.png +0 -0
- examples/human5.png +0 -0
- examples/human6.png +0 -0
- examples/human7.png +0 -0
- examples/human8.png +0 -0
- models/__pycache__/__init__.cpython-38.pyc +0 -0
- models/__pycache__/iresnet.cpython-38.pyc +0 -0
- pixel_generator/vec2face/__pycache__/im_decoder.cpython-38.pyc +0 -0
- pixel_generator/vec2face/__pycache__/model_vec2face.cpython-38.pyc +0 -0
.gitignore
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__pycache__
|
| 2 |
+
weights/
|
app.py
CHANGED
|
@@ -10,7 +10,7 @@ from sixdrepnet.model import SixDRepNet
|
|
| 10 |
import pixel_generator.vec2face.model_vec2face as model_vec2face
|
| 11 |
import torch
|
| 12 |
import os
|
| 13 |
-
|
| 14 |
from time import time
|
| 15 |
|
| 16 |
|
|
@@ -81,7 +81,7 @@ def initialize_models():
|
|
| 81 |
|
| 82 |
return generator, id_model, pose_model, quality_model
|
| 83 |
|
| 84 |
-
|
| 85 |
def image_generation(input_image, quality, random_perturbation, sigma, dimension, progress=gr.Progress()):
|
| 86 |
generator, id_model, pose_model, quality_model = initialize_models()
|
| 87 |
|
|
@@ -121,7 +121,7 @@ def image_generation(input_image, quality, random_perturbation, sigma, dimension
|
|
| 121 |
|
| 122 |
return generated_images
|
| 123 |
|
| 124 |
-
|
| 125 |
def process_input(image_input, num1, num2, num3, num4, random_seed, target_quality, random_perturbation, sigma, progress=gr.Progress()):
|
| 126 |
# Ensure all dimension numbers are within [0, 512)
|
| 127 |
num1, num2, num3, num4 = [max(0, min(int(n), 511)) for n in [num1, num2, num3, num4]]
|
|
@@ -294,7 +294,7 @@ def main():
|
|
| 294 |
"""
|
| 295 |
gr.Markdown(article)
|
| 296 |
|
| 297 |
-
demo.launch(
|
| 298 |
|
| 299 |
|
| 300 |
if __name__ == "__main__":
|
|
|
|
| 10 |
import pixel_generator.vec2face.model_vec2face as model_vec2face
|
| 11 |
import torch
|
| 12 |
import os
|
| 13 |
+
import spaces
|
| 14 |
from time import time
|
| 15 |
|
| 16 |
|
|
|
|
| 81 |
|
| 82 |
return generator, id_model, pose_model, quality_model
|
| 83 |
|
| 84 |
+
@spaces.GPU
|
| 85 |
def image_generation(input_image, quality, random_perturbation, sigma, dimension, progress=gr.Progress()):
|
| 86 |
generator, id_model, pose_model, quality_model = initialize_models()
|
| 87 |
|
|
|
|
| 121 |
|
| 122 |
return generated_images
|
| 123 |
|
| 124 |
+
@spaces.GPU
|
| 125 |
def process_input(image_input, num1, num2, num3, num4, random_seed, target_quality, random_perturbation, sigma, progress=gr.Progress()):
|
| 126 |
# Ensure all dimension numbers are within [0, 512)
|
| 127 |
num1, num2, num3, num4 = [max(0, min(int(n), 511)) for n in [num1, num2, num3, num4]]
|
|
|
|
| 294 |
"""
|
| 295 |
gr.Markdown(article)
|
| 296 |
|
| 297 |
+
demo.launch()
|
| 298 |
|
| 299 |
|
| 300 |
if __name__ == "__main__":
|
examples/human1.png
ADDED
|
examples/human2.png
ADDED
|
examples/human3.png
ADDED
|
examples/human4.png
ADDED
|
examples/human5.png
ADDED
|
examples/human6.png
ADDED
|
examples/human7.png
ADDED
|
examples/human8.png
ADDED
|
models/__pycache__/__init__.cpython-38.pyc
CHANGED
|
Binary files a/models/__pycache__/__init__.cpython-38.pyc and b/models/__pycache__/__init__.cpython-38.pyc differ
|
|
|
models/__pycache__/iresnet.cpython-38.pyc
CHANGED
|
Binary files a/models/__pycache__/iresnet.cpython-38.pyc and b/models/__pycache__/iresnet.cpython-38.pyc differ
|
|
|
pixel_generator/vec2face/__pycache__/im_decoder.cpython-38.pyc
CHANGED
|
Binary files a/pixel_generator/vec2face/__pycache__/im_decoder.cpython-38.pyc and b/pixel_generator/vec2face/__pycache__/im_decoder.cpython-38.pyc differ
|
|
|
pixel_generator/vec2face/__pycache__/model_vec2face.cpython-38.pyc
CHANGED
|
Binary files a/pixel_generator/vec2face/__pycache__/model_vec2face.cpython-38.pyc and b/pixel_generator/vec2face/__pycache__/model_vec2face.cpython-38.pyc differ
|
|
|