Giter Site home page Giter Site logo

andrewhou1 / blindshadowremoval Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 2.0 171.87 MB

Official Github repository for "Blind Removal of Facial Foreign Shadows", accepted to BMVC 2022.

Home Page: https://bmvc2022.mpi-inf.mpg.de/

License: MIT License

Python 100.00%
shadow-removal foreign-shadow computer-vision face

blindshadowremoval's Introduction

Blind Removal of Facial Foreign Shadows

Official Github repository for "Blind Removal of Facial Foreign Shadows", accepted to BMVC 2022.

Yaojie Liu*, Andrew Hou*, Xinyu Huang, Liu Ren, Xiaoming Liu (* denotes equal contribution).

alt text

Dependencies

Our method has the following dependencies:

  1. Tensorflow 2.3.0
  2. Python 3.7.10
  3. OpenCV 4.7.0
  4. NumPy 1.18.5
  5. Tensorflow keras 2.4.0
  6. sklearn 0.24.2
  7. scipy 1.4.1
  8. matplotlib 3.4.2
  9. PIL 8.2.0
  10. skimage 0.18.1
  11. tensorflow_addons 0.13.0
  12. os, glob, time, sys, random, math, natsort, face-alignment

Preprocessing New Images

Before feeding an image to our method, use bmvc2022_dataprocess.py to compute landmarks for all images in the sample_uncropped_images/ folder. You can empty this folder initially and just place all of your images in (you only need .png, it will generate the .npy files that contain the landmarks).

Next, run dataprocess.py. This will generate a folder for each image in the sample_uncropped_images_cropped/ folder, where each folder contains the landmarks and a cropped image.

Note that these steps only need to be performed for new in-the-wild images. You do not need to preprocess any of the UCB test set or SFW images: this has already been done.

Testing Procedures

To test on in-the-wild images, place the resulting folder with your cropped image and landmarks in the sample_imgs/ folder and run:

python train_test_GSC.py

To run the SFW evaluation on shadow segmentation performance (AUC) and shadow removal performance, run:

python train_with_TSM.py

To test on the UCB test set, also run:

python train_test_GSC.py

You will need to change two lines in this file first. Change

DATA_DIR_TEST = ['sample_imgs/*'] to DATA_DIR_TEST = ['UCB/train/input/*']

and

fsr.testFFHQ(dataset_test) to fsr.test(dataset_test)

You will also need to change one line in dataset.py

Change dataset = dataset.map(map_func=self.parse_fn_test_FFHQ, num_parallel_calls=autotune) to dataset = dataset.map(map_func=self.parse_fn_test, num_parallel_calls=autotune)

SFW Dataset

Link to the original SFW video dataset: https://drive.google.com/file/d/1H4WFtDCGp4Bk1EeTjX1F_LXDmxxlxUHm/view?usp=share_link

Citation

If you utilize our code in your work, please cite our BMVC 2022 paper.

@inproceedings{ blind-removal-of-facial-foreign-shadows,
  author = { Yaojie Liu* and Andrew Hou* and Xinyu Huang and Liu Ren and Xiaoming Liu },
  title = { Blind Removal of Facial Foreign Shadows },
  booktitle = { In Proceedings of British Machine Vision Conference (BMVC) },
  address = { London, UK },
  month = { November },
  year = { 2022 },
}

Contact

If there are any questions, please feel free to post here or contact the first author at [email protected]

blindshadowremoval's People

Contributors

andrewhou1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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