Welcome to the Zoe Depth Estimation API repository. This project utilizes deep learning to estimate depth from single images, leveraging the power of PyTorch and FastAPI for efficient and scalable depth estimation services.
- Single Image Depth Estimation: Predicts depth from a single RGB image.
- FastAPI Integration: Provides a seamless and high-performance API for easy integration into various applications.
- PyTorch-based Model: Utilizes a pre-trained depth estimation model in PyTorch for accurate and efficient predictions.
- Docker Support: Dockerfile included for easy containerization and deployment.
Follow these instructions to set up and run the Zoe Depth Estimation API on your local machine.
Ensure you have the following installed:
- Python 3.8+
- Docker (optional, for containerized deployment)
-
Clone the repository:
git clone https://github.com/recepayddogdu/Zoe-Depth-Estimation-API.git cd Zoe-Depth-Estimation-API
-
Create and activate a virtual environment (optional but recommended):
python3 -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
This project uses a .env
file to manage configuration variables. Below are the steps to set up the .env
file:
-
Create a
.env
file in the root directory of the project:touch .env
-
Add the required configuration variables to the
.env
file. Here is an example of what the.env
file might contain:# .env IMGBB_API_KEY=your_api_key_here
IMGBB_API_KEY
: Your API key for authenticating requests to the IMGBB service.
-
Run the FastAPI server:
uvicorn main:app --reload
-
Access the API:
Open your browser and navigate to
http://127.0.0.1:8000/docs
to see the interactive API documentation provided by FastAPI Swagger UI. -
Test the API:
You can use tools like
curl
,Postman
, or the FastAPI docs interface to test the endpoints. For example, to estimate depth from an image:curl -X 'POST'\ 'http://127.0.0.1:8000/predict'\ -H 'accept: application/json'\ -H 'Content-Type: multipart/form-data'\ -F 'file=@path_to_your_image'
To run the API in a Docker container, follow these steps:
-
Build the Docker image:
docker build -t zoe-depth-estimation-api .
-
Run the Docker container:
docker run -d -p 8041:8041 zoe-depth-estimation-api
-
Access the API:
Open your browser and navigate to
http://127.0.0.1:8041/docs
.
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature/YourFeature
). - Create a new Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or suggestions, please contact:
- Recep Aydoğdu - Email
- GitHub: recepayddogdu