---
title: "Computer vision training data"
description: "Collect computer vision training data from the web: product photos, listing galleries and image-caption pairs with alt text, labels and source URLs."
canonical: https://www.zenrows.com/use-cases/computer-vision-training-data
updated: 2026-11-02
---

# Computer vision training data

Computer vision training data is a set of images paired with labels (categories, attributes, captions or alt text) that a vision or multimodal model learns from. Zenrows reads the pages holding the images, returns image URLs, alt text and label fields as JSON, then downloads each file, so every image keeps its label and source URL.

## Sample output: one labeled image

```json
{
  "page_url": "https://www.example-shop.com/p/trail-runner-gtx",
  "image_url": "https://cdn.example-shop.com/img/trail-runner-gtx-side-1600.jpg",
  "alt": "Trail running shoe, side view, grey with orange sole",
  "labels": {
    "title": "Trail Runner GTX",
    "category": ["Footwear", "Running", "Trail"],
    "color": "grey/orange"
  },
  "file": {
    "sha256": "a91f0c3e5b7d",
    "mime": "image/jpeg",
    "width": 1600,
    "height": 1600,
    "bytes": 214332
  },
  "fetched_at": "2026-10-17T08:12:40Z"
}
```

Illustrative. Zenrows returns image URL, alt text, labels and file; you compute hash and dimensions.

## What vision teams collect from the web

The value is the label beside each image: product category, listing attributes, an editor's caption.

| Job | Data you collect | Typical sources |
|---|---|---|
| Product recognition | Product photos with category, brand, attributes | Amazon, Walmart, Etsy and retailer product pages |
| Fashion and visual search | Item images with color, material, style | Zara, H&M and Myntra product pages |
| Interiors and real estate | Room photos with listing attributes | Zillow and Idealista listing galleries |
| Vehicle recognition | Car photos with make, model, year, trim | Autotrader, Cars.com and dealer inventory pages |
| Image-caption pairs | Images with alt text and captions | Wikimedia Commons, museum collections, news photo captions |
| Documents and labels | Labels, packaging, forms, receipts for OCR | Product label pages, public form libraries, filings |

## Why image scraping breaks

Image pipelines fail quietly: placeholder thumbnails or unlabeled files still fill a folder, then show up weeks later as a weak model.

| What breaks | What it looks like | How Zenrows handles it |
|---|---|---|
| Lazy-loaded images | Placeholder GIFs and `data-src` attributes | A browser render that waits for an element, or scrolls with page actions, loads the gallery |
| Thumbnails instead of originals | Every image 200 pixels wide | Select the full-size source with CSS, e.g. `img @data-zoom` or the `srcset` attribute |
| Protected product sites | Akamai or PerimeterX blocks the page before any image URL | Zenrows' stealth gets through Akamai, PerimeterX and similar |
| Labels lost from images | Files with no category, title or caption | One request with CSS selectors returns image URLs and labels together |
| Duplicate images | One photo across colorways and listings | Crawl drops duplicate page URLs; hash files to drop repeats |
| Image hosts that block direct downloads | CDN 403s without the right headers | Fetch downloads the file, with Adaptive Stealth Mode and custom headers when needed |

## How to collect computer vision training data

1. **Find the pages**: Crawl a category or gallery with an include pattern like `/p/`.
2. **Read images and labels together**: [Fetch with CSS selectors](/products/fetch) returns image URLs, alt text and labels in one JSON.
3. **Download the files**: Fetch on an image URL returns the file itself.
4. **Hash, dedupe and record provenance**: name files by content hash, drop repeats, store page URL, label and licence note.

```python Python
# pip install requests
import hashlib, json, os
import requests

API, KEY = "https://api.zenrows.com/v1/", "YOUR_ZENROWS_API_KEY"
selectors = {
    "title": "h1",
    "category": "nav.breadcrumb a",
    "images": "img.product-image @src",
    "alts": "img.product-image @alt",
}

# 1. Image URLs, alt text and labels from one product page
page = requests.get(API, timeout=120, params={
    "apikey": KEY, "url": PRODUCT_URL, "mode": "auto",  # Adaptive Stealth Mode
    "css_extractor": json.dumps(selectors),
}).json()

as_list = lambda v: v if isinstance(v, list) else [v]
os.makedirs("images", exist_ok=True)

# 2. Download each file through Fetch and name it by content hash
for src, alt in zip(as_list(page["images"]), as_list(page["alts"])):
    img = requests.get(API, params={"apikey": KEY, "url": src}, timeout=120)
    if not img.ok:
        continue
    digest = hashlib.sha256(img.content).hexdigest()
    ext = img.headers.get("Content-Type", "image/jpeg").split("/")[-1]
    with open(f"images/{digest}.{ext}", "wb") as f:
        f.write(img.content)
    print(json.dumps({"page": PRODUCT_URL, "image_url": src, "alt": alt,
                      "title": page["title"], "sha256": digest}))
```

```bash cURL
curl -X POST "https://async.api.zenrows.com/v1/jobs" \
  -H "X-API-Key: YOUR_ZENROWS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "regular",
    "status": "closed",
    "zenrows_params": {
      "mode": "auto",
      "css_extractor": "{\"title\":\"h1\",\"images\":\"img.product-image @src\",\"alts\":\"img.product-image @alt\"}"
    },
    "tasks": [
      { "url": "PRODUCT_URL_1", "external_id": "sku-1001" },
      { "url": "PRODUCT_URL_2", "external_id": "sku-1002" }
    ]
  }'
```

```bash CLI
npx -y @zenrows/cli init
zenrows crawl create CATEGORY_URL --include-patterns /p/ --max-pages 500 --follow
zenrows crawl results <crawl-id> --out urls.jsonl
zenrows extract PRODUCT_URL --css '{"title":"h1","images":"img.product-image @src","alts":"img.product-image @alt"}'
```

```text Claude Code (MCP)
# Connect once
claude mcp add zenrows -e ZENROWS_API_KEY=YOUR_ZENROWS_API_KEY -- npx -y @zenrows/mcp

# Then ask:
Use Zenrows to open these five product pages and return a CSV with
one row per product image: page URL, full-size image URL, alt text,
product title and category.
```

## Which Zenrows product fits

| If you need to | Use | Why |
|---|---|---|
| Read image URLs and labels | [Fetch](/products/fetch) | `@src` and `@alt` CSS selectors return one JSON object |
| Download the image files | [Fetch](/products/fetch) | A file URL returns the binary, ready to save |
| Process thousands of product or listing pages | [Batch](/products/batch) | One job; results per page tagged with your ID |
| List every category or gallery page | [Crawl](/products/crawl) | Follows site links, keeps matching paths |
| Sample a source before building a pipeline | [MCP Server](/mcp) | Ask Claude or Cursor for a few labeled images to check fields |

## What success looks like

| Measure | What good looks like | How to check it |
|---|---|---|
| Label coverage | Every image has labels and source URL | Empty title, category or alt per source |
| Resolution | Files meet your minimum size | Share below minimum after download |
| Duplicate rate | Repeats removed before training | Exact, then perceptual hashes per batch |
| Class balance | Each class has the images the plan needs | Images per label after each run |
| Download success | Nearly every found image URL becomes a file | URLs extracted against files written per run |
| Images kept per run | The share surviving dedup and quality filters holds steady as sources grow | Kept after filtering over downloaded, per run |

## Computer vision training data FAQ

### What is computer vision training data?

Labeled images a model learns from: a class like "running shoe", attributes like color, bounding boxes, a scene caption. Many web images already sit beside human-written titles, breadcrumb categories, alt text and captions.

### How do I scrape images for a machine learning dataset?

Crawl lists the pages; Fetch with CSS selectors returns img @src , img @alt and label fields; a second Fetch per image URL returns the file. Store each file with its page URL and labels.

### How do I build image-text pairs for multimodal models?

Pair each image with its alt attribute, figcaption , or product title and description, selected in the same request so pairs stay aligned. Drop empty or generic alt text, like "image" or a file name.

### How do I get full-size images instead of thumbnails?

Full-size URLs often sit in a zoom attribute, a srcset list or a wrapping link, not src . Select that with CSS, and wait for an element in a browser render when JavaScript loads the gallery.

### Is it legal to scrape images for AI training?

Images are usually copyrighted, and photos of people can be personal or biometric data under laws like the GDPR. Teams favor openly licensed sources, record licence and source URL per file, exclude or blur unneeded faces, follow site terms, and ask legal before training.

### How do I label images scraped from the web?

Use the page's labels: breadcrumb category, title, color and size on product pages; room types or vehicle trims in galleries. Map them to your classes with a lookup table; send only failures to annotators. Keep original fields per file to relabel without recollecting.

## Related use cases

- [AI training data](https://www.zenrows.com/use-cases/ai-training-data.md): Web corpora for pre-training and fine-tuning, collected as Markdown JSONL with a source URL on every document.
- [Product data scraping](https://www.zenrows.com/use-cases/product-data-scraping.md): Whole product catalogs, variants, specs, images and sellers from marketplaces, normalized into one feed.
- [Ecommerce web scraping](https://www.zenrows.com/use-cases/ecommerce-web-scraping.md): Product, price, stock, review and seller data from Amazon, Walmart, eBay and Shopify stores, as JSON.
- [Real estate web scraping](https://www.zenrows.com/use-cases/real-estate-web-scraping.md): Listings, prices, agents and price history from property portals, kept current at portfolio scale.
- [Automotive data](https://www.zenrows.com/use-cases/automotive-data.md): Vehicle listings, dealer inventory, prices, specs and parts from marketplaces and dealer sites, keyed on VIN.
- [Product matching](https://www.zenrows.com/use-cases/product-matching.md): GTINs, model numbers, pack sizes and specs from every retailer, so one product resolves to one record.

Start free: https://app.zenrows.com/register. Docs: https://docs.zenrows.com

## Structured data



<script type="application/ld+json">
{"@context":"https://schema.org","@graph":[{"@type":"WebPage","@id":"https://www.zenrows.com/use-cases/computer-vision-training-data#webpage","url":"https://www.zenrows.com/use-cases/computer-vision-training-data","name":"Computer vision training data","description":"Collect computer vision training data from the web: product photos, listing galleries and image-caption pairs with alt text, labels and source URLs.","isPartOf":{"@id":"https://www.zenrows.com/#website"},"inLanguage":"en","datePublished":"2026-11-02","dateModified":"2026-11-02","about":{"@type":"Thing","name":"computer vision training data"},"keywords":"computer vision training data, image scraping, image data collection, image dataset from web, scrape images for machine learning, image-text pairs, multimodal training data, product image dataset","publisher":{"@type":"Organization","name":"Zenrows","url":"https://www.zenrows.com/"}},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://www.zenrows.com/"},{"@type":"ListItem","position":2,"name":"Use cases","item":"https://www.zenrows.com/use-cases"},{"@type":"ListItem","position":3,"name":"Computer vision training data","item":"https://www.zenrows.com/use-cases/computer-vision-training-data"}]},{"@type":"FAQPage","@id":"https://www.zenrows.com/use-cases/computer-vision-training-data#faq","mainEntity":[{"@type":"Question","name":"What is computer vision training data?","acceptedAnswer":{"@type":"Answer","text":"Labeled images a model learns from: a class like \"running shoe\", attributes like color, bounding boxes, a scene caption. Many web images already sit beside human-written titles, breadcrumb categories, alt text and captions."}},{"@type":"Question","name":"How do I scrape images for a machine learning dataset?","acceptedAnswer":{"@type":"Answer","text":"Crawl lists the pages; Fetch with CSS selectors returns img @src , img @alt and label fields; a second Fetch per image URL returns the file. Store each file with its page URL and labels."}},{"@type":"Question","name":"How do I build image-text pairs for multimodal models?","acceptedAnswer":{"@type":"Answer","text":"Pair each image with its alt attribute, figcaption , or product title and description, selected in the same request so pairs stay aligned. Drop empty or generic alt text, like \"image\" or a file name."}},{"@type":"Question","name":"How do I get full-size images instead of thumbnails?","acceptedAnswer":{"@type":"Answer","text":"Full-size URLs often sit in a zoom attribute, a srcset list or a wrapping link, not src . Select that with CSS, and wait for an element in a browser render when JavaScript loads the gallery."}},{"@type":"Question","name":"Is it legal to scrape images for AI training?","acceptedAnswer":{"@type":"Answer","text":"Images are usually copyrighted, and photos of people can be personal or biometric data under laws like the GDPR. Teams favor openly licensed sources, record licence and source URL per file, exclude or blur unneeded faces, follow site terms, and ask legal before training."}},{"@type":"Question","name":"How do I label images scraped from the web?","acceptedAnswer":{"@type":"Answer","text":"Use the page's labels: breadcrumb category, title, color and size on product pages; room types or vehicle trims in galleries. Map them to your classes with a lookup table; send only failures to annotators. Keep original fields per file to relabel without recollecting."}}]}]}
</script>
