ijb-a / README.md
marcelohaps's picture
Upload IJB-A HF-ready dataset (frame/ packed as frame.tar)
289dffb verified
metadata
license: other
task_categories:
  - image-classification
  - zero-shot-image-classification
tags:
  - face-recognition
  - face-verification
  - face-identification
  - ijb-a
  - janus
  - template-based
pretty_name: IJB-A HF-ready
size_categories:
  - 10K<n<100K

IJB-A HF-ready

This repo packages the IARPA Janus Benchmark-A (IJB-A) face recognition dataset in its CleanData layout, plus the official 10-split 1:1 verification and 1:N identification protocols.

Unlike LFW-style benchmarks, IJB-A is template-based: each subject is represented by a template aggregating multiple still images and/or video frames. Protocol CSVs map every (template, file) row to a face annotation with bounding box, landmarks, and demographic attributes.

Layout

ijba/
├── README.md
├── files.csv
├── img/                              # 5396 still images (flat)
├── frame.tar                         # 20369 video frames packed into a single tar (~817 MB)
├── img.txt                           # upstream bbox annotations subset (still images)
├── frame.txt                         # upstream bbox annotations subset (video frames)
└── protocols/
    ├── IJB-A_11_sets/split{1..10}/    # 1:1 verification protocol inputs
    │   ├── train_<n>.csv
    │   ├── verify_metadata_<n>.csv
    │   └── verify_comparisons_<n>.csv
    ├── IJB-A_11_output/split{1..10}/  # baseline 1:1 outputs (.matches)
    ├── IJB-A_1N_sets/split{1..10}/    # 1:N identification protocol inputs
    │   ├── train_<n>.csv
    │   ├── search_gallery_<n>.csv
    │   └── search_probe_<n>.csv
    └── IJB-A_1N_output/split{1..10}/  # baseline 1:N outputs (.candidate_lists)

Protocol CSV columns

train_*.csv, verify_metadata_*.csv, search_gallery_*.csv, search_probe_*.csv all share the same schema:

TEMPLATE_ID, SUBJECT_ID, FILE, MEDIA_ID, SIGHTING_ID, FRAME, FACE_X, FACE_Y, FACE_WIDTH, FACE_HEIGHT, RIGHT_EYE_X, RIGHT_EYE_Y, LEFT_EYE_X, LEFT_EYE_Y, NOSE_BASE_X, NOSE_BASE_Y, FACE_YAW, FOREHEAD_VISIBLE, EYES_VISIBLE, NOSE_MOUTH_VISIBLE, INDOOR, GENDER, SKIN_TONE, AGE, FACIAL_HAIR

The FILE column resolves relative to the dataset root, e.g. img/8565.jpg or frame/28065_00000.png.

verify_comparisons_*.csv is a header-less file with two columns: enroll_template_id, verify_template_id.

*.matches (verification baseline) and *.candidate_lists (identification baseline) preserve the upstream output schema — see the IJB-A documentation for details.

files.csv

A flat index of every image with columns file_name, kind, extension, size_bytes, referenced_in_protocols. Use it for quick joins or coverage checks without walking the filesystem.

Local Stats

  • Still images (img/): 5396
  • Video frames (frame/): 20369
  • Total images: 25765
  • Distinct files referenced by protocols: 25791
  • Verification splits: 10 (IJB-A_11_sets/split1..split10, 30 CSVs total)
  • Verification baseline outputs: 10 (IJB-A_11_output/, 10 files total)
  • Identification splits: 10 (IJB-A_1N_sets/split1..split10, 30 CSVs total)
  • Identification baseline outputs: 10 (IJB-A_1N_output/, 10 files total)

Missing protocol references

The upstream CleanData drop is missing 26 frames that are referenced by at least one protocol CSV. Filter rows on these FILE values before loading them, or skip silently:

  • frame/28264_00000.png
  • frame/28296_00337.png
  • frame/28296_00397.png
  • frame/28296_00448.png
  • frame/28296_00508.png
  • frame/28296_00928.png
  • frame/28296_00983.png
  • frame/28296_01011.png
  • frame/28296_01079.png
  • frame/28296_01375.png
  • frame/28296_01380.png
  • frame/28296_01440.png
  • frame/28296_01500.png
  • frame/28296_01560.png
  • frame/28317_01035.png
  • frame/28332_01020.png
  • frame/28496_00000.png
  • frame/28552_00660.png
  • frame/28593_00000.png
  • frame/28789_00000.png
  • frame/28928_00000.png
  • frame/29192_00000.png
  • frame/29387_00125.png
  • frame/29563_00000.png
  • frame/30369_00000.png
  • frame/30387_00060.png

Unpacking video frames

Video frames are shipped as a single frame.tar archive (uploading 20k tiny PNGs to the Hub triggered server-side commit failures). After downloading the repo, extract it once so the protocol FILE paths resolve:

tar xf frame.tar     # creates frame/<video_id>_<frame_offset>.png

Loading

import pandas as pd
import tarfile
from huggingface_hub import snapshot_download
from pathlib import Path
from PIL import Image

root = Path(snapshot_download(repo_id="marcelohaps/ijb-a", repo_type="dataset"))

# Extract frame.tar in place if not already extracted
if not (root / "frame").exists():
    with tarfile.open(root / "frame.tar") as tf:
        tf.extractall(root)

# 1:1 verification, split 1
metadata = pd.read_csv(root / "protocols/IJB-A_11_sets/split1/verify_metadata_1.csv")
comparisons = pd.read_csv(
    root / "protocols/IJB-A_11_sets/split1/verify_comparisons_1.csv",
    header=None, names=["enroll_template_id", "verify_template_id"],
)

# Open the first face referenced by template_id 109
row = metadata[metadata["TEMPLATE_ID"] == 109].iloc[0]
image = Image.open(root / row["FILE"])

Notes

IJB-A is distributed under the IARPA Janus benchmark license. Check the original dataset terms before publishing or redistributing it. This package preserves the upstream filenames (case included), bounding boxes, and protocol files verbatim.