This project provides an AI-powered API for analyzing Indian indigenous cow breeds (desi cows). It utilizes Google's Gemini AI models to process both text and image-based inputs, offering insights into cow breeds, breeding programs, A2 milk benefits, and basic veterinary observations. The API is designed to help farmers, researchers, and enthusiasts gain knowledge about Indian cow breeds and their health conditions.
- Image Analysis: Accepts a base64-encoded image of a cow and provides observations about potential health conditions based on visible symptoms.
- Text-Based Querying: Provides information on Indian cow breeds, breeding conditions, A2 milk benefits, and conservation programs.
- Chat-Based Interaction: Supports interactive conversations about Indian cow breeds.
To set up the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/GauSampada/ai-model cd ai-model -
Create a virtual environment (optional but recommended):
python3 -m venv env source env/bin/activate # On Windows, use `env\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up environment variables:
- Create a
.envfile in the project directory and add:GOOGLE_API_KEY=your_google_api_key
- Create a
Run the Flask app using:
python app.pyThis will start the API on http://0.0.0.0:5000.
- Endpoint:
/ - Method:
GET - Description: Returns a welcome message.
- Endpoint:
/image_to_text - Method:
POST - Request Body:
{ "image_base64": "<base64-encoded-image>", "prompt": "Analyze this cow image." } - Response: AI-generated insights about the cow’s health.
- Endpoint:
/text_to_text - Method:
POST - Request Body:
{ "prompt": "Tell me about Gir cows." } - Response: Detailed information about Indian cow breeds.
- Endpoint:
/text_to_text_chat - Method:
POST - Request Body:
{ "prompt": "Which Indian cow breed is best for milk production?" } - Response: AI-powered interactive chat response.
We welcome contributions! To contribute:
- Fork the repository.
- Create a new branch for your feature.
- Commit your changes with clear messages.
- Push to your branch and create a pull request.
This project leverages Google's Gemini AI for content generation and analysis.