-
Notifications
You must be signed in to change notification settings - Fork 4
/
sc.sh
executable file
·36 lines (32 loc) · 1.06 KB
/
sc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Script that mimics Softcatalà setup
rm -f open_dubbing.log
pip install .
rm -r -f output/
branch_name=$(git rev-parse --abbrev-ref HEAD)
declare -a target_languages=("cat") # Catalan (cat) and French (fra)
declare -a inputs=($(find ../dubbing/od-videos/ -type f -name "*.mp4"))
declare -a inputs=("videos/jordi.mp4" )
for input_file in "${inputs[@]}"; do
output_directory="output/$(basename "${input_file%.*}").${branch_name}/"
for language in "${target_languages[@]}"; do
# Run the dubbing command
open-dubbing \
--input_file "$input_file" \
--whisper_model="medium" \
--output_directory="$output_directory" \
--target_language="$language" \
--translator="apertium" \
--apertium_server=http://localhost:8500/ \
--tts=api \
--tts_api_server=http://localhost:8100/ \
--target_language_region="central" \
--device=cpu \
--dubbed_subtitles\
--log_level=INFO
if [ $? -ne 0 ]; then
echo "Error occurred with open-dubbing. Exiting loop."
exit 1
fi
echo ""
done
done