ShubhamKannaujiya/scene_graph_enrichment

0

stars

5

commits

Python

primary language

Apr 2, 2026

updated

README

Scene Graph Enrichment Pipeline

A Vision-Language Model (VLM) pipeline for enriching Visual Genome scene graphs with causal effects, counterfactual modifications, and intent analysis using Gemma-3-12B.


πŸ“ Folder Structure

project/
β”œβ”€β”€ scn_vision.py              # Main pipeline script
β”œβ”€β”€ README.md                  # This file
β”œβ”€β”€ requirements.txt           # Python dependencies
β”‚
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ cleaned_vg.jsonl       # Input scene graphs (Visual Genome)
β”‚   └── imagery/               # Image directory (image_id.jpg files)
β”‚
└── output/
    └── scene_graphs_gemma3_1.jsonl  # Generated enriched scene graphs

πŸš€ Quick Start

1. Clone/Setup

cd /path/to/project

2. Install Dependencies

pip install -r requirements.txt

3. Prepare Data

  • Place your cleaned_vg.jsonl in data/ directory
  • Place images in data/imagery/ (named as {image_id}.jpg)

4. Run Pipeline

python scn_vision.py

πŸ“€ Output Format

Output JSONL (scene_graphs_gemma3_1.jsonl):

{
  "image_id": "123456",
  "data": [
    {
      "triplet": ["person", "holding", "gun"],
      "causal": {
        "effect": "threat_increase",
        "type": "risk",
        "score": 0.9,
        "intent_context": "intimidate"
      },
      "counterfactual": {
        "modified_triplet": ["person", "holding", "book"],
        "new_effect": "safer",
        "change": "decrease"
      },
      "intent": "intimidate"
    }
  ]
}

Contributors

ShubhamKannaujiya/scene_graph_enrichment

0

stars

5

commits

Python

primary language

Apr 2, 2026

updated

README

Scene Graph Enrichment Pipeline

A Vision-Language Model (VLM) pipeline for enriching Visual Genome scene graphs with causal effects, counterfactual modifications, and intent analysis using Gemma-3-12B.


πŸ“ Folder Structure

project/
β”œβ”€β”€ scn_vision.py              # Main pipeline script
β”œβ”€β”€ README.md                  # This file
β”œβ”€β”€ requirements.txt           # Python dependencies
β”‚
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ cleaned_vg.jsonl       # Input scene graphs (Visual Genome)
β”‚   └── imagery/               # Image directory (image_id.jpg files)
β”‚
└── output/
    └── scene_graphs_gemma3_1.jsonl  # Generated enriched scene graphs

πŸš€ Quick Start

1. Clone/Setup

cd /path/to/project

2. Install Dependencies

pip install -r requirements.txt

3. Prepare Data

  • Place your cleaned_vg.jsonl in data/ directory
  • Place images in data/imagery/ (named as {image_id}.jpg)

4. Run Pipeline

python scn_vision.py

πŸ“€ Output Format

Output JSONL (scene_graphs_gemma3_1.jsonl):

{
  "image_id": "123456",
  "data": [
    {
      "triplet": ["person", "holding", "gun"],
      "causal": {
        "effect": "threat_increase",
        "type": "risk",
        "score": 0.9,
        "intent_context": "intimidate"
      },
      "counterfactual": {
        "modified_triplet": ["person", "holding", "book"],
        "new_effect": "safer",
        "change": "decrease"
      },
      "intent": "intimidate"
    }
  ]
}

Contributors

Languages

Python

100.0%