Amir2000 Image Automation V1.0 | Case Study

Automate high-volume photo sets into deterministic filenames, review-ready metadata, and publish-ready website assets while keeping a mandatory human approval gate.

Python 3.13 SQLite + MySQL + FTP Ollama local inference Review-first publishing

0. Section Map (What Each Point Means)

This map explains the purpose of each numbered section so any reader can quickly understand where to find business, product, and engineering context.

Why this matters by audience:

1. Executive Summary

The automation solves a practical production problem: moving from manual, error-prone image publishing to a repeatable, auditable pipeline where every image has explicit lifecycle state in a database.

1A. V1.0 Current State

Version 1.0 moves the project from batch workflow automation into a measured metadata-quality system. The publishing path remains review-first, while generated captions, alt text, and keywords now pass through a proof layer before they are treated as upload-ready.

1B. Live Data Snapshot (Current Catalog)

To complement the narrative, this snapshot reads live from MySQL table photos_info_revamp and shows scale, quality mix, and camera evolution. This is intentionally a compact data view to support the story without overwhelming it.

Catalog rows

45,483

Largest QC band

Good (19,891 / 43.7%)

Top camera volume

Canon EOS 5D Mark IV (19,637)

Cumulative Growth (Live)

QC Status Distribution

Camera Mix by Year (Top 5)

Live source: photos_info_revamp. The charts show catalog evolution and quality mix, not an exact automation start date.

2. Problem Context

Manual workflows worked for small sets, but failed at scale. The pain points were not isolated bugs; they were system-level reliability issues.

Concrete before/after naming examples

After (more specific subject/location naming and cleaner metadata context)

  • Cosmos_pink_and_white_petals_with_bright_yellow_disk_Flower_Photography_Macro_Photography_004.JPG
  • Booking_com_campus_Offices_Amsterdam_Netherlands_Night_Photography_001.JPG

3. Objectives And Constraints

Primary objectives:

Constraints:

4. Solution Overview

The system is organized as a guided multi-stage pipeline. Operational state is stored in SQLite, and publish is a deliberate final step from the review editor.

Amir2000 Image Automation V1.0 pipeline flow chart

Figure 1: V1.0 flow chart from set intake through metadata proof, review, publish, and gallery update.

5. Workflow Walkthrough (Stage By Stage)

The production stage flow implemented in main_set.py:

  1. Validate sets: sanity checks before any data mutation.
  2. Prepare DB and copy to incoming: establish working context and staged inputs.
  3. Extract EXIF and initial metadata: seed technical metadata and base fields.
  4. Insert/refresh review rows: create or update review_queue records.
  5. AI quality scoring: compute quality metrics and initial quality classification.
  6. Resize for Ollama: generate temporary model inputs and set ollama_path.
  7. Caption/keywords prefill and proof: local LLM suggestions for caption, alt text, and keywords, with optional classifier hints, strict duplicate controls, bounded repair attempts, metadata_quality proof rows, Stage 6 timeout/quarantine safeguards, and pre-review QC report output in data/prefill_qc_last.json.
  8. Open review editor: enter the human decision phase.
Startup log confirming Ollama processor mode GPU with context and VRAM

Runtime check: startup log confirms active processor mode, context, and VRAM before stage execution.

Prefill QC summary dialog showing duplicate and suspicious row checks

Prefill QC: duplicate and suspicious metadata checks run before the review editor opens.

Metadata quality production pass after bounded repair

Metadata proof: accepted upload rows pass after bounded repair with zero blocked rows.

After the review editor opens (release path):

  1. Review and edit each row for caption, alt text, keywords, filename, and quality fields.
  2. Use Generate for row-level metadata retry; regenerated text is checked against pending-row duplicates before save.
  3. Set each row status to Approved or Rejected based on final human judgment.
  4. Trigger publish for Approved rows only.
  5. Uploader sends full + thumbnail assets to FTP destinations.
  6. Uploader performs MySQL upsert by File_Name and syncs local mirror IDs.
  7. On clean publish, temp Ollama paths are cleaned and final statuses are persisted.
  8. Operator validates logs and website output as final QA.

Correction flow is intentionally fast: when a result is not good enough, reject can reverse the item path so it can be redone cleanly for better output.

Runtime failure handling is also rollback-oriented. If a blocking error occurs (for example caption model missing), the session rollback restores files and releases reserved filenames so the run can be safely retried.

Rollback behavior after caption model error in Amir2000 Image Automation

Figure 2: Real rollback event after caption-stage model error, showing session cleanup and filename reservation release.

The result is a controlled transition from raw files to reviewed records to published assets.

6. Operator Experience And Review Gate

The Multi-Set interface is designed for batch processing with visible stage progression and explicit review decisions.

Multi-set UI for Amir2000 image automation

Figure 3: Multi-Set V1.0 operator UI used to build sets, run stages, and enter review workflow.

Multi-Set UI showing AI subject suggestion

AI subject suggestion: the set subject field can be filled before adding the set to the queue.

Multi-Set UI showing identified subject

AI identify: the stricter identifier path can set a concrete shared subject when evidence supports it.

Review editor V1.0 showing metadata fields and fixed action area

Review editor: generated metadata, quality signals, and fixed Generate/Approve/Reject controls stay visible during review.

Review editor prompt asking whether to upload approved images

Publish prompt: upload starts only after all images are reviewed and the operator confirms the publish action.

Publish complete dialog showing processed and uploaded counts

Publish complete: processed, uploaded, and failed counts are shown at the end of the publish path.

7. Key Engineering Decisions

8. Stack And Ownership

9. Tradeoffs, Roadmap, And ML Planning

Current tradeoffs:

Explicit non-goals (scope boundaries):

Next platform steps:

ML planning track:

10. Deep-Dive Documentation Map

To keep documentation focused and professional, the deep dive is reduced to a core sequence. These are the pages that matter most, in the order readers should follow from Step 0 to Step 5.

Supporting references (optional by need)
© 2026 Amir Darzi
Privacy Policy  |  Photography site | W3C-Valid  |  Cookie settings