|
1 | | -# deepforest-agent |
| 1 | +# DeepForest Multi-Agent System |
| 2 | + |
| 3 | +The DeepForest Multi-Agent System provides ecological image analysis by orchestrating multiple AI agents that work together to understand ecological images. Simply upload an image of a forest, wildlife habitat, or ecological scene, and ask questions in natural language. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +### 1. Clone the repository |
| 8 | + |
| 9 | +```bash |
| 10 | +git clone https://github.com/weecology/deepforest-agent.git |
| 11 | +cd deepforest-agent |
| 12 | +``` |
| 13 | + |
| 14 | +### 2. Create and activate a Conda environment |
| 15 | + |
| 16 | +```bash |
| 17 | +conda create -n deepforest_agent python=3.12.11 |
| 18 | +conda activate deepforest_agent |
| 19 | +``` |
| 20 | + |
| 21 | +### 3. Install dependencies |
| 22 | + |
| 23 | +```bash |
| 24 | +pip install -r requirements.txt |
| 25 | +pip install -e . |
| 26 | +``` |
| 27 | + |
| 28 | +### 4. Configure the HuggingFace Token |
| 29 | +Create a `.env` file in the root directory of the deepforest-agent project and add your HuggingFace token like below: |
| 30 | + |
| 31 | +```bash |
| 32 | +HF_TOKEN="your_huggingface_token_here" |
| 33 | +``` |
| 34 | + |
| 35 | +You can obtain your token from [HuggingFace Access Token](https://huggingface.co/settings/tokens). Make sure the Token type is "Write". |
| 36 | + |
| 37 | +## Usage |
| 38 | + |
| 39 | +The DeepForest Agent runs through a Gradio web interface. To start the interface, execute: |
| 40 | + |
| 41 | +```bash |
| 42 | +python -m deepforest_agent.app |
| 43 | +``` |
| 44 | + |
| 45 | +A link like http://127.0.0.1:7860 will appear in the terminal. Open it in your browser to interact with the agent. A public Gradio link may also be provided if available. |
| 46 | + |
| 47 | + |
| 48 | +## Features |
| 49 | + |
| 50 | +- **Multi-Species Detection**: Automatically detects trees, birds, and livestock using specialized DeepForest models |
| 51 | +- **Tree Health Assessment**: Identifies alive and dead trees using DeepForest Tree Detector whenever user asks. |
| 52 | +- **Visual Analysis**: Dual analysis of original and annotated images using Qwen2.5-VL-3B-Instruct model |
| 53 | +- **Memory Context**: Maintains conversation history for contextual understanding across multiple queries |
| 54 | +- **Ecological Insights**: Synthesizes detection data with visual analysis for comprehensive ecological understanding |
| 55 | +- **Streaming Responses**: Real-time updates as each agent processes your query |
| 56 | + |
| 57 | + |
| 58 | +## Requirements |
| 59 | + |
| 60 | +### Hardware Requirements |
| 61 | +- **GPU**: GPU with at least 24GB VRAM (recommended for optimal performance) |
| 62 | +- **Storage**: At least 16GB free space for model downloads |
| 63 | + |
| 64 | +### API Requirements |
| 65 | +- **HuggingFace Token**: Required for model access. |
| 66 | + |
| 67 | + |
| 68 | +## Models Used |
| 69 | + |
| 70 | +- **SmolLM3-3B**: For Memory, Detector, and Ecology agents for text understanding and generation |
| 71 | +- **Qwen2.5-VL-3B-Instruct**: Used in Visual agent for multimodal image-text understanding |
| 72 | +- **DeepForest Models**: For tree, bird, and livestock detection. Also used for alive/dead tree classification. |
| 73 | + |
| 74 | + |
| 75 | +## Multi-Agent Workflow |
| 76 | + |
| 77 | +[](https://mermaid.live/edit#pako:eNq9Vd1y2jgUfhWNbkuykJhu8HTaoRiStCUECElTkwvVPmBtbcmVZBJKMrPPso-2T7LHsg0m6XZmb5ZhPPb5-c53_qQNDWQI1KWLWN4HEVOGXHlzQfDX9WcaFJmlsWShJucJW8IdOTh4S977U9CaS0GGTKBUkZ4CZkCTUn5XILy31r0CZwoCUcYZqHWp7lm1549UEIE2ihmJZgY5aHIj1becUmlaPD3r0PeHkEi1Jt0lCPPmq_rtbVeweP0D4wdSrEBpZnJyEdeIuG5Yk1TBistMkxXXGYuJAp1KoUE3iJEyJgGLY11G69s4g80Z08TjCgJDukLfg7JICyUTclZgv3uq8xvkfo-3_ekjOfUHYIKI9BjmFhIPDKLkpDxmWBnm1IY58_uBjOWyns8EAuAr0C4pU8W8DDwY8sqqS9BwC4rJZLGp6J9Z3HN_arArCRlwrA6ZlPnevSR8MXokH_zroi62lJrrGhvEyQKTKQw5ykyamRLjg43z0Z8AKoV2rfHff_5VjAr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