Moibe commited on
Commit
934c174
1 Parent(s): 3f5f728

Paths only if video

Browse files
Files changed (1) hide show
  1. app.py +29 -26
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 plataforma == "local":
59
- #Para local.
60
- path_parts = path_video.split("\\")
61
- else:
62
- #Para HuggingFace
63
- #Creo que no va en imagen.
64
- print("La plataforma en la que basaremos la división es HuggingFace.")
65
- #path_parts = path_video.split("/")
66
-
67
- #Aquí obtendremos nom_video
68
- #Creo no va en imagen
69
- filename = path_parts[-1]
70
- nom_video = filename[:-4]
71
- print("Esto es filename alias nom_video: ", nom_video)
72
- path_particular = "/".join(path_parts[0:len(path_parts) - 1])
73
- path_general = "/".join(path_parts[0:len(path_parts) - 2])
74
- path_general = path_general.replace("\\", "/")
75
- path_particular = path_particular.replace("\\", "/")
76
- print("Path general: ", path_general)
77
- print("Path general: ", path_particular)
78
- path = pathlib.Path("result.mp4")
79
- files = os.listdir(path_general)
80
- print("Estos son los files que hay:")
81
- print(files)
82
- ext_imagen = "png"
83
- ext_video = "mp4"
 
 
 
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":