Repository navigation
Process Captions Page
The "Process Captions" page within Dataset Tools provides a straightforward way to process .caption files by performing a search and replace operation. This feature is useful for making bulk modifications to captions, such as replacing specific substrings with others to enhance the content's clarity or consistency.
This page is a bit experimental; since I work mostly with booru style captioning.
Its a good idea to make a backup of your dataset before processing with this page!
Using this page, you can:
-
Search and Replace in Captions: Automatically replace specified substrings within
.captionfiles, allowing for efficient batch caption editing.
-
Select Input and Output Folders: Specify the input folder containing your
.captionfiles and the output folder where the processed files will be saved. -
Define Search and Replace Rules: Set up search and replace rules by specifying the substring to be searched for and the replacement substring.
-
Process Captions: Click the "Process" button to initiate the search and replace operation on the selected
.captionfiles.
Suppose you have .caption files with captions like: "...woman..., ...blurry background..."
And you want to make the captions more descriptive: "...latina woman..., ...depth of field..."
You can easily achieve this by setting up a search and replace rule for "woman" to be replaced with "latina woman" and "blurry background" to be replaced with "depth of field.". Search and replace will only happen when applicable. If the .caption file already contains the "latina woman" substring, it won't process it again resulting in "latina woman woman".

- Use this feature to ensure consistency and clarity in your captions.
The "Process Captions" feature simplifies the task of bulk editing captions within .caption files, making it a valuable tool for managing and enhancing your dataset's metadata.