A newer version of the Streamlit SDK is available: 1.60.0
Installation Guide
EcoPulse requires Python 3.12+. To ensure a smooth installation and avoid version conflicts, we recommend using uv, a high-performance Python package and project manager.
Option 1: Using uv (Recommended)
uv will automatically handle the Python version specified in .python-version and manage the virtual environment for you.
Install
uv(if not already installed):curl -LsSf https://astral.sh/uv/install.sh | sh*(On Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex")Initialize the Environment: Navigate to the project root and run:
uv syncThis command will create a
.venv, install the correct Python version (3.12), and install all dependencies frompyproject.toml.Activate & Run:
uv run streamlit run app.py
Option 2: Using standard pip
If you prefer using standard pip, ensure you are on Python 3.12+.
Create a Virtual Environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activateInstall Dependencies:
pip install -r requirements.txt
Post-Installation Check
To verify the installation, run the integrated syntax check:
python -m compileall src scripts app.py
If no errors are returned, the system is ready for use.
Collaborator Onboarding
If you are joining the project as a developer, please follow these additional steps:
1. Dataset Acquisition
The data/ directory is ignored by Git due to its size. To run the full evaluation or training pipelines, you must:
- Download the EuroSAT (RGB) dataset and place it in
data/EuroSAT. - Download the DeepGlobe Land Cover dataset and place it in
data/DeepGlobe. - (Note: The Streamlit app will work for one-off image uploads even without these full datasets).
2. Model Weights
- The SAM ViT-H checkpoint (2.5GB) will be automatically downloaded to
outputs/models/the first time you run the pipeline. Ensure you have a stable internet connection for the initial run. - The ResNet-50 weights should be provided by the project lead or trained locally using
scripts/train_classifier.py.
3. Hardware Requirements
EcoPulse is optimized for NVIDIA GPUs (CUDA).
- VRAM: At least 8GB of VRAM is recommended for SAM ViT-H.
- CPU Fallback: If no GPU is detected, the system will fall back to CPU, but processing times for segmentation will increase significantly (from ~5s to ~60s+ per image).
Low-Power & Linux (Manjaro) Optimization
If you are presenting on a laptop with limited hardware or running a Linux distribution like Manjaro KDE, please note the following:
1. Scaling for Performance
If the laptop lacks a dedicated GPU or has limited VRAM, you can switch to a lighter version of the Segment Anything Model.
- Action: In
config/config.yaml, changesam_model_typefromvit_h(Huge) tovit_b(Base) and update thesam_checkpointpath accordingly. - Benefit: This significantly reduces VRAM usage and speeds up inference on weaker hardware.
2. Linux-Specific Dependencies (OpenCV)
On some Linux distributions (like Manjaro/Arch), OpenCV may require additional system libraries for GUI rendering. If you encounter an error related to libGL.so, run:
sudo pacman -S libglvnd
3. Pathing & Permissions
- EcoPulse uses
os.path.jointhroughout the codebase, ensuring it works seamlessly across Windows (\) and Linux (/). - Ensure the user running the app has read/write permissions for the
data/temp/andoutputs/directories.
4. Presentation Tip
Since loading the models (2.5GB+) can take time on a laptop, launch the Streamlit app before the presentation begins. This ensures the models are pre-cached in memory and ready for an instant demo.
Troubleshooting
Windows Issues
- Microsoft Visual C++ Build Tools:
Some dependencies (like
opencv-pythonorsegment-anything) may require C++ Build Tools during installation. If you see a "C++ Build Tools" error:- Download the Visual Studio Build Tools.
- Select "Desktop development with C++" during installation.
- Path Length Limits:
If you encounter errors related to long file paths, enable long paths in Windows:
- Run PowerShell as Admin:
New-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
- Run PowerShell as Admin:
Linux (Manjaro/Arch) Issues
- Missing libGL:
If
import cv2fails with alibGL.so.1error:- Run:
sudo pacman -S libglvnd
- Run:
- VRAM Issues with SAM:
If you get an
Out of Memory (OOM)error:- Change
sam_model_typetovit_binconfig/config.yaml. - Clear your cache in the Streamlit "System Controls" sidebar.
- Change
General Issues
- Python Version Mismatch:
Ensure
python --versionreturns 3.12.x. If usinguv, this is handled automatically. - Git Link Failures:
The
segment-anythingdependency is installed directly from GitHub. Ensuregitis installed and accessible in your terminal.