Git Product home page Git Product logo

img-txt_viewer's Introduction

img-txt_viewer

Display an image and text file side-by-side for easy manual captioning. + Tons of features to help you work faster!

v1 91_img-txt_viewer

๐Ÿ“ Usage

  • Prepare Your Files:
    • Put each image and its matching text file in the same folder.
    • If you choose to include a text pair for an image, ensure they are located in the same folder and have identical basenames.
    • For example: 01.png and 01.txt, 02.jpg and 02.txt...
    • Supported image types: .png .jpg .jpeg .jfif .jpg_large .webp .bmp

๐Ÿ’ก Tips and Features

  • Shortcuts:

    • ALT+LEFT/RIGHT: Quickly move between img-txt pairs.
    • SHIFT+DEL: Send 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.
    • F5: Refresh the text box.
    • Middle-click: A tag to quickly delete it.
  • Tips:

    • Highlight matching words by selecting text.
    • Enable List View to display text in a vertical list format.
    • Quickly create text pairs by loading the image and saving the text.
    • Get Autocomplete Suggestions while you type using Danbooru/Anime tags, the English Dictionary, etc.
    • Fuzzy Search Use an asterisk * while typing to return a broader range of suggestions.
      • For example: Typing *lo*b returns "looking back", and even "yellow background"
  • Text Tools:

    • Batch tag Delete: View all tag in a directory as a list, and quickly delete them. (Stand alone tool)
    • Prefix Text Files: Insert text at the START of all text files.
    • Append Text Files: Insert text at the END of all text files.
    • Search and Replace: Edit all text files at once.
    • Filter Pairs: Filter pairs based on matching text, blank or missing txt files, and more.
    • Active Highlights: Always highlight specific text.
    • My Tags: Quickly add you own tags to be used as autocomplete suggestions.
    • Cleanup Text: Fix simple typos in all text files of the selected folder.
  • Other Tools

    • Batch Resize Images: Resize a folder of images using several methods and conditions. (Stand alone tool)
    • Resize Image: Resize a single image.
    • Batch Crop Images: Crop a folder of images to an exact size, resizing if needed.
    • Crop Image: Quickly crop an image to a square or freeform ratio.
    • Upscale Image: Upscale an image using realesrgan-ncnn-vulkan
    • Expand Current Image: Expand an image to a square ratio instead of cropping.
    • Find Duplicate Files: Find and separate any duplicate files in a folder (Stand alone tool)
    • Rename and Convert Pairs: Automatically rename and convert files using a neat and tidy formatting.
  • Auto-Save

    • Check the auto-save box to save text when navigating between img/txt pairs or closing the window, etc.
    • Text is cleaned when saved, so you can ignore typos such as duplicate tokens, multiple spaces or commas, missing spaces, and more.
    • Clean text on save Can be disabled from the options menu.

๐Ÿšฉ Requirements

You don't need to worry about anything if you're using the portable/executable version.


Python 3.10+

You will need Pillow and NumPy.

  • To install Pillow: pip install pillow
  • To install NumPy: pip install numpy

Or use the included requirements.txt when setting up your venv.

๐Ÿ“œ Version History

v1.91 changes:

This release comes with several new tools, speedups for displaying images, new features, many issues were fixed, and much more.

Please see the v1.91 release page for the change complete notes.

img-txt_viewer's People

Contributors

nenotriple avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

img-txt_viewer's Issues

Feature request - Dataset Overview Mode

A way to view the folder dataset in some kind of overview mode.

For example, by grouping images into image size buckets or formats, to easily be able to do a batch operation on a group.

Like, let's say crop or expand all images in bad resolutions, or resize images of one to another nearby resolution.

Or a way to group by extension, and then convert all JPGs and JPEGs to PNGs (with warnings for if there's name overlap). And it also renames the .txt pairs at the same time.

These are all things that I do manually occasionally, or with small scripts, but would be great in a tool like this.
But it may also take away from the simplicity of the project, so it may not be suitable.

[feature request]: Filter out a subset of images based on the text file, and text highlight

Id like to start with saying this tool is great and makes it very easy to caption images. Thank you.

When working with very large image sets, its quite inconvenient to go through and check the text for every image to see if a word/token/tag/phrase exists.

For QoL it would be very useful if we could filter out a subset of images based on if a string exist or doesn't exist. I know there are other ways i could do this, like using batch/regedit via the terminal and move all the images to its own folder, or using notepad++ search and load up each text file individually, but it would be way more convenient if it could be done in the program directly.

Another thing that would improve QoL is if the text highlight could highlight any string, and not just duplicated tags. So you can have it highlight one or more tags at all times. Not having to scan through the entire caption to find what you are looking for would make it so you could blast through the images much quicker.

Autosave issue

When autosave is enabled, moving from the first page to the last page (by pressing the Previous button) does not save the text. Similarly, moving from the last page to the first page also does not trigger autosave.

[Feature request] Some suggestions - Improve zoom feature

Hi, i have some suggestions if I may

  • Option to adjust the size of the preview image. In Windows at 100% UI scaling, the images look quite small while the text box is just huge in full screen.
  • Would be cool if we could have a loop feature for image previews. Like when you hit Previous on the first image, it would take you to the last one and vice versa.
  • A way to choose specific text files instead of scrolling through the images. Also, there you may also see which files are empty or incomplete, by making it red

Add a delete button

It would be great to have a delete button to delete a specific image if we notice it is too blurred to be kept, for example.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.