AutomaticNeuralImageCropper
AutomaticNeuralImageCropper copied to clipboard
Neural network making the best looking crops of images
Automatic Neural Image Cropper
Neural network trained to make the best looking crops of images. It is described in the blog .

How to run
-
Download checkpoint of Inception v4 from https://github.com/tensorflow/models/tree/master/slim#pre-trained-models and unpack it to root.
-
Install all requirements by running
pip install requirements.txt -
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. You can take inspiration from
.
-
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) |
-
Set parameters to train and run training by
py -3 Main.py -
Set parameters to cropping and run cropping by
py -3 Main.py
Examples




