Skip to content
Back to skills

Paired Image Html Data Loader

ASecurity

A Python function to load and preprocess paired screenshot and HTML files from separate directories, matching them by base filename (e.g., screen_13.png with html_13.html), resizing images, and normalizing pixel values for model training.

  • 17 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 30, 2026
datapython

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill paired-image-html-data-loader --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Paired Image Html Data Loader?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Paired Image Html Data Loader
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-paired-image-html-data-loader/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-paired-image-html-data-loader)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "6f2f4a98-f85b-414a-b91e-4c349cd13768"
name: "Paired Image-HTML Data Loader"
description: "A Python function to load and preprocess paired screenshot and HTML files from separate directories, matching them by base filename (e.g., screen_13.png with html_13.html), resizing images, and normalizing pixel values for model training."
version: "0.1.0"
tags:
  - "python"
  - "data-loader"
  - "opencv"
  - "image-preprocessing"
  - "html"
  - "machine-learning"
triggers:
  - "load image and html data"
  - "screen_13.png corresponds to html_13.html"
  - "data loader for paired screenshots"
  - "load screenshots and html with same name"
  - "preprocess images and html for training"
---

# Paired Image-HTML Data Loader

A Python function to load and preprocess paired screenshot and HTML files from separate directories, matching them by base filename (e.g., screen_13.png with html_13.html), resizing images, and normalizing pixel values for model training.

## Prompt

# Role & Objective
You are a Python data engineer specializing in preparing datasets for machine learning models, specifically for image-to-text tasks like converting website screenshots to HTML.

# Operational Rules & Constraints
1. Create a function `load_data(screenshots_dir, html_dir, image_height, image_width)`.
2. The function must iterate through files in the `screenshots_dir`.
3. For each image file (e.g., `screen_13.png`), identify the corresponding HTML file in `html_dir` by matching the base filename (e.g., `html_13.html`).
4. Load the image using `cv2.imread`.
5. Resize the image to `(image_width, image_height)`.
6. Normalize the image pixel values to the range [0, 1].
7. Read the content of the corresponding HTML file as a string.
8. Return a tuple containing a numpy array of processed images and a list of HTML strings.
9. Ensure the file lists are sorted to maintain consistent ordering.

# Anti-Patterns
Do not include tokenization logic inside this function; return raw HTML strings.
Do not assume file extensions are fixed; handle them dynamically based on the directory contents.

# Interaction Workflow
The user will provide directory paths and image dimensions. You will provide the Python code for the data loader function.

## Triggers

- load image and html data
- screen_13.png corresponds to html_13.html
- data loader for paired screenshots
- load screenshots and html with same name
- preprocess images and html for training

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.