ScottishHaze commited on
Commit
0c0cc88
·
verified ·
1 Parent(s): fea84de

Update README.md

Browse files

simplifying the readme

Files changed (1) hide show
  1. README.md +41 -64
README.md CHANGED
@@ -11,67 +11,44 @@ language:
11
  - en
12
  pretty_name: Speaker Identification Toolkit
13
  ---
14
- # Speaker Identification Toolkit
15
-
16
- ## Overview
17
-
18
- This toolkit provides a comprehensive suite of scripts for audio processing and speaker identification tasks. It includes features like video-to-audio conversion, speaker diarization, speaker isolation, and audio trimming.
19
-
20
- ## Scripts
21
-
22
- ### 1. Dataset Creation (Video to Audio Extraction)
23
-
24
- - **Functionality:** Extracts audio tracks from video files.
25
- - **Default Directories:**
26
- - Input: `videos`
27
- - Output: `wavs`
28
- - **Behavior:**
29
- - Auto-creates `videos` and `wavs` directories in the script folder.
30
- - Pauses execution to allow the user to populate the `videos` directory before processing.
31
- - Processes all `.mkv` and `.mp4` files in the `videos` directory.
32
- - Will create WAV's for use with model training: mono, pcm_s16le
33
-
34
- ### 2. Speaker Diarization
35
-
36
- - **Functionality:** Processes audio files and generates speaker diarization metadata.
37
- - **Default Directories:**
38
- - Input: `wavs`
39
- - Output: `jsons`
40
- - **Behavior:**
41
- - Auto-creates `wavs` and `jsons` directories in the script folder.
42
- - Includes a prompt for the Hugging Face token with validation.
43
- - Pauses execution to allow the user to populate the `wavs` directory.
44
- - Generates diarization metadata in `.json` format for all `.wav` files in the `wavs` directory.
45
-
46
- ### 3. Speaker Isolation and Trimming
47
-
48
- - **Functionality:** Isolates and trims audio segments based on speaker diarization metadata.
49
- - **Default Directories:**
50
- - Input JSON: `jsons`
51
- - Input WAV: `wavs`
52
- - Output: `targeted`
53
- - **Behavior:**
54
- - Auto-creates `jsons`, `wavs`, and `targeted` directories in the script folder.
55
- - Pauses execution to allow the user to populate the `jsons` and `wavs` directories.
56
- - Processes each `.json` file and its corresponding `.wav` file to extract and trim speaker-specific segments.
57
- - Outputs trimmed audio clips in the `targeted` directory.
58
-
59
- ## Common Features
60
-
61
- - All scripts auto-create necessary directories in the same folder as the script.
62
- - Scripts pause execution at key points to allow the user to populate input directories.
63
- - You can manually create the directories in advance and place media in it, for quicker processing.
64
- - Rich console output for enhanced user interaction and error handling.
65
-
66
- ## Hugging Face Token
67
-
68
- - Required for the Speaker Diarization script.
69
- - Token validation is performed before processing.
70
- - Update your token in the script or provide it at runtime when prompted.
71
-
72
- ## Notes
73
-
74
- - Ensure all input files are placed in the correct directories before running the scripts.
75
- - Output files will be saved in the corresponding output directories, which are automatically created if they do not exist.
76
- - When processing multi-speakers in multi-episode files, like a TV series spanning multiple seasons, it is best practice to listen to a few segments of the speaker before confirming.
77
- - If you make a mistake, stop the script and remove the bottom most line in your mappings CSV; the script will re-process it on next run.
 
11
  - en
12
  pretty_name: Speaker Identification Toolkit
13
  ---
14
+ # Speaker Identification Toolkit (Speaker Diarization)
15
+
16
+ This repository contains Python scripts for processing audio and video files, focusing on speaker diarization, speaker identification, audio extraction, and dataset creation. These tools leverage `ffmpeg`, `pyannote.audio`, and other Python libraries for efficient and accurate processing.
17
+
18
+ ## Workflow
19
+
20
+ 1. **Extract Audio from Videos**:
21
+ Use `dataset-creation.py` to extract English audio tracks from video files.
22
+
23
+ 2. **Generate Speaker Diarization Data**:
24
+ Use `diarize-dataset.py` to process the extracted WAV files and generate JSON files containing diarization data.
25
+
26
+ 3. **Identify Target Speaker**:
27
+ Use `identify-speaker.py` to play audio segments from diarization files and map the target speaker interactively.
28
+
29
+ 4. **Isolate and Trim Target Speaker Audio**:
30
+ Run `isolate-trim.py` to extract and trim the target speaker's audio segments for dataset creation.
31
+
32
+ ## Dependencies
33
+
34
+ Ensure you have the following installed:
35
+
36
+ - Python 3.8+
37
+
38
+ - `ffmpeg`:
39
+ Install `ffmpeg` via your system's package manager or [official site](https://ffmpeg.org/).
40
+
41
+ ## Configuration
42
+
43
+ The script will automatically create the folders it needs, pause for users to populate them with data, or proceed without prompt if they're already populated.
44
+
45
+ - **Video Input Directory**: `base-folder/videos`
46
+ - **WAV Output Directory**: `base-folder/wavs`
47
+ - **JSON Output Directory**: `base-folder/jsons`
48
+ - **Speaker Mapping File**: `base-folder/scripts/mappings.csv`
49
+ - **Processed Speaker Output Directory**: `base-folder/targeted`
50
+
51
+ **Additionally:**
52
+
53
+ - For `diarize-dataset.py`, set the Hugging Face API token in the script manually for faster, prompt-free processing. Insert it between the final set of quotes on line 29.
54
+