How ailab-uniss/agora works
AGORA turns public-space images into per-person posture, activity, social-configuration, age, and sex annotations. Its primary workflow detects people, pads and clusters boxes, crops each cluster, generates visual descriptions, merges them into structured records, and can combine model outputs by voting. A separate GPT zero-shot mode analyzes full images directly. Post-processing utilities create and clean CSVs and evaluate predictions. The graph follows documented and excerpted calls; some unsampled pipeline and utility details are represented only where the README documents them.
Main entry points: pipeline.py Detection pipeline · gpt.py GPT analysis · gemini_api.py Gemini extraction · gpt_full.py GPT zero-shot
Components 26
Image workflows
- Detection pipeline
pipeline.py - GPT zero-shot
gpt_full.py
Vision models
- Faster R-CNN
models/fastrcnn.py - LLaVA descriptions
models/llava.py - GPT analysis
models/gpt.py - Gemini extraction
models/gemini_api.py - Majority voting
models/ensemble.py - Backend parsing
models/base.py
Detection and data
- Box padding
utils/bounding_box.py - IoU clustering
utils/clustering.py - Crop and annotate
utils/image_utils.py - Validated schemas
utils/schemas.py
Results and evaluation
- Result serialization
utils/utils.py - Prediction CSV
utils/csv_creator.py - CSV cleaning
utils/csv_cleaner.py - Metrics evaluation
utils/evaluate.py - JSON and CSV results
Shared support
- Settings and prompts
config/config.py - API retry
utils/retry.py - Logging
utils/logging_config.py
Other components
- Image analyst
- Ground-truth CSV
- Detectron2
- OpenAI API
- Gemini API
- Input images
Connections 42
- Image analyst → Detection pipeline: runs workflow
README.md - Image analyst → GPT zero-shot: runs direct analysis
README.md - Input images → Detection pipeline: provides images
README.md - Input images → GPT zero-shot: provides full image
gpt_full.py - Detection pipeline → Faster R-CNN: detects people
pipeline.py - Faster R-CNN → Detectron2: runs detection
models/fastrcnn.py - Detection pipeline → Box padding: pads boxes
pipeline.py - Detection pipeline → IoU clustering: clusters boxes
pipeline.py - Detection pipeline → Crop and annotate: crops clusters
pipeline.py - Detection pipeline → LLaVA descriptions: requests descriptions
pipeline.py - Detection pipeline → GPT analysis: selects describer or merger
pipeline.py - Detection pipeline → Gemini extraction: selects merger
pipeline.py - Detection pipeline → Backend parsing: parses extraction
pipeline.py - Detection pipeline → Majority voting: votes model results
README.md - Detection pipeline → Result serialization: saves analysis
pipeline.py - GPT zero-shot → OpenAI API: requests analysis
gpt_full.py - GPT zero-shot → Validated schemas: creates result
gpt_full.py - GPT zero-shot → Result serialization: saves JSON
gpt_full.py - LLaVA descriptions → Backend parsing: inherits interface
models/llava.py - GPT analysis → Backend parsing: inherits interface
models/gpt.py - Gemini extraction → Backend parsing: inherits interface
models/gemini_api.py - GPT analysis → OpenAI API: sends requests
models/gpt.py - Gemini extraction → Gemini API: sends requests
models/gemini_api.py - Backend parsing → Validated schemas: parses records
models/base.py - Majority voting → Validated schemas: votes annotations
models/ensemble.py - Faster R-CNN → Validated schemas: returns boxes
models/fastrcnn.py - Detection pipeline → Settings and prompts: reads settings
pipeline.py - GPT analysis → Settings and prompts: reads model settings
models/gpt.py - Gemini extraction → Settings and prompts: reads model settings
models/gemini_api.py - LLaVA descriptions → Settings and prompts: reads model settings
models/llava.py - GPT analysis → API retry: retries API calls
models/gpt.py - Gemini extraction → API retry: retries API calls
models/gemini_api.py - Detection pipeline → JSON and CSV results: produces results
- Result serialization → JSON and CSV results: writes JSON
utils/utils.py - JSON and CSV results → Prediction CSV: supplies predictions
README.md - Prediction CSV → JSON and CSV results: writes prediction CSV
README.md - Ground-truth CSV → CSV cleaning: supplies source CSV
README.md - JSON and CSV results → CSV cleaning: supplies prediction CSV
README.md - CSV cleaning → JSON and CSV results: writes cleaned CSV
README.md - JSON and CSV results → Metrics evaluation: supplies predictions
README.md - Ground-truth CSV → Metrics evaluation: supplies comparison data
README.md - Metrics evaluation → JSON and CSV results: writes metrics