Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

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 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

  4. Open 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

  2. Set parameters to cropping and run cropping by

    py -3


Automatic neural image cropper

Automatic neural image cropper

Automatic neural image cropper

Automatic neural image cropper

Automatic neural image cropper


No releases published


No packages published