Code Monkey home page Code Monkey logo

dense-depth-estimation's Introduction

Dense Depth Estimation for Historic Images

This project consists of a tool to generate dense depth maps from images, specialized on historic imgae material. Additionally it consists of the evaluation of said tool and estimation of the accuracy of the results.

The Develop folder has scripts for training, testing and avaluating the model.

Requirements

  • Python 3.4 - 3.7. Does not work with Python 3.8 due to a limitation in TensorFlow.
  • GPU with CUDA support.
  • 4GB of VRAM for training with batch size 2. More for larger batches.

Installation

Run pip install . in the root folder. That's it.

Demo

The script Demo/demo.py shows how to predict the depth of an individual image. If it is run outside of the Demo directory it is ncessary to specify the path to the model and the test image with the parameters --model and --input respectively.

Training

Develop/train.py --bs 2 --epochs 5 --lr 1e-5 --data DIODE --checkpoint model.h5

The script is able to load data from the DIODE dataset and train the model on it. The path to the folder containing the uncompressed image, depth and mask files must be specified using the --data parameter. The batch size, number of epochs and learning rate may be specified using the --bs, --epochs and --lr parameters respectively. Training can be continued from an existing checkpoint using the --checkpoint parameter.

Testing

Develop/test.py --model model.h5 --input examples --scale 150

Creates a visualization of the model output using the images in the folder specified by --input. The model is specified by the --model parameter. The --scale specifies the maximum depth used for the color coding. The visualization is stored as an image called test.png.

Evaluation

Develop/evaluate.py --gt --path diode_test --model model.h5

Calculates the real RMSE and the estimated RMSE using the model specified in the --model parameter. The folder containing all the test data is specified using the --path parameter. The real RMSE can only be calculated if the ground truth is present in the specified folder and is only calculated if --gt is present. It can be useful to specify a folder containing only images without ground truth to calculated the estimated RMSE.

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.