davanstrien's picture
davanstrien HF Staff
Improve UI with Tufte-inspired design principles
a21dde3
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
This is a Hugging Face Space that visualizes ICONCLASS predictions from the `davanstrien/iconclass-vlm` model compared to ground truth labels. It's a static web application that fetches and displays data from the `davanstrien/iconclass-sft-predictions` dataset.
The model being evaluated is a fine-tuned vision-language model (based on Qwen/Qwen2.5-VL-3B-Instruct) that automatically classifies art and cultural heritage images using Iconclass notation. The visualization shows how well the model's predictions match the ground truth labels.
## Architecture
The project consists of a single-page web application:
- `index.html`: Main application with embedded CSS and JavaScript
- `style.css`: Additional styles (currently minimal, most styles are inline in index.html)
- Uses the Hugging Face Datasets Server API to fetch data
## Key Implementation Details
### Data Source
- Dataset: `davanstrien/iconclass-sft-predictions`
- Config: `default`
- Split: `test`
- API endpoint: `https://datasets-server.huggingface.co/rows`
### Data Structure
Each row contains:
- `images`: Array of image objects with `src` URLs
- `iconclass-prediction`: Raw prediction text
- `iconclass-predictions-parsed`: Parsed prediction labels array
- `iconclass-gt-parsed`: Parsed ground truth labels array
### Core Functionality
- Lazy loading with pagination (10 images at a time)
- Infinite scroll support
- Visual comparison between predictions and ground truth
- Match detection and scoring
- Invalid label detection (labels containing "not a valid" or "invalid")
## Development Notes
Since this is a static Hugging Face Space (sdk: static), there's no build process or backend. All changes are made directly to the HTML/CSS files and are immediately reflected when deployed to Hugging Face Spaces.
**Important**: The README.md file is not displayed in static Spaces. Any documentation or description about the Space must be added directly to the `index.html` file to be visible to users.
To test locally, simply open `index.html` in a web browser.