()
| 14 | DUB_VIDEO = "output/output_dub.mp4" |
| 15 | |
| 16 | def text_processing_section(): |
| 17 | st.header(t("b. Translate and Generate Subtitles")) |
| 18 | with st.container(border=True): |
| 19 | st.markdown(f""" |
| 20 | <p style='font-size: 20px;'> |
| 21 | {t("This stage includes the following steps:")} |
| 22 | <p style='font-size: 20px;'> |
| 23 | 1. {t("WhisperX word-level transcription")}<br> |
| 24 | 2. {t("Sentence segmentation using NLP and LLM")}<br> |
| 25 | 3. {t("Summarization and multi-step translation")}<br> |
| 26 | 4. {t("Cutting and aligning long subtitles")}<br> |
| 27 | 5. {t("Generating timeline and subtitles")}<br> |
| 28 | 6. {t("Merging subtitles into the video")} |
| 29 | """, unsafe_allow_html=True) |
| 30 | |
| 31 | if not os.path.exists(SUB_VIDEO): |
| 32 | if st.button(t("Start Processing Subtitles"), key="text_processing_button"): |
| 33 | process_text() |
| 34 | st.rerun() |
| 35 | else: |
| 36 | if load_key("burn_subtitles"): |
| 37 | st.video(SUB_VIDEO) |
| 38 | download_subtitle_zip_button(text=t("Download All Srt Files")) |
| 39 | |
| 40 | if st.button(t("Archive to 'history'"), key="cleanup_in_text_processing"): |
| 41 | cleanup() |
| 42 | st.rerun() |
| 43 | return True |
| 44 | |
| 45 | def process_text(): |
| 46 | with st.spinner(t("Using Whisper for transcription...")): |
no test coverage detected