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.
Updated
{
"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"
}
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 | |
| Fashion and visual search | Item images with color, material, style | |
| Interiors and real estate | Room photos with listing attributes | |
| Vehicle recognition | Car photos with make, model, year, trim | |
| 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.
Placeholder GIFs and data-src attributes
A browser render that waits for an element, or scrolls with page actions, loads the gallery
Every image 200 pixels wide
Select the full-size source with CSS, e.g. img @data-zoom or the srcset attribute
Akamai or PerimeterX blocks the page before any image URL
Zenrows' stealth gets through Akamai, PerimeterX and similar
Files with no category, title or caption
One request with CSS selectors returns image URLs and labels together
One photo across colorways and listings
Crawl drops duplicate page URLs; hash files to drop repeats
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
- Find the pages: Crawl a category or gallery with an include pattern like
/p/. - Read images and labels together: Fetch with CSS selectors returns image URLs, alt text and labels in one JSON.
- Download the files: Fetch on an image URL returns the file itself.
- Hash, dedupe and record provenance: name files by content hash, drop repeats, store page URL, label and licence note.
# 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}))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" }
]
}'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"}'# 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
- Read image URLs and labels Fetch@src and @alt CSS selectors return one JSON object
- Download the image files FetchA file URL returns the binary, ready to save
- Process thousands of product or listing pages BatchOne job; results per page tagged with your ID
- List every category or gallery page CrawlFollows site links, keeps matching paths
- Sample a source before building a pipeline MCP ServerAsk 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
-
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.
-
Crawl lists the pages; Fetch with CSS selectors returns
img @src,img @altand label fields; a second Fetch per image URL returns the file. Store each file with its page URL and labels. -
Pair each image with its
altattribute,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. -
Full-size URLs often sit in a zoom attribute, a
srcsetlist or a wrapping link, notsrc. Select that with CSS, and wait for an element in a browser render when JavaScript loads the gallery. -
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.
-
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.