GithubHelp home page GithubHelp logo

dormoyi / intercentrales Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 25 MB

Inter Centrales AI Competition 2022 Ayoub Bao Ines Valentin. Computer vision for data augmentation.

Python 89.22% C++ 1.19% Cuda 9.59%

intercentrales's Introduction

InterCentrales Competition 2022

Repository of Inter-Centrales 2022 AI competition: Ceteris Paribus Face Challenge: site of the competition.

alt text

To-Do list

  • Project images in latent space
  • Modify bounds of the direction
  • Find translations in latent space
  • Saving pipeline for direction
  • Solve bald issue
  • Detect and improve bad translations
  • Saving pipeline for edited images
  • Solve specific issues (manually or with other methods)
  • Fix artifacts (using original images)
  • Improve resolution (super resolution ?)

Quick Start

First create a new virtual environment and install all the required packages:

pip install -r requirements.txt

Then download the dataset of the competition available here: drive dataset

And unzip the content in the data/input_images folder.

Then you can run the script editor_API.py to start the image editing API. Don't forget to change the config at the beginning of the script if you want to use the flexible config.

python editor_API.py

Or if you are using a Nvidia GPU:

FORCE_NATIVE=1 python editor_API.py

To save the latent direction you want in the data/ folder, you can click on the 'Save' button. The name of the translation should follow the name convention:

  • for 'cursor' transformation (min - max): {carac}_{'min' or 'max'}. Example Be_min means cursor transformation to minimal bags under the eyes (Be_min).

  • for default transformation (transformation that doesn't depend on the current value of the caracteristic): {carac}_{new_value}. Example: Hc_0 means default transformation to black hair color (Hc_0)

  • for specific transformation (transformation that depends on the current value of the caracteristic) that will overwrite default transformation: {carac}_{new_value}_fr_{old_value}. Example A_0_fr_1 means specific transformation from intermediate age (A_1) to young age (A_0), 'fr' means 'from'.

All required transformations must be treated for all input caracterisics to make a valid submission.

Now, given an input image, the transformations to create caracterisitcs that are not in the initial image can automatically be got with the script utils/translation.py. Finally you can run the script tools/translate.py to generate the new images in a folder respecting the naming convention of the competition (the images are generated in data/{latent_dir}/edited_images/)

python tools/translate.py

Or if you are using a Nvidia GPU:

FORCE_NATIVE=1 tools/translate.py

Of course, you can generate only a subset of images or caracteristics by removing some latent vectors or by removing keys of the dictionary containing the translations.

If all the 72 images with all caracteristics are generated (1731 images in total), you can zip the folder containing the images and run the following script to check the submission (if all the required images are inside, with the good name, type, size...):

python tools/check_submission.py

AnyCost GAN tutorial

The tutorial of AnyCostGAN is in the file AnycostGAN tuto.md and the tutorial notebooks are in the notebooks folder. The original repository is here: AnyCosGAN. Note that the script demo.py was renamed to editor_API.py in this repository.

Commit message

Commit messages are written in present tense (e.g. :art: refactor training loop instead of :art: refactored training loop). They also start with one or two applicable emoji. This does not only look great but also makes you rethink what to add to a commit (one kind of action per commit!).

Make many but small commits!

Emoji Description
๐ŸŽ‰ :tada: Initial Commit
โœจ :sparkles: Add features
๐Ÿ”ฅ :fire: Remove code or feature
โž• :heavy_plus_sign: Add file (without adding features)
โž– :heavy_minus_sign: Remove file (without removing features)
๐Ÿชฒ :beetle: Fix bug
๐ŸŽจ :art: Improve structure/format of code (including PEP)
๐Ÿ“ :memo: Add/update docstring, comment or readme
โšก :zap: Improve performance
โœ๏ธ :pencil2: Fix typo
โœ… :white_check_mark: Add, update or pass tests
โฌ†๏ธ :arrow_up: Update dependency or requirements
๐Ÿ”ง :wrench: Add/update configuration or configuration files
๐Ÿšš :truck: Deplace or rename files or folders
๐Ÿšง :construction: Work in progress
๐Ÿ”€ :twisted_rightwards_arrows: Branch Merging
โช :rewind: Revert commit or changes
๐Ÿ’ฌ :speech_balloon: Unknown category

intercentrales's People

Contributors

valentingol avatar dormoyi 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.