inuwamobarak / TikTok-depth-anything

State-of-the-art monocular depth estimation (MDE) model from TikTok, in collaboration with the University of Hong Kong, Zhejiang Lab, and Zhejiang University, has open-sourced Depth Anything, inviting collaboration from the community!

Home Page:https://www.analyticsvidhya.com/blog/2024/04/building-a-modern-app-with-tiktoks-depth-anything-depth-estimation-model/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TikTok-depth-anything

This project demonstrates the integration of TikTok's "Depth Anything" monocular depth estimation model into a web application using Flask. The web app allows users to generate depth estimation for images, with a download option for the generated depth image.

image_90unhlp-thumbnail_webp-600x300-ezgif com-webp-to-jpg-converter

Table of Contents

Introduction

The web application leverages TikTok's "Depth Anything" model, a state-of-the-art monocular depth estimation (MDE) model. It utilizes Flask as the web framework to provide a user-friendly interface for generating depth estimations.

Setup

  1. Clone the Repository:

    git clone <repository_url>
    cd depth-estimation-webapp-flask
  2. Create a Virtual Environment:

    python -m venv venv
  3. Activate the Virtual Environment:

    • For Windows:
      .\venv\Scripts\activate
    • For Linux/Mac:
      source venv/bin/activate
  4. Install Dependencies:

    pip install -r requirements.txt

Usage

  1. Run the Flask App:

    python app.py
  2. Open your web browser and visit http://localhost:5000 to access the Depth Estimation WebApp.

  3. Upload an image or provide an image URL to generate the depth estimation. Download the generated depth image using the provided button.

Project Structure

  • app.py: The main Flask application file.
  • templates/: Contains HTML templates for rendering pages.
  • static/: Includes static files such as stylesheets.
  • depth_estimation.py: Depth estimation functionality and integration.
  • requirements.txt: List of project dependencies.
  • images
  • notebooks

Dependencies

  • Flask
  • Pillow
  • NumPy

Install dependencies using the command:

pip install -r requirements.txt

## Running Docker container(run command in the terminal):

docker build -t depth-estimation-app .
docker run -p 5000:5000 depth-estimation-app

## Acknowledgements

This project utilizes TikTok's "Depth Anything" model. Special thanks to TikTok and the collaborating institutions for open-sourcing the model.

About

State-of-the-art monocular depth estimation (MDE) model from TikTok, in collaboration with the University of Hong Kong, Zhejiang Lab, and Zhejiang University, has open-sourced Depth Anything, inviting collaboration from the community!

https://www.analyticsvidhya.com/blog/2024/04/building-a-modern-app-with-tiktoks-depth-anything-depth-estimation-model/


Languages

Language:Jupyter Notebook 99.2%Language:HTML 0.6%Language:Python 0.2%