Coder Social home page Coder Social logo

cli-image-categorizer's Introduction

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

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.