Spaces:
Runtime error
Runtime error
Remove processor group
Browse files- .gitignore +2 -0
- app.py +9 -21
- requirements.txt +2 -2
.gitignore
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
| 1 |
source.jpg
|
| 2 |
source.png
|
| 3 |
target.jpg
|
|
|
|
| 1 |
+
/venv/
|
| 2 |
+
|
| 3 |
source.jpg
|
| 4 |
source.png
|
| 5 |
target.jpg
|
app.py
CHANGED
|
@@ -3,23 +3,7 @@ from PIL import Image
|
|
| 3 |
import time
|
| 4 |
import os
|
| 5 |
import pathlib
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def save_images_as_zip(path_foto, filename, plataforma):
|
| 9 |
-
|
| 10 |
-
with zipfile.ZipFile(filename, "w") as zip_file:
|
| 11 |
-
for foto in os.listdir(path_foto):
|
| 12 |
-
print("La foto en os.listdir es: ", foto)
|
| 13 |
-
#Si Local
|
| 14 |
-
# path_foto_zippable = str(path_foto) + "\\" + foto
|
| 15 |
-
# #Si HuggingFace
|
| 16 |
-
# path_foto_zippable = str(path_foto) + "/" + foto
|
| 17 |
-
path_foto_zippable = str(path_foto) + (os.sep if plataforma == "local" else "/") + foto
|
| 18 |
-
print("La ruta textual final de esa foto en particular es: ", path_foto_zippable)
|
| 19 |
-
# ruta = pathlib.Path(path_foto_zippable)
|
| 20 |
-
# zip_file.write(ruta)
|
| 21 |
-
ruta = os.path.basename(path_foto_zippable)
|
| 22 |
-
zip_file.write(path_foto_zippable, ruta)
|
| 23 |
|
| 24 |
def perform(input1, input2, input3):
|
| 25 |
|
|
@@ -156,7 +140,6 @@ def perform(input1, input2, input3):
|
|
| 156 |
#print("El nombre del zip será: ", nombre_zip)
|
| 157 |
|
| 158 |
try:
|
| 159 |
-
#save_images_as_zip(path_foto, nombre_zip, plataforma)
|
| 160 |
print("Ésta vez no crearemos archivo zip.")
|
| 161 |
|
| 162 |
except Exception as e:
|
|
@@ -180,11 +163,16 @@ def perform(input1, input2, input3):
|
|
| 180 |
print("Éste es el path para imagen:", path)
|
| 181 |
return path
|
| 182 |
print("Listo! Gracias!")
|
| 183 |
-
|
| 184 |
-
#Así para
|
| 185 |
demo = gr.Interface(
|
| 186 |
-
fn=perform, inputs=[gr.Image(), gr.Image(),
|
| 187 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
|
| 189 |
#Así para video y 3 outputs: Video, Galería y Archivo Zip.
|
| 190 |
# demo = gr.Interface(
|
|
|
|
| 3 |
import time
|
| 4 |
import os
|
| 5 |
import pathlib
|
| 6 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
def perform(input1, input2, input3):
|
| 9 |
|
|
|
|
| 140 |
#print("El nombre del zip será: ", nombre_zip)
|
| 141 |
|
| 142 |
try:
|
|
|
|
| 143 |
print("Ésta vez no crearemos archivo zip.")
|
| 144 |
|
| 145 |
except Exception as e:
|
|
|
|
| 163 |
print("Éste es el path para imagen:", path)
|
| 164 |
return path
|
| 165 |
print("Listo! Gracias!")
|
| 166 |
+
|
| 167 |
+
#Así para Briggs
|
| 168 |
demo = gr.Interface(
|
| 169 |
+
fn=perform, inputs=[gr.Image(), gr.Image(), outputs=[gr.Image()]
|
| 170 |
)
|
| 171 |
+
|
| 172 |
+
#Así para imagenes
|
| 173 |
+
# demo = gr.Interface(
|
| 174 |
+
# fn=perform, inputs=[gr.Image(), gr.Image(), gr.CheckboxGroup(["face_swapper","face_enhancer"], label="Processor")], outputs=[gr.Image()]
|
| 175 |
+
# )
|
| 176 |
|
| 177 |
#Así para video y 3 outputs: Video, Galería y Archivo Zip.
|
| 178 |
# demo = gr.Interface(
|
requirements.txt
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
-
numpy==1.24.3
|
|
|
|
| 2 |
opencv-python==4.8.0.74
|
| 3 |
onnx==1.14.0
|
| 4 |
insightface==0.7.3
|
|
@@ -12,5 +13,4 @@ tensorflow==2.13.0
|
|
| 12 |
opennsfw2==0.10.2
|
| 13 |
protobuf==4.23.4
|
| 14 |
tqdm==4.65.0
|
| 15 |
-
zipfile36
|
| 16 |
onnxruntime-gpu==1.15.1
|
|
|
|
| 1 |
+
#numpy==1.24.3
|
| 2 |
+
numpy
|
| 3 |
opencv-python==4.8.0.74
|
| 4 |
onnx==1.14.0
|
| 5 |
insightface==0.7.3
|
|
|
|
| 13 |
opennsfw2==0.10.2
|
| 14 |
protobuf==4.23.4
|
| 15 |
tqdm==4.65.0
|
|
|
|
| 16 |
onnxruntime-gpu==1.15.1
|