Skip to content

Improve graph feature extraction and add utilities for visualization and embedding search#8

Open
swagat-mishra28 wants to merge 4 commits intohumanai-foundation:mainfrom
swagat-mishra28:improve-graph-embedding-pipeline
Open

Improve graph feature extraction and add utilities for visualization and embedding search#8
swagat-mishra28 wants to merge 4 commits intohumanai-foundation:mainfrom
swagat-mishra28:improve-graph-embedding-pipeline

Conversation

@swagat-mishra28
Copy link

Hi,

While exploring the graph construction and embedding pipeline, I made a few small improvements that may help with inspecting the graph representations and working with the generated embeddings.

Main changes include:

• extended the node feature extraction in extract_node() (in utils/build_graph.py) to include additional region statistics and a simple texture descriptor derived from gradient magnitude
• added a small utility visualize_segments() in utils/build_graph.py to visualize the SLIC superpixel segmentation used for graph construction
• added find_similar_embeddings() in embedding.py to perform cosine-similarity search over the generated embeddings, along with a helper to retrieve similar images from the embedding space
• added save_overlay() in utils/visualization.py to optionally save heatmap overlays when inspecting hidden-art visualizations
• added a small dataset integrity check using Image.open(path).verify() to skip corrupted images during dataset construction
• included a few minor stability improvements in the embedding pipeline (handling NaNs, saving embedding metadata, and small usability tweaks)

These additions are mainly intended to make it easier to inspect graph construction, debug segmentation, and experiment with the embeddings produced by the encoder when analyzing paintings.

Please let me know if any of these utilities should be structured differently or integrated elsewhere in the workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant