Graph-based visual search and scene exploration using computer vision and Neo4j.
VisualGraph is a project for representing visual scenes as graphs. The initial idea is to detect objects in images, derive spatial relationships between them, and store this information in a Neo4j graph database.
For example, an image may be represented as:
Image
├── CONTAINS → Person
├── CONTAINS → Dog
└── CONTAINS → Bicycle
Person ── NEAR ──→ Dog
Person ── LEFT_OF ──→ Bicycle
This graph representation can then be explored and queried using Cypher.
The first version of the project will focus on:
- object detection in images;
- extraction of bounding boxes and object classes;
- generation of spatial relationships between detected objects;
- representation of image scenes as property graphs;
- persistence and querying with Neo4j;
- visualization of the generated scene graph.
The initial relationships will be based on geometric information from bounding boxes, such as:
LEFT_OF
RIGHT_OF
ABOVE
BELOW
NEAR
OVERLAPS
Future versions may explore image embeddings, vector search, semantic relationships, and hybrid visual search.
Requirements: Docker with Compose, and uv for the backend.
cp .env.example .env # then set NEO4J_PASSWORD (.env is not versioned)
docker compose up -d --wait # starts Neo4j and waits until it is healthy- Neo4j Browser: http://localhost:7474 (Connect URL
bolt://localhost:7687, user/password from.env) - Data and logs are stored in
./neo4j/(git-ignored). Stop withdocker compose down; reset the database withdocker compose downfollowed by deleting./neo4j/data.
Verify the backend can connect (needs the container running):
cd backend
uv sync
uv run pytest -m integrationThis project is licensed under the MIT License.