Spaces:
Sleeping
Sleeping
Python Backend Setup Guide
Environment Variables Setup
The Python backend requires Cloudinary credentials to be configured. You can set these up in two ways:
Option 1: Environment Variables
Set the following environment variables in your system:
export CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
export CLOUDINARY_API_KEY=your_cloudinary_api_key
export CLOUDINARY_API_SECRET=your_cloudinary_api_secret
Option 2: .env File
Create a .env file in the python_backend directory with the following content:
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
Replace your_cloudinary_cloud_name, your_cloudinary_api_key, and your_cloudinary_api_secret with your actual Cloudinary credentials.
Installation
- Install the required dependencies:
pip install -r requirements.txt
- Run the FastAPI server:
python app.py
The server will start on http://localhost:5000
API Endpoints
POST /api/exif_metadata- Extract EXIF metadata from imagesPOST /api/damage_detection- Detect crop damage from imagesPOST /api/crop_type- Identify crop type from imagesPOST /predictForCrop- Predict crop yieldPOST /futureWeatherPrediction- Get weather predictions and claim recommendations