Giter Club home page Giter Club 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 68 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

    • Python 3.6

  • Dataset

    • CelebA-unaligned (10.2GB, higher quality than the aligned data)

      • download the dataset

      • unzip the data

        7z x ./data/img_celeba.7z/img_celeba.7z.001 -o./data/
        
        unzip ./data/annotations.zip -d ./data/
  • Cropping Examples

    • 512x512 + lanczos4 + jpg

      python align.py --crop_size_h 512 --crop_size_w 512 --order 4 --save_format jpg --n_worker 32

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

      python align.py --crop_size_h 512 --crop_size_w 512 --order 4 --save_format png --face_factor 0.6 --n_worker 32

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

      python align.py --crop_size_h 384 --crop_size_w 384 --order 3 --save_format jpg --face_factor 0.3 --n_worker 32

  • Notice

    • order

      • 0: INTER_NEAREST

      • 1: INTER_LINEAR

      • 2: INTER_AREA

      • 3: INTER_CUBIC

      • 4: INTER_LANCZOS4

      • 5: INTER_LANCZOS4

hd-celeba-cropper's People

Contributors

lynnho avatar kilotaras 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.