Spaces:
Sleeping
Sleeping
Moibe
commited on
Commit
•
14bab5c
1
Parent(s):
104f60a
Ruta de zip basada en plataforma
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import os
|
|
5 |
import pathlib
|
6 |
import zipfile36 as zipfile
|
7 |
|
8 |
-
def save_images_as_zip(path_foto, filename):
|
9 |
|
10 |
print("Entré a la función que hace los zips...")
|
11 |
time.sleep(1)
|
@@ -13,7 +13,11 @@ def save_images_as_zip(path_foto, filename):
|
|
13 |
with zipfile.ZipFile(filename, "w") as zip_file:
|
14 |
for foto in os.listdir(path_foto):
|
15 |
print("La foto en os.listdir es: ", foto)
|
16 |
-
|
|
|
|
|
|
|
|
|
17 |
print("La ruta textual final de esa foto en particular es: ", path_foto_zippable)
|
18 |
time.sleep(1)
|
19 |
# ruta = pathlib.Path(path_foto_zippable)
|
@@ -148,7 +152,7 @@ def greet(input1, input2):
|
|
148 |
|
149 |
nombre_zip = nom_video + ".zip"
|
150 |
print("El nombre del zip será: ", nombre_zip)
|
151 |
-
save_images_as_zip(path_foto, nombre_zip)
|
152 |
|
153 |
if modo == "video":
|
154 |
#Para video
|
|
|
5 |
import pathlib
|
6 |
import zipfile36 as zipfile
|
7 |
|
8 |
+
def save_images_as_zip(path_foto, filename, plataforma):
|
9 |
|
10 |
print("Entré a la función que hace los zips...")
|
11 |
time.sleep(1)
|
|
|
13 |
with zipfile.ZipFile(filename, "w") as zip_file:
|
14 |
for foto in os.listdir(path_foto):
|
15 |
print("La foto en os.listdir es: ", foto)
|
16 |
+
#Si Local
|
17 |
+
# path_foto_zippable = str(path_foto) + "\\" + foto
|
18 |
+
# #Si HuggingFace
|
19 |
+
# path_foto_zippable = str(path_foto) + "/" + foto
|
20 |
+
path_foto_zippable = str(path_foto) + (os.sep if plataforma == "local" else "/") + foto
|
21 |
print("La ruta textual final de esa foto en particular es: ", path_foto_zippable)
|
22 |
time.sleep(1)
|
23 |
# ruta = pathlib.Path(path_foto_zippable)
|
|
|
152 |
|
153 |
nombre_zip = nom_video + ".zip"
|
154 |
print("El nombre del zip será: ", nombre_zip)
|
155 |
+
save_images_as_zip(path_foto, nombre_zip, plataforma)
|
156 |
|
157 |
if modo == "video":
|
158 |
#Para video
|