Maximo Fernandez
commited on
Commit
·
3b77476
1
Parent(s):
4e19a89
Uncomment all componens and even listeners
Browse files
app.py
CHANGED
@@ -721,35 +721,35 @@ def subtify():
|
|
721 |
video_translated_progress_info = gr.Textbox(placeholder="Waiting", label="Translate progress info", elem_id="transcription_translated_progress_info", interactive=False, visible=visible)
|
722 |
video_subtitled_progress_info = gr.Textbox(placeholder="Waiting", label="Video subtitle progress info", elem_id="video_subtitled_progress_info", interactive=False, visible=visible)
|
723 |
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
|
731 |
# Events
|
732 |
# paste_button.click(fn=paste_url_from_clipboard, outputs=url_textbox)
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
url_textbox.change(
|
754 |
fn=show_auxiliar_block1,
|
755 |
outputs=[auxiliar_block1]
|
@@ -759,43 +759,43 @@ def subtify():
|
|
759 |
inputs=url_textbox,
|
760 |
outputs=[image, source_languaje, target_languaje, Advanced_setings, number_of_speakers, subtify_button]
|
761 |
)
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
|
800 |
gr.HTML(html_buy_me_a_coffe)
|
801 |
|
|
|
721 |
video_translated_progress_info = gr.Textbox(placeholder="Waiting", label="Translate progress info", elem_id="transcription_translated_progress_info", interactive=False, visible=visible)
|
722 |
video_subtitled_progress_info = gr.Textbox(placeholder="Waiting", label="Video subtitle progress info", elem_id="video_subtitled_progress_info", interactive=False, visible=visible)
|
723 |
|
724 |
+
original_audio_path = gr.Textbox(label="Original audio path", elem_id="original_audio_path", visible=visible)
|
725 |
+
original_video_path = gr.Textbox(label="Original video path", elem_id="original_video_path", visible=visible)
|
726 |
+
original_audio_transcribed_path = gr.Textbox(label="Original audio transcribed", elem_id="original_audio_transcribed", visible=visible)
|
727 |
+
original_audio_translated_path = gr.Textbox(label="Original audio translated", elem_id="original_audio_translated", visible=visible)
|
728 |
+
subtitled_video = gr.Video(label="Subtitled video", elem_id="subtitled_video", visible=visible, interactive=visible)
|
729 |
+
auxiliar_block3 = gr.Textbox(placeholder="Waiting", label="Auxiliar block 3", elem_id="auxiliar_block3", interactive=False, visible=visible)
|
730 |
|
731 |
# Events
|
732 |
# paste_button.click(fn=paste_url_from_clipboard, outputs=url_textbox)
|
733 |
+
delete_button.click(
|
734 |
+
fn=reset_frontend,
|
735 |
+
outputs=[
|
736 |
+
url_textbox,
|
737 |
+
image,
|
738 |
+
source_languaje,
|
739 |
+
target_languaje,
|
740 |
+
Advanced_setings,
|
741 |
+
number_of_speakers,
|
742 |
+
subtify_button,
|
743 |
+
auxiliar_block2,
|
744 |
+
video_donwloaded_progress_info,
|
745 |
+
video_sliced_progress_info,
|
746 |
+
video_transcribed_progress_info,
|
747 |
+
transcriptions_concatenated_progress_info,
|
748 |
+
video_translated_progress_info,
|
749 |
+
video_subtitled_progress_info,
|
750 |
+
subtitled_video,
|
751 |
+
]
|
752 |
+
)
|
753 |
url_textbox.change(
|
754 |
fn=show_auxiliar_block1,
|
755 |
outputs=[auxiliar_block1]
|
|
|
759 |
inputs=url_textbox,
|
760 |
outputs=[image, source_languaje, target_languaje, Advanced_setings, number_of_speakers, subtify_button]
|
761 |
)
|
762 |
+
subtify_button.click(
|
763 |
+
fn=change_visibility_texboxes,
|
764 |
+
outputs=[auxiliar_block2, video_donwloaded_progress_info, video_sliced_progress_info, video_transcribed_progress_info, transcriptions_concatenated_progress_info, video_translated_progress_info, video_subtitled_progress_info, auxiliar_block1]
|
765 |
+
)
|
766 |
+
auxiliar_block2.change(
|
767 |
+
fn=get_audio_and_video_from_video,
|
768 |
+
inputs=[url_textbox],
|
769 |
+
outputs=[video_donwloaded_progress_info, original_audio_path, original_video_path]
|
770 |
+
)
|
771 |
+
video_donwloaded_progress_info.change(
|
772 |
+
fn=slice_audio,
|
773 |
+
inputs=[original_audio_path],
|
774 |
+
outputs=[video_sliced_progress_info]
|
775 |
+
)
|
776 |
+
video_sliced_progress_info.change(
|
777 |
+
fn=trascribe_audio,
|
778 |
+
inputs=[source_languaje, number_of_speakers],
|
779 |
+
outputs=[video_transcribed_progress_info]
|
780 |
+
)
|
781 |
+
video_transcribed_progress_info.change(
|
782 |
+
fn=concatenate_transcriptions,
|
783 |
+
outputs=[transcriptions_concatenated_progress_info, original_audio_transcribed_path]
|
784 |
+
)
|
785 |
+
transcriptions_concatenated_progress_info.change(
|
786 |
+
fn=translate_transcription,
|
787 |
+
inputs=[original_audio_transcribed_path, source_languaje, target_languaje],
|
788 |
+
outputs=[video_translated_progress_info, original_audio_translated_path]
|
789 |
+
)
|
790 |
+
video_translated_progress_info.change(
|
791 |
+
fn=add_translated_subtitles_to_video,
|
792 |
+
inputs=[original_video_path, original_audio_path, original_audio_translated_path],
|
793 |
+
outputs=[subtitled_video, video_subtitled_progress_info, auxiliar_block3]
|
794 |
+
)
|
795 |
+
auxiliar_block3.change(
|
796 |
+
fn=hide_textbobes_progress_info,
|
797 |
+
outputs=[video_donwloaded_progress_info, video_sliced_progress_info, video_transcribed_progress_info, transcriptions_concatenated_progress_info, video_translated_progress_info, video_subtitled_progress_info]
|
798 |
+
)
|
799 |
|
800 |
gr.HTML(html_buy_me_a_coffe)
|
801 |
|