A Vision-Language Model (VLM) pipeline for enriching Visual Genome scene graphs with causal effects, counterfactual modifications, and intent analysis using Gemma-3-12B.
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
cd /path/to/project
pip install -r requirements.txt
cleaned_vg.jsonl in data/ directorydata/imagery/ (named as {image_id}.jpg)python scn_vision.py
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"
}
]
}
5 commits
Python
100.0%
A Vision-Language Model (VLM) pipeline for enriching Visual Genome scene graphs with causal effects, counterfactual modifications, and intent analysis using Gemma-3-12B.
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
cd /path/to/project
pip install -r requirements.txt
cleaned_vg.jsonl in data/ directorydata/imagery/ (named as {image_id}.jpg)python scn_vision.py
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"
}
]
}
5 commits
Python
100.0%