Giter Site home page Giter Site logo

lucifer99966623 / pix2pix-next-frame-prediction Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rystylee/pix2pix-next-frame-prediction

0.0 0.0 0.0 18.86 MB

pix2pix-Next-Frame-Prediction generates video by recursively generating images with pix2pix.

License: MIT License

Python 100.00%

pix2pix-next-frame-prediction's Introduction

pix2pix-Next-Frame-Prediction

Description

pix2pix-Next-Frame-Prediction generates video by recursively generating images with pix2pix.
We use the memo's script for training and prediction.

training : affinelayer/pix2pix-tensorflow
prediction : memo/webcam-pix2pix-tensorflow

ToDo

Demo

Source : https://vimeo.com/223771736

Dependence

  • ffmpeg

Usage

Create Dataset

  1. Split movie to image sequence
python create_dataset.py data/XXX.mp4 data/XXX 30 png
  1. Resize source images
python pix2pix/tools/process.py --input_dir data/XXX --operation resize --output_dir data/resized
  1. Copy the file at step2
cp -r data/resized data/resized2
  1. Delete image_0000.png of resized2 and image_xxxx.png(last image) of resized1

  2. Rename the images

python rename.py data/resized
python rename.py data/resized2
  1. Combine resized 2 set of images
python pix2pix/tools/process.py --input_dir data/resized --b_dir data/resized2 --operation combine --output_dir data/combined
  • Split into train/val set
python pix2pix/tools/split.py --dir data/combined

Training

python pix2pix/pix2pix.py --mode train --output_dir dst_path --max_epochs 200 --input_dir data_path --which_direction AtoB

Generate image sequence

python generate.py models/XXX.json generate/src generate/dst num_itr

Generate movie

  1. combine
ffmpeg -r 30 -i generate/dst/%04d.png -vcodec libx264 -pix_fmt yuv420p -r 30 movie.mp4
  1. Resize
ffmpeg -i movie.mp4 -vf scale=640:-1 m.mp4

Reference

Licence

MIT

pix2pix-next-frame-prediction's People

Contributors

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