Experience the application here: Plant Detector on Render
β Note: This application is hosted on a free server, which may enter sleep mode when not in use. The first request might take a few seconds to wake up the server.
Plant Detector is an AI-powered web application designed to identify plant species from user-uploaded images. Utilizing advanced image recognition techniques, it provides users with quick and accurate plant identifications.
- β‘ Instant Analysis: Quickly identifies plant species from images.
- π€ AI-Powered: Leverages machine learning models for precise recognition.
- π¨ User-Friendly Interface: Simplified design for easy image uploads and results viewing.
Before installing, ensure you have the required dependencies:
-
Check if Python is installed:
python3 --version
If Python is not installed, you can install it using the terminal:
For Ubuntu/Debian:
sudo apt update && sudo apt install python3
For macOS (using Homebrew):
If Homebrew is not installed, install it using:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install python3
For Windows: Download and install it from Python's official site, then ensure
python3
is added to your system PATH. -
Check if pip is installed:
pip3 --version
If pip is missing, install it using:
python3 -m ensurepip --default-pip
-
Ensure Git is installed:
git --version
If Git is not installed, follow the instructions on Git's official website.
-
Clone the repository:
git clone https://github.com/Devehab/dream-interpretation.git cd dream-interpretation
-
Obtain a Google API Key:
- Visit Google AI Studio.
- Sign in with your Google account.
- Navigate to the API section and generate a new API key.
- Copy the generated API key.
-
Create a
.env
file and store the API key:- Open a terminal inside the project directory.
- In the terminal, navigate to your project directory and run the following command to create the
.env
file:touch .env
- Open the
.env
file with a text editor and add the following line:GOOGLE_API_KEY=your-api-key-here
- Save and close the file.
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install dependencies:
pip3 install -r requirements.txt
-
Run the application locally:
python3 app.py
You can deploy this application on a live server like Render by following these steps:
-
Create a Render account:
- Go to Render and sign up.
-
Create a new web service:
- Click on "New" -> "Web Service".
- Connect your GitHub repository and select
dream-interpretation
. - Choose the
Python
runtime and configure the environment.
-
Set up environment variables:
- In the Render dashboard, go to the "Environment" section.
- Add
GOOGLE_API_KEY
with your API key.
-
Define the start command:
gunicorn -w 4 -b 0.0.0.0:3000 app:app
-
Deploy and monitor:
- Click "Deploy" and wait for the build to complete.
- Your application will be live at the provided Render URL.
The fastest way to get up and running:
# Create a directory for the application
mkdir plant-detector
cd plant-detector
# Download only the compose.yml file from GitHub
curl -O https://raw.githubusercontent.com/Devehab/plant-detector/main/compose.yml
# Edit the compose.yml file to add your Google API key
# Replace 'your_api_key' with your actual Google API key
# Run with Docker Compose
docker compose up -d
This will pull the pre-built image from Docker Hub and start the application with all necessary configurations. Access the application at: http://localhost:3000
For Single Architecture:
docker build -t plant-detector .
For Multiple Architectures (AMD64 & ARM64):
# Create and use a buildx builder
docker buildx create --use
# Build and push the multi-architecture image
# Replace 'yourusername' with your Docker Hub username
docker buildx build --platform linux/amd64,linux/arm64 -t yourusername/plant-detector:latest --push .
This builds the image for both AMD64 (standard servers) and ARM64 (Mac M1/M2, Raspberry Pi) architectures. The
--push
flag uploads the image to Docker Hub. Remove it if you only want to build locally.
Using environment variable directly:
docker run -d -p 3000:3000 -e GOOGLE_API_KEY=your_api_key plant-detector
Or using .env file:
docker run -d -p 3000:3000 --env-file .env plant-detector
Open your browser and navigate to http://localhost:3000
# View running containers
docker ps
# Stop the container
docker stop <container_id>
# Remove the container
docker rm <container_id>
Once the application is running, open a web browser and go to http://127.0.0.1:3000
or the deployed Render URL. Enter your dream description and click the "Interpret" button to receive an analysis.
We welcome contributions! To contribute:
- Fork the repository by clicking on the "Fork" button at the top right.
- Create a new branch:
git checkout -b feature/your-feature-name
- Make your changes and commit them.
- Push the changes:
git push origin feature/your-feature-name
- Create a Pull Request on the original repository.
This project is licensed under the MIT License. For more details, see the LICENSE file.
π Feel free to open issues or discussions for suggestions and improvements!