GithubHelp home page GithubHelp logo

thepetrmarek / automaticneuralimagecropper Goto Github PK

View Code? Open in Web Editor NEW
40.0 1.0 6.0 18 KB

Neural network making the best looking crops of images

Home Page: http://petr-marek.com/blog/2017/09/06/automatic-neural-image-cropper/

License: Apache License 2.0

Python 100.00%
crop-image image-processing neural-network tensorflow

automaticneuralimagecropper's Introduction

Automatic Neural Image Cropper

Neural network trained to make the best looking crops of images. It is described in the blog Automatic neural image cropper.

Automatic Neural Image Cropper

How to run

  1. Download checkpoint of Inception v4 from https://github.com/tensorflow/models/tree/master/slim#pre-trained-models and unpack it to root.

  2. Install all requirements by running

    pip install requirements.txt

  3. Find some data (you have to do it on your own. AVA dataset maybe...). It is JSON containing array with objects: {"picture":"path/to/picture","good_example":True} Method to decide if picture is good or bad is described in blog Automatic neural image cropper. You can take inspiration from data_preprocess.py.

  4. Open Main.py. There are several parameters at the beginning of the file.

Parameter Function
TRAIN Run training or run cropping (Bool)
EPOCHS How many epochs will we train? (Int)
BATCH_SIZE Size of batch (Int)
TRAIN_ACCURACY Do we want to evaluate accuracy on trainig set? This will make training A LOT slower. (Bool)
MODEL_NAME Name of model (String)
RESTORE Will we restore the model from checkpoint? (Bool)
CHECKPOINT Path to checkpoint (String)
EPOCH From which epoch to continue? (Int)
[training|validation|testing]_dataset Path to folder with dataset and name of json file (String, String)
IMAGE_FOLDER Path to folder with photos to crop (String)
  1. Set parameters to train and run training by

    py -3 Main.py

  2. Set parameters to cropping and run cropping by

    py -3 Main.py

Examples

Automatic neural image cropper

Automatic neural image cropper

Automatic neural image cropper

Automatic neural image cropper

Automatic neural image cropper

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.