GithubHelp home page GithubHelp logo

tbanas2 / morpher_generator Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 80.28 MB

A fun utility to auto-generate gif sequences of face morphs that uses a convolutional neural network and triangulation.

Jupyter Notebook 99.74% Python 0.26%

morpher_generator's Introduction

ComputationalPhotography-Course-Project

Computational Photography Course Project- Spring2023

Project Team

  • Luke Banaszak
  • Sakshi Maheshwari
  • Rick Suggs
  • Yitian Tang

Table of Contents

Installing Dependencies

The project was created with Python 3.10 and has not been tested with any other version.

The Python dependencies can be installed by running the following command in the project directory.

pip install -r requirements.txt

Training PyTorch models can take a long time. If your computer is equipped with a GPU, that time could be reduced significantly. However, you may need to install different dependencies. See PyTorch - Get Started for instructions on installing GPU support on your computer.

For example, on Windows with Nvidia GPU, CUDA support can be enabled by first uninstalling Pytorch, then reinstalling with the compiled CUDA binaries:

pip uninstall torch torchvision
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu117

Modules

Final_notebook.ipynb

The notebook begins with a simple set of cells to use the product's main functionality to generate a morphing GIF from a directory of jpg images.

The notebook then provides end to end examples of training the PyTorch models, all the way through generating a morph sequence from automatically predicted keypoints from multiple images.

morpher.py

Class definition that generates a morph sequence from a directory of images.

NeuralNet/train_cnn_resnet50.ipynb

Notebook covers results from training the pretrained Resnet 50 PyTorch model on the IMM Image Database Our trained model file for the IMM Image Database is larger than the Github file limit, but can be downloaded from here

NeuralNet/train_cnn_resnet50_ibug.ipynb

Notebook covers results from training the pretrained Resnet 50 PyTorch model on the IBug Image Database Our trained model file for the IBug Image Database is larger than the Github file limit, but can be downloaded from here

NeuralNet/cnn_utils.py

Module of utility functions used for training PyTorch models.

NeuralNet/face_classifier.py

Module of PyTorch Transforms and DataLoaders used for training PyTorch models.

NeuralNet/Models/resnet.py

Class definitions for pretrained Resnet 50 PyTorch models.

NeuralNet/Models/simpleModel.py

Class definitions for custom PyTorch models.

FaceMorphing/morphing.ipynb

Notebook covers manually defined correspondence points, creating morphing animations from multiple images, and experimenting with a population of images.

FaceMorphing/morphing_utils.py

Module of utility functions used for warping and morphing.

facial_keypoint_detection/1_load_and_visualize_data.ipynb

Notebook covers loading and visualizing data from the YouTube Faces Dataset

facial_keypoint_detection/2_define_the_network_architecture.ipynb

Notebook covers PyTorch CNN instantiation for YouTube Faces Dataset

facial_keypoint_detection/3_facial_keypoint_detection_complete_pipeline.ipynb

Notebook covers PyTorch CNN completed pipeline for YouTube Faces Dataset

facial_keypoint_detection/data_load.py

Module for YouTube Faces Dataset PyTorch DataLoader

facial_keypoint_detection/models.py

Module for YouTube Faces Dataset PyTorch Models

References

Course Content from CS445

Lesson 6.1 - Image Morphing

Programming Assignments from other Computational Photography courses

UC Berkeley: Facial Keypoint Detection with Neural Networks

UC Berkeley: Face Morphing

Papers

[1805.04140] Neural Best-Buddies: Sparse Cross-Domain Correspondence

[1512.03385] Deep Residual Learning for Image Recognition

Open Source Datasets

The IMM Face Database - An Annotated Dataset of 240 Face Images (download links)

Resnet50 Pretrained PyTorch Model

i·bug - resources - Facial point annotations

Open Source Code

nalbert9/Facial-Keypoint-Detection: Computer vision

Neural Best-Buddies: Sparse Cross-Domain Correspondence

Tutorials & Blog Articles

Neural Networks — PyTorch Tutorials 2.0.0+cu117 documentation

Writing Custom Datasets, DataLoaders and Transforms — PyTorch Tutorials 2.0.0+cu117 documentation

Deep Learning with PyTorch: A 60 Minute Blitz

Transfer Learning for Computer Vision Tutorial

Facial KeyPoint Detection with Pytorch | by Antonio Linares | Analytics Vidhya | Medium

Face Landmarks Detection With PyTorch | by Abdur Rahman Kalim | Towards Data Science

Setting the learning rate of your neural network.

Drawing Loss Curves for Deep Neural Network Training in PyTorch | by Niruhan Viswarupan

Multivariate data interpolation on a regular grid (RegularGridInterpolator) — SciPy v1.10.1 Manual

An Introductory Guide to Deep Learning and Neural Networks (Notes from deeplearning.ai Course #1)

Improving Neural Networks – Hyperparameter Tuning, Regularization, and More (deeplearning.ai Course #2)

A Comprehensive Tutorial to learn Convolutional Neural Networks from Scratch (deeplearning.ai Course #4)

Getting Started with Facial Keypoint Detection using Deep Learning and PyTorch

Advanced Facial Keypoint Detection with PyTorch

OpenCV: Cascade Classifier

StackOverflow

plot training and validation loss in pytorch - Stack Overflow

Wikipedia

Convolutional neural network - Wikipedia

API References

scipy.interpolate.RegularGridInterpolator — SciPy v1.10.1 Manual

scipy.spatial.Delaunay — SciPy v1.10.1 Manual

Module: draw — skimage v0.20.0 docs

numpy.linalg.solve

numpy.linalg.lstsq

Image sources (President Obama and Clooney images were snipped from the doc)

https://inst.eecs.berkeley.edu/~cs194-26/fa17/upload/files/proj4/cs194-26-abc/

morpher_generator's People

Contributors

tbanas2 avatar

Watchers

Kostas Georgiou 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.