| name | gemini-cli-photo-classifier |
| description | End-to-end run-image classification with Gemini, including image fetch, prompt control, and JSON output. Use when you need parking or pull-over labels from a run_id. |
| args | <run_id> [timestamp_unixus] |
Gemini Run Photo Classifier
This skill gives a complete, from-scratch flow:
- fetch camera images for a run/timestamp,
- classify with Gemini,
- return strict JSON output.
Inputs
run_id (required)
timestamp_unixus (optional)
prompt (optional override)
model (optional, default gemini-2.0-flash)
If timestamp_unixus is omitted, use the run start time parsed from run_id.
Prerequisites
Run:
command -v bazel >/dev/null && echo "bazel ok" || echo "bazel missing"
command -v az >/dev/null && echo "az ok" || echo "az missing"
Set Gemini key:
export GEMINI_API_KEY="$(az keyvault secret show --vault-name kv-prod-shared-secrets --name gemini-api-key --query value -o tsv)"
Step 1: Discover the runnable target
TARGET="$(bazel query 'kind(py_binary, //...)' | rg 'manual_gemini_from_run$' | head -n1)"
test -n "$TARGET" && echo "target: $TARGET" || echo "manual_gemini_from_run target not found"
If target is missing, stop and implement/add the helper binary first.
Step 2: Run classification
Basic image classification:
bazel run "$TARGET" -- \
--run-id "<run_id>" \
--output-dir /tmp/manual_gemini_from_run
With explicit timestamp:
bazel run "$TARGET" -- \
--run-id "<run_id>" \
--timestamp-unixus <timestamp_unixus> \
--output-dir /tmp/manual_gemini_from_run
Step 3: Override prompt/model when needed
bazel run "$TARGET" -- \
--run-id "<run_id>" \
--prompt "Classify as one of: parking, pulling_over, driving_other. Return JSON with label/confidence/reasoning." \
--model gemini-2.0-flash \
--output-dir /tmp/manual_gemini_from_run
Output
Read:
cat /tmp/manual_gemini_from_run/classification_result.json
Expected JSON includes:
run_id
timestamp_unixus
model
- fetched
images per camera
classification object from Gemini
Troubleshooting
GEMINI_API_KEY is not set: export the key first.
- Databricks auth warnings can appear during timestamp/materialization steps; fallback image fetch may still succeed.
- Some runs/timestamps may only return a subset of cameras.
- If
classification confidence is low or label is ambiguous, run a second timestamp nearby and compare.