Skip to content

bohniti/jigsaw-puzzle-solver

Repository files navigation

Langdon

Towards solving Jigsaw Puzzles out of Historical Fragments

Intro

Langdon, the most excellent puzzle solver of all time, is a jigsaw puzzle solver written in python. Langdon uses pytorch-lightning and partial convolution. I developed langdon while studying computer science at University of Erlangen Nuermberg.

The main contribution is the proposal of a deep siamese residual network architecture , called Langdong , designed for historical fragment matching. It is inspiered by the work of Pirrone et al.

Get the data

Raw

$wget https://zenodo.org/record/3893807/files/hisfrag20_train.zip?download=1 &&
$wget https://zenodo.org/record/3893807/files/hisfrag20_test.zip?download=1`

Prepared

You will find them in the data directory as csv-files which points to the original files.

Note: Preproceccing is will be performed online. The files just split the data and provides pairs for the siamiese approach.

Get the code

git clone https://github.com/bohniti/jigsaw-puzzle-solver

Get the results

Project-Report
Results-Notebook

Get requirenments

conda env create -f environment.yml -p /Users/beantown/PycharmProjects/jigsaw-puzzle-solver/conda-env &&
conda activate /Users/beantown/PycharmProjects/jigsaw-puzzle-solver/conda-env

Note: If you want to use another package manger, you have to mangage it py your own. Sorry.

Run it on you own

EDA and Preproceccing

(/Users/beantown/PycharmProjects/jigsaw-puzzle-solver/conda-env): $jupyter notebook ./notebooks/eda_preproceccing.ipynb

Main

(/Users/beantown/PycharmProjects/jigsaw-puzzle-solver/conda-env): $python3 main.py

Training configuration

(/Users/beantown/PycharmProjects/jigsaw-puzzle-solver/conda-env): $vim ./config/config_local.toml
...
...
(/Users/beantown/PycharmProjects/jigsaw-puzzle-solver/conda-env): $vim./config/config_local.toml

Results

(/Users/beantown/PycharmProjects/jigsaw-puzzle-solver/conda-env): $tensorboard --logdir ./results/default/version_X

Note: You can change directory in config files. So, you must change it in the tensorboard command as well.

Custom steps

from langdon.core import some_steps


def custom_init_step():
    ...
    return config, transform, model


def main():
    config, transform, model = custom_init_step()
    train_dataloader, val_dataloader = load_step(config, transform)
    tb_logger = log_step(config)
    train_step(config, model, train_dataloader, val_dataloader, tb_logger)


if __name__ == "__main__":
    main()

Note: step-functions must return the same as the original step-function. Not tested yet, sorry.

License

Pretty much the BSD 3-Clause License, just don't repackage it and call it your own please!
Also if you do make some changes, feel free to make a pull request and help make things more awesome!

Get in touch

If you have any support requests please feel free to email me.
Otherwise, feel free to follow me on Twitter!

Special Thanks

Many thanks to all supervisors for their excellent supervising, patience, and collecting the data:

Dr.-Ing. Vincent Christlein
Mathias Seuret, M. Sc.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages