| 2 | |
| 3 | |
| 4 | class DataProcessingOptions: |
| 5 | def __init__(self): |
| 6 | self.parser = argparse.ArgumentParser() |
| 7 | |
| 8 | def parse_args(self): |
| 9 | self.parser.add_argument( |
| 10 | "--extract_video_frame", action="store_true", help="extract video frame" |
| 11 | ) |
| 12 | self.parser.add_argument( |
| 13 | "--extract_audio", |
| 14 | action="store_true", |
| 15 | help="extract audio files from videos", |
| 16 | ) |
| 17 | self.parser.add_argument( |
| 18 | "--extract_deep_speech", |
| 19 | action="store_true", |
| 20 | help="extract deep speech features", |
| 21 | ) |
| 22 | self.parser.add_argument("--crop_face", action="store_true", help="crop face") |
| 23 | self.parser.add_argument( |
| 24 | "--generate_training_json", |
| 25 | action="store_true", |
| 26 | help="generate training json file", |
| 27 | ) |
| 28 | |
| 29 | self.parser.add_argument( |
| 30 | "--source_video_dir", |
| 31 | type=str, |
| 32 | default="./asserts/training_data/split_video_25fps", |
| 33 | help="path of source video in 25 fps", |
| 34 | ) |
| 35 | self.parser.add_argument( |
| 36 | "--openface_landmark_dir", |
| 37 | type=str, |
| 38 | default="./asserts/training_data/split_video_25fps_landmark_openface", |
| 39 | help="path of openface landmark dir", |
| 40 | ) |
| 41 | self.parser.add_argument( |
| 42 | "--video_frame_dir", |
| 43 | type=str, |
| 44 | default="./asserts/training_data/split_video_25fps_frame", |
| 45 | help="path of video frames", |
| 46 | ) |
| 47 | self.parser.add_argument( |
| 48 | "--audio_dir", |
| 49 | type=str, |
| 50 | default="./asserts/training_data/split_video_25fps_audio", |
| 51 | help="path of audios", |
| 52 | ) |
| 53 | self.parser.add_argument( |
| 54 | "--deep_speech_dir", |
| 55 | type=str, |
| 56 | default="./asserts/training_data/split_video_25fps_deepspeech", |
| 57 | help="path of deep speech", |
| 58 | ) |
| 59 | self.parser.add_argument( |
| 60 | "--crop_face_dir", |
| 61 | type=str, |