Code Monkey home page Code Monkey logo

jigsaw-net's Introduction

Jigsaw-Net

Solving jigsaw puzzles with deep CNN's .

A jigsaw puzzle is a tiling puzzle that requires the assembly of often oddly shaped interlocking and tessellating pieces. Each piece usually has a small part of a picture on it; when complete, a jigsaw puzzle produces a complete picture.

Problem statement: Given an source image of size NxN and shuffled image with block size of BxB, our aim is to unscramble the shuffled jigsaw image to produce the original image.Here we limit ourselves to square shaped images where the tessellating pieces have equal height and width.The blocks should be square shaped and can have four possible orientations i.e rotations in degrees - {90,180,270,360}.

A direct permutation based approach to solve the puzzle will require an algorithm with exponential time complexity.Here we use a simple encoder-decoder based CNN with two heads for block shuffling and block rotations respectively, for solving the jigsaw puzzle in real-time.

You may run the entire training, testing and data preparartion in Google Colaboratory with the IPython notebook.

N.B: Install the correct version of keras to train the network. Also ensure sufficient ram is available, since we will be loading our full data-set into memory(currently) at the start of training.

Dependencies

  • Python3
  • PIL, matplotlib
  • Scipy, skimage
  • Tensorflow
  • Keras 2.2.2

Prerequisites

  • Keras installation (TF backend)
  • GPU with CUDA support
pip install keras==2.2.2

Demo

How to run

python data.py # Prepare the dataset
python train.py # Train the network
python infer.py # Perform inference

Training Graphs

Screenshot

Screenshot

Network

Screenshot

Sample Input

Screenshot

Sample Output

Screenshot

Versioning

Version 1.0

Authors

Anil Sathyan

Acknowledgments

jigsaw-net's People

Contributors

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