Git Product home page Git Product logo

focusondepth's Introduction

Focus On Depth - A single DPT encoder for AutoFocus application and Dense Prediction Tasks

pytorch wandb scipy

Abstract

Depth estimation is a classic task in computer vision, which is of great significance for many applications such as augmented reality, target tracking and autonomous driving. We firstly summarize the deep learning models for monocular depth estimation. Secondly, we will implement a recent Vision Transformers based architecture for this task. We will seek to improve it by adding a segmentation head in order to perform multi-task learning using a customly built dataset. Thirdly, we will implement our model for in-the-wild images (i.e. without control on the environment, the distance and size of objects of interests, and their physical properties (rotation, dynamics, etc.)) for Auto-focus application on humans and will give qualitative comparison across other methods.

โšก New! Web demo

You can check the webdemo hosted on Hugging Face and powered by Gradio, here.

๐Ÿ“Œ Requirements

Run: pip install -r requirements.txt

๐Ÿš€ Running the model

You can first download one of the models from the model zoo:

๐Ÿฆ Model zoo

Get the links of the following models:

And put the .p file into the directory models/. After that, you need to update the config.json (Tutorial here) according to the pre-trained model you have chosen to run the predictions (this means that if you load a depth-only model, then you have to set type to depth for example ...).

๐ŸŽฏ Run a prediction

Put your input images (that have to be .png or .jpg) into the input/ folder. Then, just run python run.py and you should get the depth maps as well as the segmentation masks in the output/ folder.

๐Ÿ”จ Training

๐Ÿ”ง Build the dataset

Our model is trained on a combination of

๐Ÿ“ Configure config.json

Please refer to our config wiki to understand how to modify the config file to run a training.

๐Ÿ”ฉ Run the training script

After that, you can simply run the training script: python train.py

๐Ÿ“œ Citations

Our work is based on the work from Ranflt et al. please do not forget to cite their work! :) You can also check our report if you need more details.

@article{DPT,
  author    = {Ren{\'{e}} Ranftl and
               Alexey Bochkovskiy and
               Vladlen Koltun},
  title     = {Vision Transformers for Dense Prediction},
  journal   = {CoRR},
  volume    = {abs/2103.13413},
  year      = {2021},
  url       = {https://arxiv.org/abs/2103.13413},
  eprinttype = {arXiv},
  eprint    = {2103.13413},
  timestamp = {Wed, 07 Apr 2021 15:31:46 +0200},
  biburl    = {https://dblp.org/rec/journals/corr/abs-2103-13413.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

focusondepth's People

Contributors

antocad avatar younesbelkada 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.