Spaces:
Runtime error
Runtime error
Moibe
commited on
Commit
•
934c174
1
Parent(s):
3f5f728
Paths only if video
Browse files
app.py
CHANGED
@@ -55,32 +55,35 @@ def perform(input1, input2, input3):
|
|
55 |
print("Path_video es:", path_video)
|
56 |
time.sleep(5)
|
57 |
|
58 |
-
if
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
|
|
|
|
|
|
84 |
|
85 |
#Selector de modo.
|
86 |
if modo == "video":
|
|
|
55 |
print("Path_video es:", path_video)
|
56 |
time.sleep(5)
|
57 |
|
58 |
+
if modo == "video":
|
59 |
+
|
60 |
+
if plataforma == "local":
|
61 |
+
#Para local.
|
62 |
+
path_parts = path_video.split("\\")
|
63 |
+
else:
|
64 |
+
#Para HuggingFace
|
65 |
+
#Creo que no va en imagen.
|
66 |
+
print("La plataforma en la que basaremos la división es HuggingFace.")
|
67 |
+
path_parts = path_video.split("/")
|
68 |
+
|
69 |
+
#Aquí obtendremos nom_video
|
70 |
+
#Creo no va en imagen
|
71 |
+
filename = path_parts[-1]
|
72 |
+
nom_video = filename[:-4]
|
73 |
+
print("Esto es filename alias nom_video: ", nom_video)
|
74 |
+
path_particular = "/".join(path_parts[0:len(path_parts) - 1])
|
75 |
+
path_general = "/".join(path_parts[0:len(path_parts) - 2])
|
76 |
+
path_general = path_general.replace("\\", "/")
|
77 |
+
path_particular = path_particular.replace("\\", "/")
|
78 |
+
print("Path general: ", path_general)
|
79 |
+
print("Path general: ", path_particular)
|
80 |
+
path = pathlib.Path("result.mp4")
|
81 |
+
files = os.listdir(path_general)
|
82 |
+
|
83 |
+
print("Estos son los files que hay:")
|
84 |
+
print(files)
|
85 |
+
ext_imagen = "png"
|
86 |
+
ext_video = "mp4"
|
87 |
|
88 |
#Selector de modo.
|
89 |
if modo == "video":
|