{"id":49245337,"url":"https://github.com/flybits/context-aware-sgg","last_synced_at":"2026-04-24T21:11:27.854Z","repository":{"id":289130967,"uuid":"970142148","full_name":"flybits/context-aware-sgg","owner":"flybits","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-21T18:22:53.000Z","size":23142,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-21T18:25:51.136Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flybits.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-21T14:43:56.000Z","updated_at":"2025-04-21T18:06:18.000Z","dependencies_parsed_at":"2025-04-21T18:36:26.065Z","dependency_job_id":null,"html_url":"https://github.com/flybits/context-aware-sgg","commit_stats":null,"previous_names":["flybits/context-aware-sgg-public"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/flybits/context-aware-sgg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flybits%2Fcontext-aware-sgg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flybits%2Fcontext-aware-sgg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flybits%2Fcontext-aware-sgg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flybits%2Fcontext-aware-sgg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flybits","download_url":"https://codeload.github.com/flybits/context-aware-sgg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flybits%2Fcontext-aware-sgg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32240706,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-24T21:11:27.154Z","updated_at":"2026-04-24T21:11:27.849Z","avatar_url":"https://github.com/flybits.png","language":"Jupyter Notebook","readme":"# Context-Aware Scene Graph Generation\n\n**Official Repository for the Paper:**  \n📄 *Enabling Perspective-Aware Ai with Contextual Scene Graph Generation*  \n👨‍💻 Daniel Platnick\\*,†, Marjan Alirezaie\\*,†, Hossein Rahnama  \n🏢 Flybits Labs, Toronto Metropolitan University · MIT Media Lab  \n📅 Published in *Information* 2024, 15(12), 766  \n🔗 [DOI: 10.3390/info15120766](https://doi.org/10.3390/info15120766)  \n\n\\* Authors contributed equally · † Correspondence: daniel.platnick [at] flybits.com\n\n---\n\n## 🧠 Overview\n\nThis repository introduces **Perspective-Aware Scene Graph Generation with LLM Post-Processing (PASGG-LM)**, a pipeline for the novel task of **context-aware scene graph generation (SGG)**. It enhances traditional scene graph models by post-processing their outputs with Large Language Models (LLMs), inferring deeper context such as emotion, ambience, and social context. PASGG-LM was developed to support **Perspective-Aware AI (PAi)** research.\n\n\nThe paper evaluates existing SGG systems such as **Motifs**, **Motifs-TDE**, and **RelTR** to highlight their limitations in supporting PAi, and then extends these frameworks to enable Context-Aware Scene Graph Generation. To evaluate existing SGG systems, we introduce a new semantic evaluation metric called the **PAi Similarity Score (PSS)** and use it to highlight the limitations of current SGG models for PAi.\n\n---\n## 🧩 Codebase Foundation and Setup\n\nThis repository builds on two well-established scene graph generation (SGG) frameworks:\n\n- **[Scene-Graph-Benchmark.pytorch](https://github.com/KaihuaTang/Scene-Graph-Benchmark.pytorch)**\n- **[RelTR](https://github.com/yrcong/RelTR)**\n\nBoth frameworks come with their own configurations and dependencies. In order to isolate their environments and avoid conflicts, please follow these steps:\n\n1. **Create Separate Environments for SGG Frameworks:**\n   - **Environment 1:** Install and configure dependencies for *Scene-Graph-Benchmark.pytorch*.\n   - **Environment 2:** Install and set up dependencies for *RelTR*.\n   \n2. **Setup the LLM Post-Processing Environment:**\n   - **Environment 3:** Create a separate environment dedicated to performing LLM-based post-processing on SGG model outputs. \n   \n\nFrom the directory where environment.yml is located:\n```bash\nconda env create -f environment.yml\nconda activate llm-postprocessing\n```\n\n\n3. **Switching Between Environments:**\n   - When running experiments or evaluations with a specific SGG framework, activate the corresponding virtual environment (Environment 1 for Scene-Graph-Benchmark.pytorch or Environment 2 for RelTR) to ensure that the correct dependencies are used.\n   - When performing LLM-based post-processing, activate Environment 3.\n   - Use your environment activation command (for example, `source \u003cenv-name\u003e/bin/activate`) to switch between these environments as needed.\n\n\nFollowing these instructions will help keep the dependencies isolated, ensuring that experiments run smoothly without conflicts.\n\n\n---\n\n## 📁 Directory Structure\n\n\n```bash\n├── 📁 context-aware-sgg/\n│   ├── 📁 images/\n│       ├── pasgg-example-output.png\n│   ├── 📁 llm-postprocessing/\n│       ├── 📁 finetune-raw-data/\n│       ├── 📁 finetune/\n│       ├── llm_utils.py\n│       ├── run_llm.py\n│       ├── training_data.jsonl\n│       ├── tuned_inference.py\n│   ├── 📁 models/\n│       ├── 📁 Scene-Graph-Benchmark.pytorch/\n│       ├── 📁 reltr/\n│   ├── README.MD\n│   ├── environment.yml\n│   ├── LICENSE\n```\n\n---\n\n## 🤖 Example Context-Aware Scene Graph Generation\n\n\n![Neural-Motifs-TDE (baseline) vs. PASGG-LM (ours)](./images/pasgg-example-output.png)\n\n\n\n## 📑 Citing the Paper\n\nIf our work is helpful for your research, please cite our publication:\n```bash\n@article{platnick2024pasgg,\n  title={Enabling Perspective-Aware Ai with Contextual Scene Graph Generation},\n  author={Platnick, Daniel and Alirezaie, Marjan and Rahnama, Hossein},\n  journal={Information},\n  volume={15},\n  number={12},\n  pages={766},\n  year={2024},\n  publisher={MDPI}\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflybits%2Fcontext-aware-sgg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflybits%2Fcontext-aware-sgg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflybits%2Fcontext-aware-sgg/lists"}