Coder Social home page Coder Social logo

biringachi / pif Goto Github PK

View Code? Open in Web Editor NEW
11.0 4.0 2.0 392.8 MB

Predictive Frame Interpolation (PIF) Model for video frame prediction and generation. An AI model that could infer a new frame between two existing sequential frames of a video We trained a GAN using youtube footage to predict it’s own existing frames

License: Apache License 2.0

Python 100.00%
image-processing encoder-decoder-model generative-adversarial-network frame-interpolation convolutional-neural-networks

pif's Introduction

Predictive Frame Inference (PIF) Model

License

PIF-Model is licensed under Apache Software License, Version 2.0.

Authors

Installation

$ git clone https://github.com/biringaChi/PIF-Model
$ sudo pip3 install -r requirements.txt

Description

In this project, we built an AI model that could infer a new frame between two existing sequential frames of a video We trained a GAN neural network framework using youtube footage to predict it’s own existing frames The model which was created was able to infer new frames from high definition videos

Methodology

  • Model

    • Trained using GAN
    • Convolutional Neural Network Model with multiple input
    • Images are encoded and decoded
  • Tools / Resources

    • PyTorch was used to build the models
    • Royalty-free videos was collected from Youtube
  • Performance Measure

    • Pixels distance was used as a potential loss for the generator and metric to measure difference
    • BSE was used as the loss for the model
  • Dataset

    • Videos was split into subset of 3 continuous frames
    • The model will be trained to predict the current frame by using the previous and next frame in the video
    • The model was able to generate new frames from the data distribution
    • Stitching technique was implemented to build the videos

Run Sample

$ cd data_prep/
$ python3 data_sample.py

data_sample

32 samples from dataset
  • Scene Detection
    • Contiguous frame sequences were used by comparing the difference each scene to the next using
    • The spikes indicate transitions or new scenes. These were used as markers to tell the model where not to infer new frames

Results

Run Model

$ cd inference/
$ python3 infer.py

data_sample

Inferred Frames from Model
  • Generator and discriminator in a GAN model cause severe loss when creating new frames
  • Theorized backpropagation through the generator and discriminator was causing information to be lost.
  • The model was modified to exclude the discriminator and only back propagate the generator

Inferred Sequences from new Model

data_sample

Performance

data_sample

Video Frames Difference
  • The predominant difference between the original video frames and the generated is in the pixel intensity distribution
  • We captured the overall objects and structure of the frames

Final Video Generation

Original

Generated

pif's People

Contributors

biringachi avatar rjthompson22 avatar wzjoriv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

brahimmade padlab

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.