Skip to content

wuhuikai/TF-A2RL

master
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?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
September 13, 2017 21:30
September 13, 2017 16:47
September 13, 2017 16:06
September 13, 2017 16:47
September 13, 2017 16:06
September 21, 2017 21:16
September 13, 2017 16:19
September 13, 2017 16:19
September 13, 2017 16:47
September 13, 2017 16:19

TF-A2RL: Automatic Image Cropping

[Project] [Paper] [Online Demo] [API] [Related Work: GP-GAN (for Image Blending)]

The official implementation for A2-RL: Aesthetics Aware Rinforcement Learning for Automatic Image Cropping

Overview

source step 1 step 2 step 3 step 4 step 5 output

A2-RL (aka. Aesthetics Aware Reinforcement Learning) is the author's implementation of the RL-based automatic image cropping algorithm described in:

A2-RL: Aesthetics Aware Reinforcement Learning for Automatic Image Cropping   
Debang Li, Huikai Wu, Junge Zhang, Kaiqi Huang

Given a source image, our algorithm could take actions step by step to find almost the best cropping window on source image.

Contact: Hui-Kai Wu (huikaiwu@icloud.com)

Getting started

  • Install the python libraries. (See Requirements).
  • Download the code from GitHub:
git clone https://github.com/wuhuikai/TF-A2RL.git
cd TF-A2RL
  • Download the pretrained models vfn_rl.pk from Google Drive, then put them in current directory (TF-A2RL/).

  • Run the python script:

python A2RL.py --image_path test_images/3846.jpg --save_path test_images/3846_cropped.jpg

or

sh example.sh

Results compared with baseline methods (more results)

Source VFN+Sliding window A2-RL Ground Truth

Requirements

The code requires the following 3rd party libraries:

pip install scikit-image

Details see the official README for installing skimage.

Details see the official README for installing TensorFlow.

Command line arguments:

Type python A2RL.py --help for a complete list of the arguments.

  • --image_path: path of the input image
  • --save_path: path of output image

Citation

@article{li2017a2,
  title={A2-RL: Aesthetics Aware Reinforcement Learning for Automatic Image Cropping},
  author={Li, Debang and Wu, Huikai and Zhang, Junge and Huang, Kaiqi},
  journal={arXiv preprint arXiv:1709.04595},
  year={2017}
}

About

The official implementation for A2-RL: Aesthetics Aware Rinforcement Learning for Automatic Image Cropping

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published