Update README.md
Browse filessimplifying the readme
README.md
CHANGED
|
@@ -11,67 +11,44 @@ language:
|
|
| 11 |
- en
|
| 12 |
pretty_name: Speaker Identification Toolkit
|
| 13 |
---
|
| 14 |
-
# Speaker Identification Toolkit
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
- **
|
| 49 |
-
- **
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
-
|
| 54 |
-
|
| 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 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|