Skip to main content

Attribute tagging pipeline built on the tagstudio and identity_mapping modules

Project description

tagpipeline

Turns a brand's SKU image bundle into structured, webshop-ready product tags.

Given one folder of images per SKU and a brand metadata CSV, tagpipeline runs three stages in order — keyed by SKU folder name — and merges their results into a single per-SKU record plus a flat CSV/Excel deliverable.

The workflow

SKU images + metadata CSV
        |
        v
1. identity mapping   detects and crops faces locally, then matches them against
                      reference embeddings served by the description-model API.
                      Yields the model featured in the SKU, or None.
        |
        v
2. tag generation     three LLM steps via the tagstudio driver (Gemini):
                      file_descriptions -> taxonomy_generation -> attribute_generation.
                      Yields a gender/category/subcategory triple plus a set of
                      validated product attributes.
        |
        v
3. taxonomy mapping   deterministic, no LLM. Resolves the predicted triple into
                      the client's own webshop categories via a reverse mapping.
        |
        v
combined_results.json + final_results.csv + final_results.xlsx

Outputs

  • combined_results.json — the merged per-SKU record (model_identity, tags, taxonomy_mapping).
  • final_results.csv — long/tidy format, one row per SKU and attribute: sku_id, model_name, model_height, pred_gender, pred_category, pred_subcategory, webshop_gender, webshop_sub_gender, descriptive_categories, attribute_name, attribute_value.
  • final_results.xlsx — the same rows as a banded Excel view (needs the excel extra).
  • Per-SKU intermediates under tag_gen/ and identity/.

Output accumulates: re-running a SKU replaces only that SKU's entry, leaving every other SKU already in the output directory untouched.

SKU boundaries

A SKU is a folder, and the folder's name is its id. Every file inside it belongs to that SKU — loose images and nested subfolders alike, at any depth — so bundles that group shots into angle_image_urls/ or detail/closeup/ are handled without those subfolders being mistaken for separate SKUs.

Configuration

The brand framework, taxonomy reverse-mapping, tag-generation pipeline config and both API keys are fetched from S3 at runtime and cached locally. The cache is hash-verified (S3 ETag for upstream changes, SHA-256 for local integrity), and a cached asset costs no S3 call at all — so a warm run needs no network and no credentials. Credentials are never bundled: supply them via AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY or $TAGPIPELINE_AWS_SECRETS.

Entry points

# full run over a bundle, assets pulled from S3
python pipeline.py --skus-dir /abs/skus --metadata-csv /abs/skus.csv \
                   --s3-client BST --out ./runs

# fetch or inspect the S3 config assets on their own
python -m tagpipeline.s3_assets --client BST --cache-status

# rebuild the flat CSV from an existing run
python build_final_csv.py --combined ./runs/combined_results.json

run_pipeline() is the programmatic API; pipeline_api.main() adds structural validation and a per-SKU PASS/FAIL report.

Requirements

Python 3.11–3.12 (MediaPipe does not support 3.13). Tag generation makes real Gemini API calls and identity mapping calls the description-model API; both incur cost. Access to the configured S3 bucket is required.


Proprietary software of Flixstock, Inc. — see LICENSE. Publication on a package index does not place it in the public domain or license it to the general public.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tagpipeline-0.0.2.tar.gz (6.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tagpipeline-0.0.2-py3-none-any.whl (6.8 MB view details)

Uploaded Python 3

File details

Details for the file tagpipeline-0.0.2.tar.gz.

File metadata

  • Download URL: tagpipeline-0.0.2.tar.gz
  • Upload date:
  • Size: 6.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.10

File hashes

Hashes for tagpipeline-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9de603c87c1bfc6bdcfca37c6cb3810c1d41b4ef11f94c4bd3c328ec192531e9
MD5 438ec4987b51aefb5568c04942417c99
BLAKE2b-256 94e356446d8e4ef55b5b2967c8306f06475ea52a24930e230f34e5891f7df3e5

See more details on using hashes here.

File details

Details for the file tagpipeline-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: tagpipeline-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.10

File hashes

Hashes for tagpipeline-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8f3530860283a5393dcdb906ffcbf4fe449bdb90c382f837b131d686d2a9bf93
MD5 ef7c0c455675ba7fe3d6457b2a5715ba
BLAKE2b-256 1d28d397d5a8a16d9c8dea08b80c928b97a0870e5c5984a7668a11d5b8c67b11

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page