Coder Social home page Coder Social logo

select_great_photos's Introduction

How to use this

Overview

  • select some great and some bad photos from your library
  • train a classification model using train.py
  • classify a bunch of photos from your library using the trained model with classify.py
  • improve trained model

Setup

  • install required Python 3 packages

    pip install tensorflow scikit-learn Pillow
    
  • on macOS you need tensorflow-macos

Selecting photos for training

  • copy randomly selected photos from your library to the photos folder
    find /path/to/photo/library -type f -iname "*.jpg" -print0 | shuf -z -n 100 | xargs -0 -I{} cp -v {} ./photos
  • manually move great ones to the ./photos/great folder
  • manually move bad ones to the ./photos/bad folder

Train model

  • make sure you have at least 100 photos in the photos folder (the more, the merrier)
  • launch training
    python3 train.py
  • model will be saved to model.h5

Classify photos

  • make sure you have some photos in the classified_photos folder

    find /path/to/photo/library -type f -iname "*.jpg" -print0 | shuf -z -n 100 | xargs -0 -I{} cp -v {} ./classified_photos
  • launch classification

    python3 classify.py
  • verify if photos in classified_photos/bad folder are actually bad and classified_photos/great photos are actually great.

  • incorrectly classified photos should be added as photos for training to the respective folder in photos

Improving model

  • delete sub-folders from data folder
  • run train.py again
    python3 train.py

Contributing

  • looking forward to your PR!

Troubleshooting

  • on macOS, you should use macOS built-in Python 3 and not the brew version for tensorflow to work

select_great_photos's People

Contributors

fabiangebert avatar

Stargazers

Niko Schmuck avatar

Watchers

 avatar

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.