GithubHelp home page GithubHelp logo

5joon2 / cacnet-pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bo-zhang-cs/cacnet-pytorch

0.0 0.0 0.0 30 KB

Unofficial PyTorch implementation of "Composing Photos Like a Photographer"

License: MIT License

Python 100.00%

cacnet-pytorch's Introduction

CACNet-Pytorch

This is an unofficial PyTorch implementation of Composing Photos Like a Photographer, in which the anchor-point regressors is based on Anchor-to-Joint Regression Network and more details about this can be found in their paper & code.

Results

Test set FCDB FLMS KU-PCP
Original Paper IoU=0.718 BDE=0.069 IoU=0.854 BDE=0.033 Accuracy=88.2%
This code IoU=0.702 BDE=0.074 IoU=0.841 BDE=0.037 Accuracy=88.4%

Note that the accuracy is produced training composition classification branch alone.

Datasets Preparation

  1. Download these datasets and change the default dataset folder in config_*.py.
  2. There are some images that unable to open in KU-PCP dataset, and you can fix this by calling check_jpg_file function in KUPCP_dataset.py.

Requirements

  • PyTorch>=1.0
  • torchvision
  • tensorboardX
  • opencv-python
  • tqdm

You can also install packages using pip according to requirements.txt:

pip install -r requirements.txt

Usage

Testing

  # clone this repository
  git clone https://github.com/bo-zhang-cs/CACNet-Pytorch.git
  cd CACNet-Pytorch && mkdir pretrained_model

Download pretrained model (~75MB) from [Google Drive] to the folder pretrained_model.

python test.py

This will produce a folder results where you can find the predicted best crops.

Training

Train composition classification model

python train_composition_classification.py

Train image cropping model (CACNet)

python train_image_cropping.py

Tracking training process

tensorboard --logdir=./experiments

The model performance for each epoch is also recorded in .csv file under the produced folder ./experiments.

Citation

@inproceedings{hong2021composing,
  title={Composing Photos Like a Photographer},
  author={Hong, Chaoyi and Du, Shuaiyuan and Xian, Ke and Lu, Hao and Cao, Zhiguo and Zhong, Weicai},
  booktitle={CVPR},
  year={2021}
}

More references about image cropping

Awesome Image Aesthetic Assessment and Cropping

cacnet-pytorch's People

Contributors

bo-zhang-cs 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.