santa hat
deerdeer nosedeer glow
Sign In

img-txt_viewer - Dataset manager and image tagger

img-txt_viewer - Dataset manager and image tagger

Check it out here on my Github! 👋

Download💾

img-txt Viewer

A Windows application for side-by-side image and text viewing, designed to streamline image tagging.

 

HitsGitHub all release downloadsGitHub release (latest by date)

📝 Usage

Prepare Your Files:

  • If you choose to include a text pair for an image, ensure they share the same basename.

    • For example: 01.png, 01.txt, 02.jpg, 02.txt, etc.

Supported image formats: .png, .jpg, .jpeg, .jfif, .jpg_large, .webp, .bmp, .gif.


💡 Tips and Features

  • Shortcuts:

    • ALT + LEFT/RIGHT: Quickly move between img-txt pairs.

    • SHIFT + DEL: Move the current pair to a local trash folder.

    • ALT: Cycle through auto-suggestions.

    • TAB: Insert the highlighted suggestion.

    • CTRL + S: Save the current text file.

    • CTRL + E: Jump to the next empty text file.

    • CTRL + R: Jump to a random img-txt pair.

    • CTRL + F: Highlight all duplicate words.

    • CTRL + Z / CTRL + Y: Undo / Redo.

    • CTRL + W: Close the window.

    • F1: Toggle zoom popup.

    • F2: Open the Image-Grid view.

    • F4: Open the current image in your default editor.

    • F5: Open Batch Tag Edit.

    • Middle-click: A tag to delete it.

  • Tips:

    • A guided setup will run on first launch to configure your autocomplete dictionaries and matching settings.

    • Insert a suggestion by clicking on it or pressing TAB.

    • Highlight matching words by selecting similar text.

    • Quickly create text pairs by loading the image and saving the text.

    • List Mode: Display tags in a list format while saving them in standard format.

    • Get Autocomplete Suggestions while you type using Danbooru/Anime tags, the English Dictionary, etc.

    • Match Modes: Last Word matches only the last word typed, Whole String matches the entire tag between commas.

    • Use Match Mode: Last Word for more natural and less strict autocomplete.

    • Use an asterisk (*) while typing for fuzzy search autocomplete suggestions.

    • Right-click the Browse... button to set or clear the alternate text path, allowing you to load text files from a separate folder than images.

  • Text Tools:

    • Search and Replace: Find specific text and replace it with another.

    • Prefix: Insert text at the START of all text files.

    • Append: Insert text at the END of all text files.

    • AutoTag: Automatically tag images using ONNX vision models like wd-v1-4-vit-tagger-v2.

    • Filter: Filter pairs based on text, missing text files, and more. Works with Search and Replace, Prefix, and Append.

    • Highlight: Always highlight specific text.

    • My Tags: Add your custom tags for autocomplete suggestions.

    • Batch Tag Edit: Edit and manage tags with a user-friendly interface that previews changes before applying them.

    • Create Wildcard From Captions: Combine all image captions into one text file, with each caption set separated by a newline.

    • Cleanup Text: Fix typos across all text files, such as duplicate tags, extra spaces, commas, and more.

  • Image Tools:

    • Batch Resize Images: Resize all images in a folder using different methods and conditions.

    • Resize Image: Resize the current image by exact resolution or percentage.

    • Batch Crop Images: Crop all images to a specified resolution.

    • Crop Image: Crop an image or GIF using a variety of methods and tools.

    • Upscale Image: Upscale images using models like RESRGAN, AnimeSharp-4x, and UltraSharp-4x. Additional models can be added to the ncnn_models folder.

    • Find Duplicate Files: Identify and separate duplicate files from your dataset.

    • Expand: Expand an image to a square ratio instead of cropping. Designed for images with simple backgrounds and centered subjects.

    • Edit Image Panel: Adjust brightness, contrast, saturation, sharpness, highlights, and shadows of the current image.

  • Other:

    • Batch Rename/Convert: Rename and optionally convert image and text files, saving them sequentially with padded zeros.

    • Thumbnail Panel: Display thumbnails under the current image for quick navigation.

    • Edit Image...: Open the current image in an external editor (e.g., MS Paint).

    • Auto-Save Save text when switching between img-txt pairs, changing the active directory, or closing the app.

    • Text cleanup: (e.g., removing duplicate tags, trailing commas, extra spaces) happens automatically on save, and can be disabled from the options menu.

    • Text cleanup is optimized for CSV-format captions and can be disabled via the Clean-Text option in the menu.

✨ User Guide

For more detailed information regarding the various tools and features, please refer to the User Guide✨found in the repo docs.

🛠 Install

Portable Setup

Static Badge

  1. Download the Windows executable from the releases page.

  2. Run the executable to launch the app.

Python Package Setup

Static Badge Static Badge

  1. Download the source code package from the latest releases page.

  2. Run the Start.bat file to automatically create and activate a virtual environment, then launch the app.

  3. Start.bat can be used to launch the app in the future.


Manual Python Setup...

Static Badge Static Badge

  1. Clone the repository:

git clone https://github.com/Nenotriple/img-txt_viewer.git
  1. Navigate into the project directory:

cd img-txt_viewer`
  1. Create and activate a virtual environment:

python -m venv venv
venv\Scripts\activate
  1. Install the required dependencies:

pip install -r requirements.txt
  1. Launch the app:

python img-txt_viewer.py

I make other apps and stuff, check it out here.📜

(This page will not be updated as frequently as the github page, some info may be out of date)

40

Comments