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.
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.
-
Clone the Repository:
git clone <repository_url> cd depth-estimation-webapp-flask
-
Create a Virtual Environment:
python -m venv venv
-
Activate the Virtual Environment:
- For Windows:
.\venv\Scripts\activate
- For Linux/Mac:
source venv/bin/activate
- For Windows:
-
Install Dependencies:
pip install -r requirements.txt
-
Run the Flask App:
python app.py
-
Open your web browser and visit
http://localhost:5000
to access the Depth Estimation WebApp. -
Upload an image or provide an image URL to generate the depth estimation. Download the generated depth image using the provided button.
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
- 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.