flocolombari
commited on
Commit
•
ca78b3e
1
Parent(s):
6fbe27e
Update app.py
Browse files
app.py
CHANGED
@@ -58,7 +58,7 @@ def detect_scene_changes(video_path, threshold):
|
|
58 |
|
59 |
def video_to_descriptions(video, target_language="en"):
|
60 |
|
61 |
-
threshold =
|
62 |
|
63 |
scene_changes = detect_scene_changes(video, threshold)
|
64 |
|
@@ -104,7 +104,7 @@ def video_to_descriptions(video, target_language="en"):
|
|
104 |
|
105 |
cap.release()
|
106 |
|
107 |
-
concatenated_description = " ".join(descriptions).split("There has been a scene change, now we can observe")
|
108 |
plan_number = 1
|
109 |
summarized_description = f"We can see the Scene number {plan_number}, where "
|
110 |
|
@@ -119,7 +119,7 @@ def video_to_descriptions(video, target_language="en"):
|
|
119 |
|
120 |
print("SUMMARIZATION : " + summarized_description)
|
121 |
|
122 |
-
translated_text = translator(summarized_description)[0]["translation_text"]
|
123 |
print("TRANSLATION : " + translated_text)
|
124 |
|
125 |
audio_file = audio(translated_text)
|
|
|
58 |
|
59 |
def video_to_descriptions(video, target_language="en"):
|
60 |
|
61 |
+
threshold =55.0
|
62 |
|
63 |
scene_changes = detect_scene_changes(video, threshold)
|
64 |
|
|
|
104 |
|
105 |
cap.release()
|
106 |
|
107 |
+
concatenated_description = " ".join(descriptions).split(" There has been a scene change, now we can observe")
|
108 |
plan_number = 1
|
109 |
summarized_description = f"We can see the Scene number {plan_number}, where "
|
110 |
|
|
|
119 |
|
120 |
print("SUMMARIZATION : " + summarized_description)
|
121 |
|
122 |
+
translated_text = translator(summarized_description, max_length=2560)[0]["translation_text"]
|
123 |
print("TRANSLATION : " + translated_text)
|
124 |
|
125 |
audio_file = audio(translated_text)
|