document_id stringclasses 3
values | page_number stringlengths 9 9 | image imagewidth (px) 600 600 | text stringlengths 0 9.33k | alto_xml stringlengths 687 280k | has_image bool 1
class | has_alto bool 1
class | objects dict |
|---|---|---|---|---|---|---|---|
204486095 | 205328545 | <?xml version="1.0" encoding="UTF-8"?>
<alto xmlns="http://www.loc.gov/standards/alto/v3/alto.xsd"><Description><MeasurementUnit>pixel</MeasurementUnit><sourceImageInformation><fileName>./data/pdfs/204486095.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><processingDateTime>Wed Nov ... | true | true | {
"bbox": [],
"category": [],
"score": []
} | ||
204486095 | 205328558 | SOME BRITISH FASHIONS
Gir.H. | <?xml version="1.0" encoding="UTF-8"?>
<alto xmlns="http://www.loc.gov/standards/alto/v3/alto.xsd"><Description><MeasurementUnit>pixel</MeasurementUnit><sourceImageInformation><fileName>./data/pdfs/204486095.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><processingDateTime>Wed Nov ... | true | true | {
"bbox": [],
"category": [],
"score": []
} | |
204486095 | 205328571 | <?xml version="1.0" encoding="UTF-8"?>
<alto xmlns="http://www.loc.gov/standards/alto/v3/alto.xsd"><Description><MeasurementUnit>pixel</MeasurementUnit><sourceImageInformation><fileName>./data/pdfs/204486095.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><processingDateTime>Wed Nov ... | true | true | {
"bbox": [],
"category": [],
"score": []
} | ||
204486095 | 205328584 | c
1
* | <?xml version="1.0" encoding="UTF-8"?>
<alto xmlns="http://www.loc.gov/standards/alto/v3/alto.xsd"><Description><MeasurementUnit>pixel</MeasurementUnit><sourceImageInformation><fileName>./data/pdfs/204486095.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><processingDateTime>Wed Nov ... | true | true | {
"bbox": [],
"category": [],
"score": []
} | |
204486095 | 205328597 | BRITAIN
AN OFFICIAL HANDBOOK | <?xml version="1.0" encoding="UTF-8"?>
<alto xmlns="http://www.loc.gov/standards/alto/v3/alto.xsd"><Description><MeasurementUnit>pixel</MeasurementUnit><sourceImageInformation><fileName>./data/pdfs/204486095.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><processingDateTime>Wed Nov ... | true | true | {
"bbox": [],
"category": [],
"score": []
} | |
204486095 | 205328610 | I | <?xml version="1.0" encoding="UTF-8"?>
<alto xmlns="http://www.loc.gov/standards/alto/v3/alto.xsd"><Description><MeasurementUnit>pixel</MeasurementUnit><sourceImageInformation><fileName>./data/pdfs/204486095.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><processingDateTime>Wed Nov ... | true | true | {
"bbox": [],
"category": [],
"score": []
} | |
204486095 | 205328623 | <?xml version="1.0" encoding="UTF-8"?>
<alto xmlns="http://www.loc.gov/standards/alto/v3/alto.xsd"><Description><MeasurementUnit>pixel</MeasurementUnit><sourceImageInformation><fileName>./data/pdfs/204486095.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><processingDateTime>Wed Nov ... | true | true | {
"bbox": [],
"category": [],
"score": []
} | ||
204486095 | 205328636 | ‘Piping aboard’ ceremony on H.M.S. Lion | <?xml version="1.0" encoding="UTF-8"?>
<alto xmlns="http://www.loc.gov/standards/alto/v3/alto.xsd"><Description><MeasurementUnit>pixel</MeasurementUnit><sourceImageInformation><fileName>./data/pdfs/204486095.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><processingDateTime>Wed Nov ... | true | true | {
"bbox": [
[
1.171875,
1.7890625,
582.828125,
906.2109375
],
[
42.25,
204,
481.75,
652
]
],
"category": [
0,
0
],
"score": [
0.55078125,
0.78515625
]
} | |
204486095 | 205328649 | BRITAIN
AN OFFICIAL HANDBOOK
PREPARED BY
THE CENTRAL OFFICE OF INFORMATION, LONDON
1 967 EDITION
London: Her Majesty’s Stationery Office: 1967 | <?xml version="1.0" encoding="UTF-8"?>
<alto xmlns="http://www.loc.gov/standards/alto/v3/alto.xsd"><Description><MeasurementUnit>pixel</MeasurementUnit><sourceImageInformation><fileName>./data/pdfs/204486095.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><processingDateTime>Wed Nov ... | true | true | {
"bbox": [],
"category": [],
"score": []
} | |
204486095 | 205328662 | © Crown copyright 19^7
Printed and published by
HER MAJESTY’S STATIONERY OFFICE
To be purchased from
49 High Holborn, London w.c.i
423 Oxford Street, London w.i
13A Castle Street, Edinburgh 2
109 St. Mary Street, Cardiff
Brazennose Street, Manchester 2
50 Fairfax Street, Bristol 1
35 Smallbrook, Ringway, Birmingham 5
8... | <?xml version="1.0" encoding="UTF-8"?>
<alto xmlns="http://www.loc.gov/standards/alto/v3/alto.xsd"><Description><MeasurementUnit>pixel</MeasurementUnit><sourceImageInformation><fileName>./data/pdfs/204486095.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><processingDateTime>Wed Nov ... | true | true | {
"bbox": [],
"category": [],
"score": []
} | |
204486095 | 205328675 | Contents
Page
INTRODUCTION
ix
1. THE LAND AND THE PEOPLE
i
The Physical Background
!
The Demographic Background
6
2. GOVERNMENT
25
General Survey
2 s
The Monarchy
26
Parliament
o Q
The Privy Council
Her Majesty’s Government
^2
Government Departments
46
The Civil Service
62
Local Government
68
The Fire Service
3. LAW AN... | <?xml version="1.0" encoding="UTF-8"?>
<alto xmlns="http://www.loc.gov/standards/alto/v3/alto.xsd"><Description><MeasurementUnit>pixel</MeasurementUnit><sourceImageInformation><fileName>./data/pdfs/204486095.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><processingDateTime>Wed Nov ... | true | true | {
"bbox": [],
"category": [],
"score": []
} | |
204486095 | 205328688 | ii. INDUSTRY
Organisation and Production
Fuel and Power
Water Supply
Construction
Manufacturing Industries
Page
246
246
263
279
282
285
12. AGRICULTURE, FISHERIES AND FORESTRY
Agriculture
Fisheries
Forestry
3
11
33°
333
[3. TRANSPORT AND COMMUNICATIONS
Shipping
Inland Transport
Civil Aviation
The Post Office
337
337
34... | <?xml version="1.0" encoding="UTF-8"?>
<alto xmlns="http://www.loc.gov/standards/alto/v3/alto.xsd"><Description><MeasurementUnit>pixel</MeasurementUnit><sourceImageInformation><fileName>./data/pdfs/204486095.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><processingDateTime>Wed Nov ... | true | true | {
"bbox": [],
"category": [],
"score": []
} | |
204486095 | 205328701 | DIAGRAMS
Birth Rates and Death Rates in the United Kingdom
Expectation of Life at Birth in England and Wales
The Royal Family: Genealogical Tree
Organisation of the National Health Service
Changes in National Expenditure 1956 to 1965
Public and Private Fixed Investment 1956 and 1965
Personal Income and Expenditure, 196... | <?xml version="1.0" encoding="UTF-8"?>
<alto xmlns="http://www.loc.gov/standards/alto/v3/alto.xsd"><Description><MeasurementUnit>pixel</MeasurementUnit><sourceImageInformation><fileName>./data/pdfs/204486095.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><processingDateTime>Wed Nov ... | true | true | {
"bbox": [],
"category": [],
"score": []
} | |
204486095 | 205328714 | Agriculture
Newspaper Production
Transport
Industrial Safety
Montreal Exhibition
Northern Ireland
Sport
facing page
247
358
betzveen pages 358 and 359
359
454
between pages 454 and 455
455
Acknowledgment is made for end-papers design to Miss Doreen Roberts and for photographs to Walter
Frentz for Carbisdale Castle (fac... | <?xml version="1.0" encoding="UTF-8"?>
<alto xmlns="http://www.loc.gov/standards/alto/v3/alto.xsd"><Description><MeasurementUnit>pixel</MeasurementUnit><sourceImageInformation><fileName>./data/pdfs/204486095.pdf</fileName></sourceImageInformation><OCRProcessing ID="IdOcr"><ocrProcessingStep><processingDateTime>Wed Nov ... | true | true | {
"bbox": [],
"category": [],
"score": []
} |
Object Detection: Photograph Detection using sam3
This dataset contains object detection results (bounding boxes) for photograph detected in images from NationalLibraryOfScotland/Britain-and-UK-Handbooks-Dataset using Meta's SAM3 (Segment Anything Model 3).
Generated using: uv-scripts/sam3 detection script
Detection Statistics
- Objects Detected: photograph
- Total Detections: 4,500
- Images with Detections: 1,500 / 1,500 (100.0%)
- Average Detections per Image: 3.00
Processing Details
- Source Dataset: NationalLibraryOfScotland/Britain-and-UK-Handbooks-Dataset
- Model: facebook/sam3
- Script Repository: uv-scripts/sam3
- Number of Samples Processed: 1,500
- Processing Time: 2.2 minutes
- Processing Date: 2025-11-22 16:45 UTC
Configuration
- Image Column:
image - Dataset Split:
train - Class Name:
photograph - Confidence Threshold: 0.5
- Mask Threshold: 0.5
- Batch Size: 8
- Model Dtype: bfloat16
Model Information
SAM3 (Segment Anything Model 3) is Meta's state-of-the-art object detection and segmentation model that excels at:
- 🎯 Zero-shot detection - Detect objects using natural language prompts
- 📦 Bounding boxes - Accurate object localization
- 🎭 Instance segmentation - Pixel-perfect masks (not included in this dataset)
- 🖼️ Any image domain - Works on photos, documents, medical images, etc.
This dataset uses SAM3 in text-prompted detection mode to find instances of "photograph" in the source images.
Dataset Structure
The dataset contains all original columns from the source dataset plus an objects column with detection results in HuggingFace object detection format (dict-of-lists):
- bbox: List of bounding boxes in
[x, y, width, height]format (pixel coordinates) - category: List of category indices (always
0for single-class detection) - score: List of confidence scores (0.0 to 1.0)
Schema
{
"objects": {
"bbox": [[x, y, w, h], ...], # List of bounding boxes
"category": [0, 0, ...], # All same class
"score": [0.95, 0.87, ...] # Confidence scores
}
}
Usage
from datasets import load_dataset
# Load the dataset
dataset = load_dataset("{{output_dataset_id}}", split="train")
# Access detections for an image
example = dataset[0]
detections = example["objects"]
# Iterate through all detected objects in this image
for bbox, category, score in zip(
detections["bbox"],
detections["category"],
detections["score"]
):
x, y, w, h = bbox
print(f"Detected photograph at ({x}, {y}) with confidence {score:.2f}")
# Filter high-confidence detections
high_conf_examples = [
ex for ex in dataset
if any(score > 0.8 for score in ex["objects"]["score"])
]
# Count total detections across dataset
total = sum(len(ex["objects"]["bbox"]) for ex in dataset)
print(f"Total detections: {total}")
Visualization
To visualize the detections, you can use the visualization script from the same repository:
# Visualize first sample with detections
uv run https://huggingface.co/datasets/uv-scripts/sam3/raw/main/visualize-detections.py \
{{output_dataset_id}} \
--first-with-detections
# Visualize random samples
uv run https://huggingface.co/datasets/uv-scripts/sam3/raw/main/visualize-detections.py \
{{output_dataset_id}} \
--num-samples 5
# Save visualizations to files
uv run https://huggingface.co/datasets/uv-scripts/sam3/raw/main/visualize-detections.py \
{{output_dataset_id}} \
--num-samples 3 \
--output-dir ./visualizations
Reproduction
This dataset was generated using the uv-scripts/sam3 object detection script:
uv run https://huggingface.co/datasets/uv-scripts/sam3/raw/main/detect-objects.py \
NationalLibraryOfScotland/Britain-and-UK-Handbooks-Dataset \
<output-dataset> \
--class-name photograph \
--confidence-threshold 0.5 \
--mask-threshold 0.5 \
--batch-size 8 \
--dtype bfloat16
Running on HuggingFace Jobs (GPU)
This script requires a GPU. To run on HuggingFace infrastructure:
hf jobs uv run --flavor a100-large \
-s HF_TOKEN=HF_TOKEN \
https://huggingface.co/datasets/uv-scripts/sam3/raw/main/detect-objects.py \
NationalLibraryOfScotland/Britain-and-UK-Handbooks-Dataset \
<output-dataset> \
--class-name photograph \
--confidence-threshold 0.5
Performance
- Processing Speed: ~11.4 images/second
- GPU Configuration: CUDA with bfloat16 precision
Generated with 🤖 UV Scripts
- Downloads last month
- 12