Giter Site home page Giter Site logo

hd-celeba-cropper's Introduction

HD CelebA Cropper

CelebA dataset provides an aligned set img_align_celeba.zip. However, the size of each aligned image is 218x178, so the faces cropped from such images would be even smaller!

Here we provide a code to obtain higher resolution face images, by cropping the faces from the original unaligned images via 5 landmarks.

We also use a deep image quality assessment method to evaluate and rank the cropped image quality in scores.txt, lower score the better.

Cropped Faces (512x512)

Notice: There are still some low resolution cropped faces since the corresponding original images are low resolution.

Usage

  • Prerequisites

    • OpenCV 3 (much faster) or scikit-image
    • Python 2 or 3
  • Dataset

  • Examples

    • 512x512 + lanczos4 (with OpenCV) + jpg

      python hd_celeba.py --data_dir path_to_dataset --crop_size 512 --order 4 --save_format jpg --n_worker 32

    • 512x512 + lanczos4 (with OpenCV) + png + larger face in the image (by setting face_factor, default is 0.7)

      python hd_celeba.py --data_dir path_to_dataset --crop_size 512 --order 4 --save_format png --face_factor 0.8 --n_worker 32

    • 384x384 + bicubic + jpg + smaller face in the image (by setting face_factor, default is 0.7)

      python hd_celeba.py --data_dir path_to_dataset --crop_size 384 --order 3 --save_format jpg --face_factor 0.65 --n_worker 32

  • Notice

    • order for OpenCV
      • 0: INTER_NEAREST
      • 1: INTER_LINEAR
      • 2: INTER_AREA
      • 3: INTER_CUBIC
      • 4: INTER_LANCZOS4
      • 5: INTER_LANCZOS4
    • order for scikit-image
      • 0: Nearest-neighbor
      • 1: Bi-linear
      • 2: Bi-quadratic
      • 3: Bi-cubic
      • 4: Bi-quartic
      • 5: Bi-quintic

hd-celeba-cropper's People

Contributors

lynnho avatar kilotaras avatar

Watchers

Youngju Jaden Kim 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.