Amir2000 Image Automation | Case Study

A local-first desktop pipeline that converts high-volume photo sets into deterministic filenames, review-ready metadata, and publish-ready website assets with a 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. 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

42,429

Largest QC band

Good (18,392 / 43.3%)

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)

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 pipeline flow chart

Figure 1: End-to-end flow chart used as architecture overview.

5. Workflow Walkthrough (Stage By Stage)

The production stage list 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: local LLM suggestions for caption, alt text, and keywords.
  8. Open review editor: enter the human decision phase.

After the review editor opens (release path):

  1. Review and edit each row for caption, alt text, keywords, filename, and quality fields.
  2. Set each row status to Approved or Rejected based on final human judgment.
  3. Trigger publish for Approved rows only.
  4. Uploader sends full + thumbnail assets to FTP destinations.
  5. Uploader performs MySQL upsert by File_Name and syncs local mirror IDs.
  6. On clean publish, temp Ollama paths are cleaned and final statuses are persisted.
  7. 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 operator UI used to run stages and enter review workflow.

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