Skip to content

Diogo364/cli-image-categorizer

Repository files navigation

Image Categorizer

Description

These CLI programs help speed up and improve the manual image categorization process by providing a simple, but effective workflow.

Table of contents


How to use

Manual Binary Categorizer

Description:

CLI application to classify all images from a specific directory into two categories: A or B.

By calling the CLI application you will define the directory associated with A and B. When a image is classified, it is automatically moved from the source directory to the target directory assigned.

Commands:

  • a: Move the shown image to directory A;
  • b: Move the shown image to directory B;
  • q: Exit the program;
  • h: Print all commands and instructions in the terminal;

CLI Parameters:

  • images_dir:
    • Source directory containing all images that should be classified.
    • Kind: Positional argument.
  • -a or --dir-a:
    • Directory associated with the category A.
  • b or --dir-b:
    • Directory associated with the category B.
  • --create-dir:
    • If used both ,dir-a and dir-b, are going to be created if already do not exist.

Example of usage:

$ python manual_binary_categorizer ./dataset/images -a ./target/classA -b ./target/classB --create-dir


Manual Multiclass Categorizer

Description:

CLI application to classify all images from a specific directory into various categories (Maximum of 34 classes).

By calling the CLI application you will define a list of output directories, corresponding to each class you want to classify. This list o directories will be associated with all digits and lower-case letters, in that order. When a image is classified, it is automatically moved from the source directory to the target directory assigned.

Commands:

  • digits and letters: Move the shown image to directory associated;
    • The directories listed are going to be assigned first by numeric order from [0,9] and then in alphabetical order [a, z].
  • q: Exit the program;
  • h: Print all commands and instructions in the terminal;

CLI Parameters:

  • images_dir:
    • Source directory containing all images that should be classified.
    • Kind: Positional argument.
  • -d or --dir-list:
    • Output directories separated by space.
  • --create-dir:
    • If used both ,dir-a and dir-b, are going to be created if already do not exist.

Example of usage:

$ python manual_multiclass_categorizer ./dataset/images -d ./target/classA ./target/classB ./target/classC --create-dir

Instalation

All requirements are in the requirements.txt file. From pip, just run in the terminal the following command and you are ready to go.

$ pip install -r requirements.txt

Technologies

  • Python>=3.8
  • OpenCV>=4.5

Autor


Diogo Nascimento Linkedin Badge Gmail Badge

About

Minimalistic image categorizer to help separate images into individual categories.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages