Coder Social home page Coder Social logo

faceoff's Introduction

faceoff

Quick and dirty image sorter by faces. The script will attempt to sort images by face and create a sub-directory with the face ID as directory name. The original images will be copied to the new sub-directory to make sure data is not lost. The script now uses multiprocessing to try to live up the the "quick" part.

Make sure to run the pre_req_install.sh before running the script.

Usage

python3 faceoff.py source/directory/ target/directory/ [--recursive] [--ignore] [--alone]

Recursion

Recursion was added to enable processing of trees of directories in one go. By adding --recursive to the command this is enabled for the runtime of the script and will treat the source directory as the root of the tree. The target directory will NOT reflect the source tree, it will still be one directory with one sub-directory for every matched face + one folder for images where no faces were detected by the algorithm.

Ignore faceless images

Add --ignore to simply not copy images where no faces were detected

Perform "standalone" runs

During my testing I frequently deleted the pickle files up until I got sick of it and added the --alone switch. This will simply not load face information from previous runs and no data will be stored from the run either.

Credits

Credit goes to Adam Geitgey for the face_recognition python module. https://github.com/ageitgey/face_recognition

Caveats

The script does not perform recursion within directories. The source directory should only contain image files, no sub-directories. I have not tested with images with several faces, the expected behaviour should be that the same image will end up in two directories.

As stated in the caveats over at https://github.com/ageitgey/face_recognition/blob/master/README.md

  • The face recognition model is trained on adults and does not work very well on children. It tends to mix up children quite easy using the default comparison threshold of 0.6.
  • Accuracy may vary between ethnic groups. Please see this wiki page for more details.

faceoff's People

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.