diff --git a/README.md b/README.md index 06e77ea..8e34535 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,13 @@ account into a deduplicated local directory tree, skipping files that already exist on disk and continuing past individual download failures instead of crashing. For each file it persists the basic metadata fields quak keeps (title, file type, creation and modification time, latitude, longitude, content hash), -its update time, the private and public magic metadata in full, Ente's ML data -for it when there is any, and, for an image (for a live photo, its image), its -original's EXIF and XMP, with its dimensions for a JPEG only; for a video it -keeps none of these three. It runs unattended from cron (see "Running the backup -from cron"). A helper subcommand can detect and regenerate missing thumbnails, -encrypting and uploading them back to the server. +its update time, and the private and public magic metadata in full. It keeps any +ML data Ente has for the file, except the CLIP embedding, and writes the file's +keywords in place of the embedding. For an image (for a live photo, its image), +it keeps its original's EXIF and XMP, with its dimensions for a JPEG only. For a +video it keeps none of these three. It runs unattended from cron (see "Running +the backup from cron"). A helper subcommand can detect and regenerate missing +thumbnails, encrypting and uploading them back to the server. ## Getting Started @@ -371,6 +372,11 @@ quak/ backup-metadata: the metadata quak keeps, as JSON exif.ts EXIF read from an image's bytes with exifreader mldata-fetch.ts fetch + decrypt per-file ML data + clip-keywords.ts + a file's keywords from its CLIP embedding + clip-keyword-vectors.ts + Ente's Discover categories with their text + embeddings, written by bin/clip-keyword-vectors filename.ts safe file names from server metadata errors.ts error types shared across layers, and how an error is described @@ -387,6 +393,9 @@ quak/ index.ts public library exports bin/ quak.ts CLI entrypoint (commander.js) + clip-keyword-vectors, clip-keyword-vectors.py + write src/clip-keyword-vectors.ts and a test + fixture (see Source attribution) examples/ download-albums.ts download every album's photos and metadata @@ -783,9 +792,11 @@ as it was and goes into `failures.json` (see "Backup layout"). `backup-metadata ` writes `account.json` and, for each collection, a directory `collections/-/` holding `_collection.json` and a -`.json` for each of its files. The collection's name has unsafe -characters replaced and is cut short between two characters so that the -directory's name fits in 255 bytes; the ID keeps the directories apart. +`.json` for each of its files. Each `.json` holds the file's ML +data and keywords as `quak backup` writes them (see "Backup layout"). The +collection's name has unsafe characters replaced and is cut short between two +characters so that the directory's name fits in 255 bytes; the ID keeps the +directories apart. `backup-metadata` fetches ML data in requests of up to 200 files. When a request fails, the error is logged, each of its files is written with the reason in an @@ -818,11 +829,11 @@ the smallest does not. below) YYYY-MM-DD..json the file's basic metadata fields quak keeps, its update time, its private and - public magic metadata, its ML data, and, - for an image (for a live photo, its - image), its original's EXIF and XMP, with - dimensions for a JPEG only; none of these - three for a video + public magic metadata, its ML data and + keywords, and, for an image (for a live + photo, its image), its original's EXIF + and XMP, with dimensions for a JPEG + only; none of these three for a video YYYY-MM-DD..livephoto.json which of a live photo's two files is which collections/ @@ -853,20 +864,51 @@ JSON holds its `id`, `collectionID`, `ownerID`, `metadata` and `updationTime`, and its `magicMetadata` and `pubMagicMetadata` when it has them. Update times are in microseconds, as Ente records them. -A file's JSON holds Ente's ML data for it (its faces and its CLIP embedding) as -`mlData`, the same payload `backup-metadata` writes; a file Ente has no ML data -for has no `mlData`. The backup waits for the library's ML data fetch to finish -before it writes the JSON files. If that fetch fails, each file whose ML data is -not in the cache gets the reason in `mlDataError` instead and counts as failed, -and the next run fetches it again. The same goes for a file with no ML data in -the cache whose ML data the server sent but quak could not decrypt, gunzip or -parse. Its `mlDataError` says why, and `failures.json` records it with an error -starting `ML data: `. quak keeps that reason in memory only and caches nothing -for the file, so the next run asks for its ML data again. An ML data fetch that -fails, such as one the library's refresh starts while the backup writes the JSON -files, leaves the reasons as the last fetch that succeeded left them. The JSON -files are rewritten on every run, so ML data that arrived since the last run -appears. +A file's JSON holds Ente's ML data for it as `mlData`, such as the faces Ente +found, without its CLIP embedding. It holds `keywords` in place of the +embedding. + +The Discover section of Ente's photos app has 16 categories: + +- Identity (no videos) +- Screenshots (no videos) +- QR Codes (no videos) +- Receipts +- Notes +- Memes +- Visiting Cards (no videos) +- Babies +- Pets +- Selfies +- Wallpapers (no videos) +- Food +- Celebrations +- Sunset +- Hills +- Greenery + +A file's keywords are the titles of the categories it falls in. A file's score +for a category is the cosine similarity of its CLIP embedding and the text +embedding of the category's query. As in Ente's app, the file falls in the +category when that score is at least the category's minimum score. A video never +falls in a category marked "no videos". The keywords are listed highest score +first. + +A file with no ML data has neither `mlData` nor `keywords`. A file whose ML data +holds no usable CLIP embedding has no `keywords`. `backup-metadata` writes both +fields the same way. + +The backup waits for the library's ML data fetch to finish before it writes the +JSON files. If that fetch fails, each file whose ML data is not in the cache +gets the reason in `mlDataError` instead and counts as failed, and the next run +fetches it again. The same goes for a file with no ML data in the cache whose ML +data the server sent but quak could not decrypt, gunzip or parse. Its +`mlDataError` says why, and `failures.json` records it with an error starting +`ML data: `. quak keeps that reason in memory only and caches nothing for the +file, so the next run asks for its ML data again. An ML data fetch that fails, +such as one the library's refresh starts while the backup writes the JSON files, +leaves the reasons as the last fetch that succeeded left them. The JSON files +are rewritten on every run, so ML data that arrived since the last run appears. A file's JSON holds, as `imageMetadata`, what `backup-metadata --exif` records from its original, or from a live photo's image: `format`, `width` and `height` @@ -1270,18 +1312,18 @@ photos newest first). `lib.subscribe({ onChange })` delivers a `LibraryChange` not already at its save path there as `photo.download()` does (and, with `includeThumbnails`, fetches thumbnails) through the content cache, waits for an ML data fetch, and rebuilds the on-disk backup tree with a durable failure - ledger. Each file's JSON holds its ML data and, for an image (for a live - photo, its image), its original's EXIF and XMP, with its dimensions for a JPEG - only; a video's JSON holds none of these three. A fetched original is written - straight to its save path and not into the cache, which then counts it as - present; one the cache already held is copied from there. `BackupOptions`: - `downloadDirectory` (falls back to the library's), `includeOriginals` (default - `true`), `includeThumbnails` (default `false`), `onlyAlbumNames`, `verify` - (default `false`), `onProgress`, and `lock`. See Backup layout above for the - tree it writes, and for the albums `BackupResult` lists in - `undecryptableAlbums` and `failedAlbums`. Whether the backup took the lock or - its caller did, once the lock is lost the backup rejects with - `lost the lock on : ` before it starts another file. + ledger. Each file's JSON holds its ML data and keywords. An image's JSON also + holds the EXIF and XMP of its original, and its dimensions if it is a JPEG. A + live photo's JSON holds these for its image. A video's JSON holds no EXIF, XMP + or dimensions. A fetched original is written straight to its save path and not + into the cache, which then counts it as present; one the cache already held is + copied from there. `BackupOptions`: `downloadDirectory` (falls back to the + library's), `includeOriginals` (default `true`), `includeThumbnails` (default + `false`), `onlyAlbumNames`, `verify` (default `false`), `onProgress`, and + `lock`. See Backup layout above for the tree it writes, and for the albums + `BackupResult` lists in `undecryptableAlbums` and `failedAlbums`. Whether the + backup took the lock or its caller did, once the lock is lost the backup + rejects with `lost the lock on : ` before it starts another file. ### Request pools @@ -1364,6 +1406,14 @@ is rewritten in TypeScript in this repository. Protocol fidelity is verified against the upstream implementations in `web/packages/base/`, `mobile/apps/photos/lib/`, and `cli/`. +The keywords come from Ente too. `src/clip-keyword-vectors.ts` holds the +Discover categories of Ente's photos app, from +`mobile/apps/photos/assets/discover.json`, each with its query's text embedding +from Ente's CLIP text model. `bin/clip-keyword-vectors` writes that file and the +CLIP embedding of a public-domain photo that the tests use. It runs Ente's +models in Docker, with every download pinned by sha256. It is run by hand only, +followed by `make fmt`. + ## For LLMs If you are an LLM agent working on this repository, read and follow these diff --git a/TODO.md b/TODO.md index f1de6ec..99ae803 100644 --- a/TODO.md +++ b/TODO.md @@ -26,6 +26,18 @@ declares one. # Completed Steps +- 2026-10-22: The JSON `quak backup` and `quak backup-metadata` write for a file + holds `keywords` in place of the CLIP embedding in its ML data + (https://git.eeqj.de/sneak/quak/issues/218). The keywords are the titles of + the Discover categories of Ente's photos app that the file falls in, by the + app's rule: the cosine similarity of the file's CLIP embedding and the text + embedding of a category's query is at least the category's minimum score, and + videos stay out of the categories that leave them out. `src/clip-keywords.ts` + applies the rule. `src/clip-keyword-vectors.ts` holds the 16 categories with + their text embeddings. `bin/clip-keyword-vectors` writes it with Ente's CLIP + text model, and writes the CLIP embedding of a public-domain photo of a sunset + that the tests use. + - 2026-10-18: `-v`/`--verbose` raises the CLI's log level once for each repeat, and `-q`/`--quiet` prints only fatal errors (https://git.eeqj.de/sneak/quak/issues/212). The levels are fatal, error, diff --git a/bin/clip-keyword-vectors b/bin/clip-keyword-vectors new file mode 100755 index 0000000..df4a75f --- /dev/null +++ b/bin/clip-keyword-vectors @@ -0,0 +1,31 @@ +#!/bin/sh +# Writes src/clip-keyword-vectors.ts and test/clip-keywords-sunset.json by +# running bin/clip-keyword-vectors.py in a Python image pinned by digest, with +# its packages pinned by hash. Run it by hand from a checkout, then `make fmt`; +# no gate runs it. Besides the Python image, it downloads about 265 MB, most of +# it Ente's two CLIP models. +set -eu + +ROOT="$(cd "$(dirname "$0")/.." && pwd -P)" + +# python:3.13-slim (Python 3.13.17 on Debian 13.7), 2026-10-21. The wheels +# below are the ones for this image on linux/amd64. +IMAGE=python@sha256:57b29a7c050c4e679e4bea572e14b3965cf4b5839de2da49d55e49ffc4024f39 + +main() { + cd "$ROOT" + docker run --rm -i --platform linux/amd64 \ + --user "$(id -u):$(id -g)" -e HOME=/tmp \ + -v "$ROOT:/repo" -w /repo "$IMAGE" sh -c ' + python -m venv /tmp/venv && + /tmp/venv/bin/pip install --quiet --disable-pip-version-check \ + --no-cache-dir --no-deps --require-hashes -r /dev/stdin && + /tmp/venv/bin/python bin/clip-keyword-vectors.py' <<'EOF' +numpy==2.5.3 --hash=sha256:a5fa86b80fd24bcd1aff83ad23be44ea323de3f787be8f8b15d4a65621e25321 +onnxruntime==1.30.0 --hash=sha256:86f940afc801ea9681a4da8af84fbe95e1d9ea7d80903952cc1bfad54faad38f +pillow==12.3.0 --hash=sha256:0847a763afefb695bc912d7c131e7e0632d4edc1d8698f58ddabec8e46b8b6d3 +tokenizers==0.23.2 --hash=sha256:41c2f84d172449b4dadb9cdc508e3e364076613c35b16e76ecfe47a60d1e3305 +EOF +} + +main "$@" diff --git a/bin/clip-keyword-vectors.py b/bin/clip-keyword-vectors.py new file mode 100644 index 0000000..af888fa --- /dev/null +++ b/bin/clip-keyword-vectors.py @@ -0,0 +1,158 @@ +"""Write src/clip-keyword-vectors.ts and test/clip-keywords-sunset.json. + +bin/clip-keyword-vectors runs this in a pinned Python image. It downloads +Ente's Discover list, Ente's CLIP text and image models, the CLIP tokenizer +and a public-domain photo of a sunset, checks each against its sha256, and +writes: + +- src/clip-keyword-vectors.ts: each Discover category of Ente's photos app, + with the text embedding Ente's CLIP text model gives its query; +- test/clip-keywords-sunset.json: the CLIP embedding Ente's image model gives + the photo, prepared as Ente's apps prepare a photo. + +Both embeddings are scaled to length 1, as Ente's apps scale them. +""" + +import hashlib +import io +import json +import urllib.request + +import numpy as np +import onnxruntime +from PIL import Image, ImageOps +from tokenizers import Tokenizer + +ENTE_COMMIT = "f5ad70a860ed25d0c8057b0efb4bd6eaefe4b0c5" +DISCOVER_PATH = "mobile/apps/photos/assets/discover.json" +DISCOVER_URL = ( + f"https://raw.githubusercontent.com/ente-io/ente/{ENTE_COMMIT}/{DISCOVER_PATH}" +) +DISCOVER_SHA256 = "cf70ac7116b592f7921ca4cf67cdbb421a8e6b287fbe44b2be678b8d198e5c24" + +TEXT_MODEL = "mobileclip_s2_text_opset18_quant.onnx" +TEXT_MODEL_SHA256 = "d92f33dfcff83077fc2e0d3414250710efbb51795dfd89767bdbefb5fdc47322" +IMAGE_MODEL = "mobileclip_s2_image_gelu_opset20.onnx" +IMAGE_MODEL_SHA256 = "205a430af825e501c5138e5bb9abea942482a7a4fd4a680e98e47cf0830dce7e" + +# The CLIP tokenizer Hugging Face publishes for OpenAI's CLIP. Its vocabulary +# and merges are those of bpe_simple_vocab_16e6.txt, the vocabulary Ente's +# apps tokenize with. +TOKENIZER_URL = ( + "https://huggingface.co/openai/clip-vit-base-patch32/resolve/" + "3d74acf9a28c67741b2f4f2ea7635f0aaf6f0268/tokenizer.json" +) +TOKENIZER_SHA256 = "b556ac8c99757ffb677208af34bc8c6721572114111a6e0aaf5fa69ff0b8d842" + +# "Sunset off the Massachusetts coast", a NOAA photo in the public domain: +# https://commons.wikimedia.org/wiki/File:Sunset_off_the_Massachusetts_coast_-_NOAA.jpg +PHOTO_URL = ( + "https://upload.wikimedia.org/wikipedia/commons/d/db/" + "Sunset_off_the_Massachusetts_coast_-_NOAA.jpg" +) +PHOTO_SHA256 = "be62f3289c9bf7b75af68cd6978021d54e8a531d5d4cc493f6e9fbf5e1ab74d3" + +# Ente's text model takes 77 token ids, padded with 0; its image model takes +# a 256x256 RGB image. +TOKEN_COUNT = 77 +IMAGE_SIZE = 256 + + +def download(url, sha256): + # Wikimedia refuses requests without a User-Agent. + request = urllib.request.Request(url, headers={"User-Agent": "quak"}) + with urllib.request.urlopen(request) as response: + data = response.read() + digest = hashlib.sha256(data).hexdigest() + if digest != sha256: + raise SystemExit(f"{url} has sha256 {digest}, not {sha256}") + return data + + +def ente_model(name, sha256): + return onnxruntime.InferenceSession( + download(f"https://models.ente.com/{name}", sha256), + providers=["CPUExecutionProvider"], + ) + + +def run(session, tensor): + (output,) = session.run(None, {session.get_inputs()[0].name: tensor}) + embedding = output[0] + return embedding / np.linalg.norm(embedding) + + +def text_embedding(session, tokenizer, query): + ids = tokenizer.encode(query).ids + ids += [0] * (TOKEN_COUNT - len(ids)) + return run(session, np.array([ids], dtype=np.int32)) + + +def image_embedding(session, photo): + image = ImageOps.exif_transpose(Image.open(io.BytesIO(photo))).convert("RGB") + # Scale to cover IMAGE_SIZE x IMAGE_SIZE and crop the centre. + square = ImageOps.fit(image, (IMAGE_SIZE, IMAGE_SIZE), Image.Resampling.BILINEAR) + pixels = np.asarray(square, dtype=np.float32) / 255 + return run(session, pixels.transpose(2, 0, 1)[np.newaxis]) + + +def numbers(embedding): + return ", ".join(str(value) for value in embedding) + + +def write_categories(prompts, embeddings): + lines = [ + "// Written by bin/clip-keyword-vectors; do not edit by hand.", + "//", + "// The Discover categories of Ente's photos app, in their order, from", + f"// {DISCOVER_PATH} in https://github.com/ente-io/ente", + f"// at commit {ENTE_COMMIT}. Each has the text", + f"// embedding Ente's CLIP text model ({TEXT_MODEL})", + "// gives its query, scaled to length 1. `showVideo` is false for a category", + "// that leaves out videos.", + "", + "export const DISCOVER_CATEGORIES = [", + ] + for prompt, embedding in zip(prompts, embeddings): + lines += [ + " {", + f" title: {json.dumps(prompt['title'])},", + f" query: {json.dumps(prompt['query'])},", + f" minScore: {json.dumps(prompt['minScore'])},", + f" showVideo: {json.dumps(prompt.get('showVideo', True))},", + f" textEmbedding: [{numbers(embedding)}],", + " },", + ] + lines.append("];") + with open("src/clip-keyword-vectors.ts", "w", encoding="utf-8") as file: + file.write("\n".join(lines) + "\n") + + +def write_fixture(embedding): + with open("test/clip-keywords-sunset.json", "w", encoding="utf-8") as file: + file.write( + "{\n" + f' "photo": {json.dumps(PHOTO_URL)},\n' + f' "sha256": {json.dumps(PHOTO_SHA256)},\n' + f' "embedding": [{numbers(embedding)}]\n' + "}\n" + ) + + +def main(): + prompts = json.loads(download(DISCOVER_URL, DISCOVER_SHA256))["prompts"] + tokenizer = Tokenizer.from_str( + download(TOKENIZER_URL, TOKENIZER_SHA256).decode("utf-8") + ) + text_model = ente_model(TEXT_MODEL, TEXT_MODEL_SHA256) + embeddings = [ + text_embedding(text_model, tokenizer, prompt["query"]) for prompt in prompts + ] + write_categories(prompts, embeddings) + + image_model = ente_model(IMAGE_MODEL, IMAGE_MODEL_SHA256) + write_fixture(image_embedding(image_model, download(PHOTO_URL, PHOTO_SHA256))) + + +if __name__ == "__main__": + main() diff --git a/src/backup.ts b/src/backup.ts index 37e5116..659275c 100644 --- a/src/backup.ts +++ b/src/backup.ts @@ -14,9 +14,9 @@ // YYYY/YYYY-MM/YYYY-MM-DD/ // YYYY-MM-DD.. the decrypted bytes (the save path) // YYYY-MM-DD..json per-file metadata sidecar, with -// the file's ML data and its -// original's EXIF, XMP and -// dimensions +// the file's ML data, its +// keywords, and its original's +// EXIF, XMP and dimensions // collections// symlink to the original // collections/<name>.json per-collection metadata // account.json the account's email and user ID @@ -77,6 +77,7 @@ import { readFile } from "node:fs/promises"; import { dirname, extname, join, relative, resolve } from "node:path"; import lockfile from "proper-lockfile"; +import { clipKeywords } from "./clip-keywords.js"; import { removeLeftoverTempFiles } from "./download/index.js"; import { describeError } from "./errors.js"; import { @@ -497,8 +498,9 @@ const imageMetadataFor = async ( } }; -// The file's JSON: its basic fields, its magic metadata, its ML data or the -// reason the ML data is missing, and its image metadata. +// The file's JSON: its basic fields, its magic metadata, its ML data without +// the CLIP embedding and the keywords that embedding gives, or the reason the +// ML data is missing, and its image metadata. const writeSidecar = ( path: string, file: EnteFile, @@ -514,7 +516,13 @@ const writeSidecar = ( }; if (file.magicMetadata) meta.magicMetadata = file.magicMetadata; if (file.pubMagicMetadata) meta.pubMagicMetadata = file.pubMagicMetadata; - if (ml.mlData) meta.mlData = ml.mlData; + if (ml.mlData) { + const { clip: _clip, ...mlDataWithoutClip } = ml.mlData; + meta.mlData = mlDataWithoutClip; + const isVideo = file.metadata.fileType === "video"; + const keywords = clipKeywords(ml.mlData, isVideo); + if (keywords) meta.keywords = keywords; + } if (ml.mlDataError) meta.mlDataError = ml.mlDataError; if (image.imageMetadata) meta.imageMetadata = image.imageMetadata; if (image.imageMetadataError) { diff --git a/src/clip-keyword-vectors.ts b/src/clip-keyword-vectors.ts new file mode 100644 index 0000000..9dd3543 --- /dev/null +++ b/src/clip-keyword-vectors.ts @@ -0,0 +1,1836 @@ +// Written by bin/clip-keyword-vectors; do not edit by hand. +// +// The Discover categories of Ente's photos app, in their order, from +// mobile/apps/photos/assets/discover.json in https://github.com/ente-io/ente +// at commit f5ad70a860ed25d0c8057b0efb4bd6eaefe4b0c5. Each has the text +// embedding Ente's CLIP text model (mobileclip_s2_text_opset18_quant.onnx) +// gives its query, scaled to length 1. `showVideo` is false for a category +// that leaves out videos. + +export const DISCOVER_CATEGORIES = [ + { + title: "Identity", + query: "identity documents and cards", + minScore: 0.2, + showVideo: false, + textEmbedding: [ + 0.03607934, -0.015425337, -0.0043316674, 0.009292002, -0.025645005, + 0.014152668, -0.0076436675, 0.014114335, -0.041070342, 0.007275668, + 0.015916003, 0.017763669, 0.033603005, 0.009023668, -0.03352634, + 0.5298818, 0.0017940004, -0.0076360013, -0.042412005, -0.0015103335, + 0.025008671, -0.023552004, -0.024357004, 0.008088335, -0.013907337, + -0.0021313336, -0.019741671, 0.017365003, 0.037566673, -0.018898336, + 0.023245338, -0.008395001, 0.018032003, 0.041430674, -0.007728001, + 0.019948669, -0.010189001, 0.03670034, -0.022923337, -0.04807001, + -0.060191013, 0.01716567, -0.013171336, -0.011308336, 0.011837335, + -0.015893003, -0.018377002, 0.026296671, 0.027684337, 0.043914672, + -0.038801007, -0.024265004, 0.010127668, -0.043102007, + 0.00044466674, -0.02084567, -0.003664667, -0.008786001, + -0.020301336, -0.026036004, 0.019933337, -0.033258006, 0.014275335, + -0.039866675, -0.11761435, 0.02468667, -0.007950335, -0.024817005, + -0.0035036672, 0.0030590005, -0.038517337, 0.035282005, + -0.059524007, -0.029716006, 0.0070456676, -0.024610003, + -0.042941008, -0.015663004, 0.016935669, -0.00097366684, + -0.00071300013, 0.016859002, 0.02664167, -0.0052976673, + -0.005075334, 0.013930335, -0.0065626674, -0.031096006, 0.019120669, + 0.010434335, 0.008287668, -0.006401668, 0.006647001, 0.006340334, + 0.0077510015, 0.02337567, 0.099183686, 0.011914002, -0.011776002, + -0.0072296676, 0.00088166684, 0.029363338, 0.0118986685, + -0.030551674, -0.04252701, -0.012105669, -0.05200301, 0.007666668, + 0.0038180007, -0.011132002, -0.009713668, 0.0006516668, 0.2377357, + -0.031441007, -0.028305337, -0.010825335, 0.02919467, -0.012190002, + 0.050508007, -0.019389004, -0.05011701, 0.0058113346, -0.017020002, + 0.013363002, -0.0026526672, 0.038640004, 0.01987967, -0.013577669, + -0.012542669, -0.008701668, -0.03423934, -0.034431007, 0.013570002, + -0.0051903343, -0.043056007, -0.0021773337, -0.022777671, + 0.021497337, -0.066209346, 0.004262667, 0.010388334, -0.009644669, + -0.015778001, 0.038494337, 0.026105003, 0.010741002, -0.048790675, + 0.002913334, 0.030812338, -0.016299335, 0.0048990007, -0.02036267, + -0.023306672, 0.0006823334, -0.029478338, 0.03545067, -0.01394567, + -0.0044083344, 0.04194434, 0.020025337, 0.012987335, 0.006969001, + 0.019941004, -0.0055966675, 0.009253668, -0.06916101, -0.006210001, + -0.53356177, -0.023207005, -0.020102004, 0.003204667, 0.057454012, + 0.013715669, 0.0029670005, -0.016238004, 0.01852267, 0.0058573345, + -0.0033580007, 0.0023613337, -0.01596967, -0.00085866684, + -0.016138336, 0.02236367, 0.00042166674, -0.02270867, 0.013301668, + -0.009000667, 0.024832336, 0.013447335, -0.033971004, -0.06357968, + -0.030689672, 0.0049220007, 0.012259002, 0.019059336, 0.005826668, + 0.008195668, -0.031111337, 0.0090620015, 0.0037413337, -0.017035335, + 0.00093533343, -0.054249346, 0.0041246675, 0.016912669, 0.020493003, + 0.025361337, -0.014306002, 0.011392668, 0.04227401, -0.014283002, + -0.0013953336, -0.059715677, -0.045777675, -0.012481336, + 0.022141337, 0.062138345, 0.031763006, -0.0031740007, -0.0062483344, + -0.043431673, 0.07113135, 0.016092336, 0.008218668, 0.016284002, + 0.03701467, 0.0007283335, -0.007620668, -0.0062866677, -0.039897338, + -0.006095001, 0.036884338, -0.011630335, 0.003626334, -0.0059416676, + -0.053567007, -0.007275668, 0.005704001, 0.0066623343, -0.026289005, + 0.017664002, 0.014482335, 0.01930467, 0.0073523344, -0.009805668, + 0.005397334, -0.04258067, -0.008149668, 0.025744673, 0.0076820017, + 0.019818338, 0.007291001, -0.040802006, -0.047065675, 0.0024150002, + -0.014950003, -0.0072680013, 0.04578534, 0.00057500013, -0.01806267, + 0.015410002, -0.013830668, 0.0106413355, -0.0013646669, 0.019910336, + -0.0023076672, 0.018262004, 0.0036876672, 0.020953003, + -0.0038793338, -0.011055335, 0.005650334, 0.07518701, -0.022931004, + -0.006210001, -0.016077003, 0.007291001, -0.010449668, -0.03227667, + -0.014957669, -0.021850005, -0.010871335, 0.02323767, -0.046237674, + 0.026925337, -0.010357669, 0.01642967, -0.020002337, 0.032614004, + -0.0039483337, -0.004937334, 0.03311234, -0.06581835, -0.01863767, + 0.007344668, 0.028650336, 0.006041334, -0.07347734, 0.033534005, + 0.029815672, 0.008272334, 0.063426346, 0.0032506671, -0.026818004, + -0.03571134, -0.017472336, -0.01576267, -0.006447668, 0.030712672, + 0.003626334, 0.012696003, 0.026404003, -0.025790673, 0.0023230005, + -0.025016338, -0.11878735, -0.04511834, 0.03575734, -0.041292675, + -0.014681669, -0.038709007, -0.042205006, -0.0078276675, + -0.028888004, -0.070548676, 0.038923673, 0.014037669, 0.0005366667, + -0.007981001, -0.03969034, 0.026818004, -0.010526335, -0.0039483337, + 0.02360567, -0.01921267, -0.02351367, -0.009069668, -0.0029363339, + 0.0018553336, 0.013508668, 0.003626334, -0.0011653336, -0.07035702, + 0.024924338, 0.025392005, -0.0013570002, 0.008441001, 0.021750337, + -0.07450468, -0.0063480013, 0.027906671, 0.0018630002, 0.007038001, + 0.026810339, 0.031625006, -0.01576267, -0.027707336, 0.011684002, + -0.021413004, -0.0032736673, -0.0057193344, -0.018055003, + -0.012857001, -0.04456634, 0.025085337, 0.03508267, -0.02153567, + -0.015172335, 0.016376004, 0.005152001, 0.0011040001, -0.0027983338, + -0.025085337, -0.05013234, 0.012711335, 0.095787354, -0.034423336, + -0.020723004, -0.065412015, 0.012427669, 0.0026833336, 0.0066546677, + -0.008134334, 0.014313668, 0.007919668, -0.009813335, -0.011607335, + -0.05103701, 0.025568336, -0.008379668, -0.0008740002, -0.064837016, + -0.018346336, -0.0062330007, -0.015954336, 0.005443334, + -0.007620668, 0.030766338, -0.004055667, -0.10353068, -0.009568001, + -0.010802335, -0.004692001, 0.0068386677, -0.018599337, 0.02758467, + 0.037727673, -0.07813101, 0.027822338, -0.019642003, -0.02181167, + -0.0015256669, -0.02726267, -0.03633234, -0.03617134, -0.010656669, + -0.008617334, 0.013501002, -0.003166334, -0.033219673, -0.015026669, + -0.0046996675, -0.038003676, 0.020439336, 0.012596336, -0.019864338, + -0.010488002, -0.021098671, 0.01631467, 0.041844673, -0.0133706685, + -0.04556301, 0.009491335, -0.007981001, 0.016935669, -0.03246067, + -0.029693006, 0.015272003, 0.010618336, 0.0025760005, -0.040863343, + 0.006164001, 0.010327002, 0.019642003, 0.023069004, -0.01665967, + -0.01769467, 0.009575669, -0.028198004, 0.011645668, -0.018921336, + 0.016537003, -0.02751567, 0.007544001, -0.017572002, 0.021045003, + -0.011553668, -0.029601006, -0.0057423343, -0.0029286672, + -0.03575734, -0.02243267, 0.020263003, -0.01442867, -0.0030436672, + 0.00042166674, 0.02266267, 0.04010434, -0.009460668, -0.022103004, + -0.0059186677, 0.022256337, -0.043914672, 0.0064706677, + -0.055591006, 0.010871335, -0.008878002, -0.009468335, 0.011024669, + -0.0070456676, -0.005282334, 0.0034730004, 0.010150668, + -0.013508668, 0.0069536683, -0.0011730002, -0.02929434, 0.024717337, + 0.0071683344, 0.04610734, -0.020378003, 0.04194434, -0.03824901, + -0.008195668, -0.02967767, -0.019381337, 0.01836167, 0.034898672, + -0.03818001, -0.010679669, 0.016874336, -0.008870334, 0.004339334, + 0.010986335, 0.008203334, 0.013117669, 0.044420674, -0.013501002, + -0.011960002, -0.013930335, -0.0070533347, -0.015456002, + ], + }, + { + title: "Screenshots", + query: "screenshots", + minScore: 0.18, + showVideo: false, + textEmbedding: [ + 0.043836724, 0.016966958, 0.017219765, -0.005612314, -0.024269465, + -0.010343416, 0.00104012, -0.02295487, 0.017357003, 0.03262654, + 0.013608237, -0.005966244, -0.020267894, -0.021791957, 0.0, + 0.5200383, -0.015457339, -0.009093828, 0.019870626, 0.010646784, + 0.025995778, 0.0034237283, -0.0064574117, -0.02659529, 0.0030481294, + 0.0038571118, -0.025750192, -0.013528784, -0.0042038183, + -0.020137878, -0.0064357426, -0.03201258, 0.049723517, + -0.0018418792, 0.0118096955, 0.012430879, -0.02231924, + -0.0026436383, 0.011788026, 0.017530356, 0.020939637, -0.007649216, + 0.007865908, 0.02413223, 0.043872837, -0.0033081593, -0.008003145, + 0.012336979, 0.030264601, -0.013962167, -0.0075553157, -0.008855466, + -0.031925905, -0.001170135, 0.011564112, -0.0023980546, + -0.031940352, 0.029282266, 0.034937922, -0.009548879, -0.023229348, + 0.028581629, -0.026768643, 0.0015168416, -0.05953965, 0.04403897, + 0.0075769853, 0.015334547, 0.005836229, 0.020585708, -0.006471858, + 0.015544015, 0.01524787, 0.003936565, 0.020672385, -0.01849102, + -0.028112132, 0.014525565, -0.09122719, -0.010733461, 0.02137302, + 0.027808763, -0.0100183785, 0.0661054, -0.034764566, -0.023178786, + -0.020462917, 0.0028314379, -0.026891435, -0.00867489, 0.011224628, + -0.00978724, -0.021019092, 0.0150095085, 0.0060529206, -0.008176499, + 0.14191137, 0.045209102, 0.048683394, -0.014366657, 0.040774148, + -0.013796036, 0.0137021355, -0.040933058, 0.01283537, 0.020773508, + -0.076333255, -0.0111451745, -0.01945891, 0.026855322, + -0.0023041547, -0.057965018, 0.2242542, -0.031131368, -0.007526424, + 0.07724336, 0.010574553, 0.023301577, -0.0034309514, -0.005735106, + -0.019921187, 0.030084027, -0.020390686, -0.0037704348, 0.04054301, + -0.008718228, 0.030315163, -0.0071291556, -0.034779012, 0.017450903, + -0.008624328, -0.034461197, 0.023344915, -0.016779158, -0.03203425, + -0.0041315877, 0.0064501883, 0.028740536, -0.021625828, -0.03971958, + 0.009158835, -0.030437957, -0.006941356, 0.030582415, -0.008494314, + -0.004572194, 0.0015674031, 0.010162839, 0.019516697, 0.002224701, + -0.02555517, -0.0058145598, -0.018230991, -0.0025497386, + 0.027750978, 0.011210182, 0.0017335333, 0.0007295286, -0.02125023, + 0.016598582, -0.0069991406, 0.015710145, 0.023186008, 0.020556815, + 0.019227773, -0.01526954, -0.014706141, -0.52540505, 0.018700492, + -0.023055993, -0.0026941996, 0.076246575, 0.009548879, 0.014496672, + -0.0005778444, 0.0048538935, -0.01636022, -0.018498246, + -0.048134442, -0.09872472, 0.0043916176, -0.006731888, 0.019588927, + -0.008891582, 0.025894655, -0.010668453, 0.05787834, -0.023012655, + 0.035783015, -0.0048972317, 0.0073747393, -0.011101836, + -0.015999068, 0.039437883, -0.03089301, -0.030452402, 0.035544656, + -0.052388825, -0.013897159, 0.03860001, -0.03905506, -0.006731888, + -0.025757415, -0.0015962953, 0.03382557, -0.03923564, 0.017096972, + 0.049774073, -0.011578558, 0.0129364915, -0.021329682, + -0.0021958088, -0.0033876128, -0.0137021355, 0.024197236, + 0.02167639, -0.030452402, 0.0023330469, -0.0100978315, -0.028747762, + -0.015832938, -0.038419433, 0.007865908, 0.0039510117, -0.005453407, + 0.04182149, 0.016598582, -0.0048611164, 7.2230555e-6, -0.03695315, + 0.032308728, 0.02316434, -0.016511904, -0.052749973, 0.0002961453, + -0.048567824, -0.032308728, 0.021069653, 0.005077808, -0.009462202, + -0.0321426, 0.013015946, 0.011997496, -0.011072944, -0.014843379, + 0.07510533, 0.028242148, -0.04544024, -0.05197711, -0.0107840225, + -0.010942929, -0.023539938, 0.020051202, 0.035494093, -0.04436401, + -0.0033081593, 0.013550451, -0.0076564387, -0.0065657576, + 0.0059445747, 0.014482226, -0.021900306, -0.013796036, -0.030669093, + 0.005467853, 0.0077142236, -0.007909246, -0.06104204, 0.02491232, + -0.0065802033, 0.0052439384, 0.010105055, 0.015565684, -0.0129076, + -0.034222838, 7.945361e-5, 0.01978395, -0.010906814, 0.010256739, + 2.8892222e-5, 0.034143385, 0.013391544, 0.005467853, -0.01212751, + 0.031405848, -0.010935706, -0.008552098, 0.0047094324, -0.012445324, + -0.02347493, -0.017060857, 0.027606517, -0.048524488, 0.010523992, + -0.0066163186, -0.006370735, -0.00048394472, 0.03725652, + -0.005937352, -0.0125753395, 0.010704569, 0.007887577, 0.0014518342, + 0.032055918, -0.012979831, 0.017956516, 0.008335406, -0.06319451, + 0.01430165, -0.019978972, 0.012806477, -0.0154140005, -0.006529642, + -0.012185294, 0.011535219, 0.07436857, -0.06877793, 0.009823356, + -0.021221336, 0.0028819991, 0.0064790808, -0.017927622, -0.01604963, + 0.0046516475, 0.043266103, 0.01014117, 0.0035176282, -0.05184709, + 0.02659529, -0.045895297, 0.022853747, -0.031875346, 0.0060673663, + -0.046632048, -0.0391923, -0.015406777, 0.015486231, 0.017523132, + -0.036209177, 0.0011629119, -0.0064285193, 0.00910105, -0.04517299, + -0.0026653074, -0.03222205, 0.0006717442, -0.025143456, + -0.005489522, 0.0025641848, 0.0030770216, 0.0035320742, + -0.012098618, 0.018541582, 0.007244725, 0.010386754, 0.010495099, + -0.1167968, 0.019581703, -0.007056925, 0.023597723, 0.043193873, + -0.028581629, -0.009216619, -0.013998281, -0.014908387, + -0.020217333, 0.03558077, -0.039488442, 0.022283128, 0.050575834, + 0.011751911, -0.031521413, -0.0065585347, 0.034872912, -0.00685468, + 0.0025280693, 0.014893941, -0.015298432, -0.102076225, 0.008328184, + -0.0020152326, 0.012676462, 0.016757488, 0.02319323, 0.004247157, + 0.0012640347, 0.0010545661, 0.01158578, -0.0022391472, 0.061634332, + -0.00026003, -0.089724794, 0.0062046046, -0.015442892, + -0.0103000775, -0.015038402, 0.046913747, 0.019372234, + -0.0041965954, -0.12853427, 0.0047599934, 0.007909246, -0.03179589, + -0.020571262, -0.0013868266, -0.006349066, -0.042016514, + -0.019632265, 0.022023097, -0.012228633, 0.05901236, -0.025287917, + -0.0015601801, 0.010942929, -0.062046047, -0.021365799, + -0.001170135, 0.016519127, -0.045656934, 0.007295286, -0.0009028819, + 0.03857834, -0.0066596568, -0.004536079, -0.004955016, -0.020224554, + -0.016634697, -0.017609809, 0.0028025454, 0.006002359, -0.024377814, + -0.011029606, 0.019379457, -0.007403632, 0.03589136, -0.028307155, + 0.002231924, -0.017602587, 0.018230991, -0.0048900084, -0.025562393, + 0.0012857039, -0.0021669166, -0.04036966, -0.0126259, -0.031564754, + -0.012770362, -0.019733388, -0.010372308, -0.023344915, + -0.0019718942, -0.0020224554, -0.027953224, 0.005113923, + 0.058268387, 0.046054203, -0.0065946495, -0.019791171, -0.0103073, + -0.006341843, -0.0074903085, 0.020470139, -0.010206178, + -0.0061395974, -0.009036043, 0.039026167, 0.0077575613, + 0.0034526207, 0.0100978315, -0.021864189, 0.0487484, -0.007085818, + 0.020686831, 0.009346633, -0.022817632, -0.0030481294, 0.0046516475, + -0.0049911314, 0.006211828, 0.006768003, 0.0051211463, -0.055826996, + -0.031694766, 0.018324891, 0.050951436, -0.017689263, -0.13221803, + 0.0153128775, 0.021777513, 0.0024991771, -0.010755129, -0.01959615, + 0.0067896727, -0.006529642, 0.0033081593, 0.023446038, -0.021329682, + 0.012929269, -0.0098955855, -0.02793878, -0.007461416, + -0.0048900084, -0.02316434, -0.0043771714, 0.036324747, + -0.0049622394, 0.0009462203, -0.0017624255, -0.06352678, + -0.029015014, 0.022694841, 0.0683301, + ], + }, + { + title: "QR Codes", + query: "image containing a black and white QR code", + minScore: 0.2, + showVideo: false, + textEmbedding: [ + 0.015853409, -0.00093012175, -0.0027214673, 0.019863265, + 0.0101142125, -0.007943928, -0.012732333, 0.009018735, 0.025230411, + -0.011078783, -0.028310148, -0.055221666, 0.06398548, -0.017796328, + -0.008426214, 0.47144082, -0.039871216, -0.013400643, 0.035992265, + -0.029688105, -0.043867294, 0.028875113, -0.039981455, 0.031603467, + -0.024672339, -0.025271751, 0.017314043, -0.0022254023, 0.007020696, + 0.03579935, -0.027214672, -0.010982326, 0.016197896, -0.014565017, + -0.007034476, -0.03582002, 0.018443968, 0.029054245, -0.015557148, + -0.028992238, -0.059217747, -0.0077923527, -0.013297294, + 0.009218539, 0.009370115, 0.0027972548, -0.019890824, 0.01249119, + 0.019387871, -0.011002995, 0.0040374175, -0.029881021, 0.026498135, + 0.00985929, -0.01610144, -0.012883908, 0.08034873, -0.0068829004, + -0.021764847, -0.021716619, -0.004740176, -0.036322974, + -0.0058425423, -0.07806133, 0.07493336, 0.05982405, -0.011912447, + 0.033835758, -0.024203833, -0.010782522, 0.0034724541, 0.008109283, + -0.0010265788, 0.04795983, -0.008253969, -0.03578557, + -0.00039960784, 0.00953547, -0.0060216766, 0.035020802, -0.01247052, + -0.003582691, 0.03843125, 0.023742218, -0.009721494, 0.05814983, + 0.007020696, 0.008095504, 0.0031072954, 0.0007096484, 0.05289292, + 0.004567931, 0.024210723, -0.0012263827, 0.011065003, -0.012945916, + 0.24611709, -0.014220527, 0.0026112306, 0.041834805, 0.015357343, + -0.0015708721, 0.014875057, 0.07415482, 0.023390837, 0.023452846, + -0.06579749, 0.036260966, 0.007068925, 0.017072901, -0.014089622, + -0.02133768, 0.18148397, 0.020228425, 0.028255029, -0.02333572, + 0.017837668, -0.0213239, 0.007999047, -0.007117153, 0.009122083, + -0.025554232, 0.010506931, -0.004230331, 0.0016259905, -0.01247052, + 0.008054165, -0.029915469, -0.016129, -0.02722845, 0.035020802, + 0.012566977, 0.015212657, 0.01280812, 0.010562048, -0.04532104, + 0.00394096, 0.041262954, 0.017169356, -0.032285556, -0.015522697, + 0.011030554, 0.017582744, 0.008570899, -0.00592522, 0.003720487, + -0.022467606, 0.0020049291, 0.03905133, 0.034035567, -0.013834699, + 0.00054429343, 0.054091744, -0.011953786, -0.0096939355, + -0.015667383, -0.019491218, 0.025333758, -0.018003022, 0.022508945, + 0.016935105, 0.03550309, -0.0041821026, 0.021916423, 0.03122453, + 0.067340806, -0.014172299, -0.47525772, -0.012787451, -0.025450885, + 0.0055187223, 0.063461855, 0.0062903785, 0.008315977, -0.02627077, + -0.019532556, 0.0018464639, 0.020359332, 0.012305166, 0.09251611, + 0.015880967, 0.018561095, -0.010024644, 0.010713624, -0.024017809, + -0.0059321094, -0.037976522, 0.026436124, -0.023707768, 0.012711663, + -0.009501021, 0.019126058, -0.019794367, 0.007937038, -0.018223496, + -0.046127148, -0.02594006, -0.075181395, 0.0066555375, 0.038582824, + 0.033153668, -0.00790259, -0.042551342, 0.006986248, -0.017651644, + 0.023129027, 0.015949864, 0.006676207, -0.03054244, 0.015701832, + -0.015908526, -0.0379903, 0.04526592, -0.03584069, 0.014861278, + -0.03122453, 0.055035647, -0.0049744286, -0.053016935, -0.007585659, + -0.020269763, -0.037673377, -0.013118161, 0.031658586, -0.032671385, + 0.039499167, -0.026877074, -3.444895e-5, 0.0027145774, -0.022033548, + -0.012732333, -0.03127965, 0.0053326976, -0.015667383, -0.037349552, + -0.036205847, -0.0006683096, 0.021744179, 0.009749053, 0.010768742, + 0.006049236, -0.019291412, 0.011857329, -0.0180857, 0.10372579, + -0.017858338, 0.021640832, -0.04204839, -0.048180304, -0.0007372076, + -5.5118322e-5, -0.0051328936, -0.029274719, 0.010754962, + 0.057075027, 0.010989215, -0.02365265, 0.018692, 0.038610384, + -0.031438112, 0.01745873, -0.009721494, 0.0022529615, -0.011402603, + -0.025437107, 0.014516789, -0.0117953215, 0.0030108383, + 0.0052362406, -0.050825983, -0.0103277955, 0.0013297294, + 0.022901662, 0.017679201, 0.028530622, 0.017768769, -0.025044387, + 0.018871136, 0.023852453, -0.027455814, -0.007937038, -0.048421446, + -0.0052362406, 0.020889845, 0.016066993, -0.004071866, 0.0017775659, + 0.024121156, 0.014716592, 0.0048504123, -0.014689034, 0.013931155, + -0.022453828, 0.02431407, -0.025416438, -0.0015639823, 0.015343564, + 0.07087527, -0.043185204, 0.0003651589, 0.008267748, 0.032058194, + -0.00024114265, 0.020545354, 0.017947905, -0.0086535765, 0.01478549, + 0.03147945, -0.008171291, 0.0098041715, -0.008839601, -0.005560061, + -0.00086811354, -0.025120176, 0.020869175, -0.09649841, -0.06394414, + 0.022784537, -0.059093732, 0.0018533536, -0.032602485, -0.033319023, + -0.046147816, -0.051129136, 0.03454541, 0.008088614, -0.017982353, + 0.051762994, -0.014268757, -0.0011161461, 0.027131995, -0.022095557, + -0.029192042, -0.007082704, -0.016225455, 0.009735274, 0.032058194, + 0.023893794, 0.01021067, 0.037921406, 0.002659459, 0.022577843, + 0.028702868, -0.030094605, -0.019429209, -0.00035826908, + 0.009025626, -0.010472481, -0.13410288, 0.03019795, -0.008908499, + 0.034979466, 0.024410527, 0.022570953, 0.0057529747, 0.014957734, + -0.09229563, -0.041676342, -0.0055807303, -0.020758938, + -0.047456875, 0.005001988, 0.014854388, -0.0030935158, 0.03641254, + 0.03418025, 0.00918409, -0.0005374036, 0.0016811087, -0.003382887, + 0.009473462, 0.027007978, 0.028310148, -0.018829796, -0.06887034, + 0.046292502, -0.021606382, -0.025499115, -0.14208815, -0.018926254, + -0.0044370247, 0.0048779715, -0.0059321094, -0.0071516023, + 0.014957734, -0.013125051, 0.009039405, 0.025237301, 0.01836818, + 0.04567931, -0.0051742326, -0.03025996, 0.026401676, 0.015488249, + -0.019229405, -0.032995205, 0.006793333, 0.13470918, 0.019567003, + -0.01904338, -0.0060010073, 0.011292366, -0.010830751, 0.025740257, + 0.0016811087, 0.0153711215, -0.043936193, 0.080059364, 0.017941015, + -0.048021838, 0.062290594, 0.034648754, 0.008164401, 0.008288417, + -0.008508892, 0.029371176, -0.002328749, 0.020111298, 0.002459655, + -0.01804436, 0.0047884043, -0.051749215, 0.035344627, 0.041145828, + -0.001839574, -0.0282757, 0.011175239, -0.029757006, -0.020131966, + 0.02559557, -0.023728438, -0.010424253, 0.01380025, 0.017369162, + 0.025561122, 0.02195776, 0.01411029, -0.037707824, 0.016135888, + 0.024555212, 0.028075894, -0.0007992157, 0.016253015, 0.039003104, + 0.029701887, -0.02822747, 0.014055173, 0.008350426, 0.0015157539, + -0.016053211, 0.023101468, 0.031100513, -0.0139931645, 0.0089636175, + -0.0102244485, 0.00016535497, -0.025113286, 0.025416438, + 0.022943001, 0.028255029, -0.003968519, -0.016066993, 0.040263932, + 0.049496252, -0.01442722, 0.06689986, 0.025712699, -0.006448844, + -0.02135146, 0.019525666, -0.021110317, -0.042930283, -0.016204787, + -0.0072549493, 0.014599466, 0.025223523, 0.0012401623, + -0.00016535497, -0.013497099, 0.038775742, -0.017672313, + -0.04007102, 0.0064695133, -0.014399661, 0.02266052, -0.046650767, + -0.14170921, 0.04127673, -0.028503062, 0.0011574848, -0.0051328936, + 0.05357501, -0.005126004, -0.015067972, 0.032285556, -0.00075787696, + 0.03803164, 0.02565069, 0.0095148, 0.020173306, -0.008825822, + -0.03055622, 0.0050571063, 0.001743117, -0.008681135, 0.0226054, + 0.043839738, 0.006648647, -0.014716592, 0.0054222653, 0.00787503, + 0.029991256, + ], + }, + { + title: "Receipts", + query: "receipts, bills and invoices", + minScore: 0.2, + showVideo: true, + textEmbedding: [ + -0.012871421, 0.017175015, 0.03869955, 0.015771098, -0.05597953, + 0.014459028, -0.014563994, 0.036213174, -0.006153615, -0.007446006, + -0.03248689, -0.002643824, 0.0044151205, 0.0035229118, -0.027901199, + 0.5036518, -0.015305313, 0.03251969, -0.01211698, 0.0145049505, + -0.01817219, 0.051118307, -0.021583576, 0.015462763, 0.02681874, + 0.02679906, -0.045587923, 0.0022502027, 0.014570554, -0.014728002, + -0.013041991, -0.0065800385, 0.010509692, 0.0016860118, 0.046558857, + -0.00495307, 0.0046381727, 0.041638587, -0.016118798, 0.0161844, + -0.0025913413, 0.009007371, -0.01946458, -0.009079535, 0.0058321576, + 0.045601044, 0.013967001, -0.036475588, -0.008049558, 0.031883337, + -0.032250717, 0.018605174, -0.020625765, -0.031089535, 0.009565001, + -0.015941668, -0.023276148, 0.00030177642, -0.01926777, + 0.0124843605, 0.0060355286, 0.0040871026, 0.01542996, -0.029993955, + -0.11969373, 0.013429052, 0.004270793, -0.00055107, 0.013245362, + 0.00033457825, -0.0078658685, 0.008961448, -0.016604265, + -0.0012727093, -0.032631215, -0.042675126, -0.03104361, + -0.034113858, 0.020114055, -0.011854566, 0.07291837, -0.015764538, + 0.04847448, -0.0028603158, -0.016210644, -0.023413915, 0.014826409, + 0.03197518, 0.024798151, 0.0003280179, 0.04501061, 0.0044872845, + 0.024155235, 0.025408264, -0.010680262, -0.0029652815, 0.08523872, + 0.031686526, 0.031594682, -0.014649278, 0.031161698, -0.0121957045, + -0.0040477403, -0.03986729, -0.009374751, 0.017647361, -0.046735983, + 0.021360524, -0.013855475, -0.024988402, -0.026700657, -0.027573183, + 0.2742295, -0.00052482856, 0.022016559, -0.008567827, 0.031876776, + 0.002256763, 0.00934851, -0.01761456, -0.021524534, -0.039985377, + -0.017194696, -0.04042492, 0.03219823, 0.019517064, -0.046230838, + 0.024922797, -0.034061372, -0.027671589, -0.0075312904, + -0.0008594068, -0.015193787, 0.018998794, 0.004579129, 0.025368901, + -0.010188235, 0.031620923, -0.023105578, -0.018998794, 0.030125162, + -0.01835588, 0.0077281008, 0.010785228, 0.031470034, -0.016250005, + -0.0031292904, 0.013284723, 0.040031303, 0.019963168, -0.0216295, + 0.0061929775, -0.065537974, 0.020835694, -0.024443893, 0.0059568044, + -0.028334184, -0.043055624, -0.019930365, -0.0017319344, + -0.0075050485, 0.021852551, -0.017876973, 0.014596796, 0.021058748, + -0.09324892, 0.025926534, -0.50703037, 0.052213885, -0.016919162, + 0.013914518, 0.05725224, 0.021878792, -0.016768275, -0.014340941, + -0.0055500623, -0.015305313, -0.0289771, -0.016381213, -0.006678444, + -0.016873239, 0.010214476, 0.017706405, -0.016105678, -0.0027487897, + 0.019051278, 0.05134136, 0.013461853, -0.00051826827, -0.008948327, + -0.012057937, -0.018211551, -0.040497087, 0.026457923, + 0.00082660496, 0.0056812693, 0.000990614, -0.011815203, 0.038135357, + 0.020501116, -0.05576304, -0.03269026, -0.034015454, -0.024732547, + 0.021773826, 0.0017122533, 0.02718612, 0.017115973, -0.031542197, + 0.00606177, 0.0040411805, 0.03806319, -0.05327666, 0.031424113, + 0.0047628195, 0.01229411, -0.014373742, -0.004480724, 0.008416939, + 0.011959531, -0.048185825, 0.08870259, 0.013422491, -0.005963365, + -0.0063110637, 0.060663626, -0.04789061, -0.00017712965, + -0.007557532, -0.012543404, -0.020455195, 0.033877686, -0.042091254, + -0.019661391, 0.006363547, -0.03137163, -0.0044151205, 0.053355385, + 0.051282313, -0.011113245, -0.014406545, -0.025985574, 0.06363547, + -0.0034835497, 0.004454483, -0.026825303, -0.022239612, + 0.0050383545, -0.05691766, -0.003103049, -0.0040805424, + -0.030623749, -0.04771348, -0.0477594, 0.009604364, 0.00990614, + 0.009223863, 0.05252878, 0.016105678, 0.026549768, 0.021950955, + -0.020422393, -0.008147963, -0.01633529, 0.0117036775, 0.024496375, + -0.05052131, -0.06555765, -0.008830241, -0.023276148, -0.0106671415, + -0.0070392634, 0.03454684, -0.02954785, -0.030282611, 0.0022502027, + 0.0023551683, 0.001725374, -0.0024338926, -0.0019484262, + -0.024122434, -0.013101033, -0.04315403, -0.030545022, 0.033497185, + 0.029692179, -0.0019418658, 0.0065603578, 0.00862687, -0.014668958, + -0.01817875, 0.009118897, -0.046558857, -0.005812477, -0.018559251, + -0.03874547, 0.014045725, -0.056819256, 0.018250914, 0.011119806, + 0.06538052, 0.026333276, 0.030571265, -0.009256665, 0.022606991, + 0.012969826, 0.011342858, -0.016243445, 0.00028865572, -0.045089334, + 0.030945206, 0.021544214, -0.017234059, -0.023171183, -0.027251724, + -0.06330745, -0.039952576, 0.02607742, -0.06366171, -0.026897466, + 0.0010627779, -0.048487604, -0.049491335, -0.029626574, + -0.054824907, 0.0038640504, 0.040831663, -0.0034769892, -0.02408307, + -0.032421287, 0.031666845, 0.009755251, -0.05476586, 0.016682988, + -0.005969925, 0.013002628, 0.0056091053, -0.028196417, -0.026320154, + 0.015462763, -0.06549205, -0.01064746, -0.040333077, 0.0202059, + -0.041264646, -0.008922086, 0.018441165, -0.011683996, -0.012740213, + 0.008908966, -0.009984864, 0.0030243248, -0.035767067, 0.027993044, + 0.00642259, 0.0023158062, -0.033818644, 0.037125062, -0.011611832, + 0.013980121, -0.016190961, 0.00532045, -0.008226688, -0.029869309, + 0.033156045, 0.0003411386, 0.0054647774, -0.03877827, 0.0073935227, + 0.0488681, -0.04382319, 0.011815203, -0.007983955, -0.0040871026, + -0.047090247, 0.068214595, -0.04290474, -0.0006625961, -0.028524432, + 0.015994152, 0.00787899, -0.017161895, -0.0048874663, 0.027205803, + 0.013324087, -0.00972245, -0.028334184, -0.006809651, 0.018296836, + 0.012825498, -0.020291185, -0.06573478, -0.031522516, 0.045909382, + -0.04077262, -0.015731737, -0.008403818, 0.061024442, 0.021386765, + -0.04957662, -0.043094985, -0.0006494754, 0.0028012726, 0.051728416, + 0.0064094695, 0.015443081, 0.025467308, -0.0057403124, -0.007091746, + -0.018808546, 0.017129093, -0.037886064, -0.010929555, -0.020579841, + -0.034973267, -0.01928745, 0.0031292904, -0.02075041, -0.0057140714, + -0.035865474, -0.0935179, -0.0006888375, 0.024686623, -0.023991227, + 0.051485684, 0.00825293, -0.006088012, 0.018447725, 0.0111854095, + 0.004677535, -0.015206908, -0.050042406, 0.025834689, -0.027481338, + -0.0031686525, 0.028471952, -0.012615567, -0.007446006, 0.013232241, + -0.009079535, -0.0003542593, 0.016112236, 0.0076165753, + -0.0070851855, 0.007931472, -0.027061474, -0.010745865, -0.04331148, + -0.010345683, 0.053033933, -0.00072819967, 0.023413915, + -0.020868497, 0.04771348, -0.023702571, -0.022534829, -0.04109408, + -0.020848814, 0.0028603158, -0.027999604, -0.050750926, + -0.005313889, 0.017647361, 0.0139538795, 0.018237794, 0.042124055, + 0.019562986, 0.032381922, 0.001928745, -0.016663307, 0.023735372, + 0.040155947, -0.04385599, -0.030577825, -0.01928745, 0.029462563, + -0.020507677, 0.017686725, 0.011598712, 0.024115874, -0.026825303, + -0.015521805, -0.025946213, -0.0032342563, 0.015475882, 0.037505563, + -0.009965182, 0.0316078, 0.0035294723, -0.035124153, -0.021891912, + -0.038469933, -0.04850072, -0.049661905, -0.040818542, -0.02206248, + 0.021084988, 0.030223567, -0.028242338, -0.049242042, 0.018605174, + -0.038141917, -0.0006691565, 0.07440758, -0.0012071057, + -0.0008594068, 0.0381616, -0.0003542593, 0.0026372636, -0.042458635, + 0.045384552, 0.0015351236, + ], + }, + { + title: "Notes", + query: "screenshots of digital notes, photos of notebook and whiteboards", + minScore: 0.2, + showVideo: true, + textEmbedding: [ + 0.03148959, -0.012310127, -0.008262599, -0.040193092, 0.008668235, + 0.006904606, -0.014038484, 0.012133764, -0.027979966, -0.048931874, + -0.010167318, -0.01888846, -0.0037388923, 0.0039328914, + -0.040907364, 0.5144681, 0.017318832, 0.024770161, -0.01295385, + 0.03631311, -0.005193886, 0.004259163, 0.0110932235, 0.014303027, + 0.01637529, 0.04230063, -0.04334117, 0.03342076, 0.020925451, + -0.0005026341, -0.002733624, -0.03218622, 0.0015960837, + 0.0084389625, 0.021622084, -0.0022662627, -0.0011463584, + -0.008262599, -0.04159518, -0.016692745, -0.0064107897, + 0.0019047188, 0.023059443, 0.03879101, -0.014497027, -0.023570895, + -0.023950074, -0.004276799, -0.012468853, -0.0035184387, + -0.022521535, 0.009955683, -0.0011992673, -0.008139146, 0.016622199, + 0.00522034, 0.00021163542, -0.0035272571, 0.025502069, + -0.0014990842, -0.008103873, -0.038773373, -0.0061903363, + 0.00384471, -0.072079495, 0.038641103, 0.012133764, -0.01362403, + -7.054514e-5, -0.048490964, -0.0067899697, -0.0031128044, + -0.0281916, 0.00028218055, -0.010176136, -0.031507224, -0.048755508, + -0.0140473, -0.02521107, -0.017265923, 0.031480767, 0.002036991, + -0.012645217, 0.038076736, -0.008659416, 0.06813779, -0.013500575, + 0.013826846, -0.04963732, -0.03164831, 0.023553258, 0.00029981683, + -0.049143508, 0.00820969, -0.029875867, 0.013756301, 0.1874296, + 0.016683925, -0.013333031, 0.00892396, -0.005088068, -0.017724466, + -0.026366245, 0.008694689, -0.016366472, -0.0023368078, -0.05606575, + 0.0061727, -0.012310127, -0.01442648, -0.02644561, -0.011084405, + 0.24448301, -0.019726183, -0.012856851, -0.0027600785, -0.017486377, + 0.036242567, 0.0301845, -0.047600333, 0.024055893, 0.032979853, + 0.02568725, -0.028764782, 0.027803604, -0.011878038, 0.0064107897, + -0.0057317927, -0.030660681, -0.052591402, 0.019391095, + -0.018200645, -0.03531666, 0.010176136, -0.053773034, -0.014735116, + -0.014117845, 1.7636285e-5, 0.022486264, 0.013456484, -0.014673389, + -0.011825128, -0.034152664, 0.012072037, -0.011375403, + -0.0012345399, 0.015669838, -0.0007142695, 0.0281916, 0.010043864, + 0.013641666, 0.012504126, -0.010193773, -0.023412168, 0.023473896, + 0.014303027, -0.0066488795, -0.028076967, 0.0065077893, 0.027591966, + 0.07500712, -0.014400026, -0.0022750807, -0.019302914, 0.015008478, + -0.012327763, -0.0049381596, -0.5187449, -0.007724693, -0.05559839, + 0.013571121, 0.061083272, -0.049161144, 0.001798901, -0.002354444, + -0.0065077893, 0.0091708675, -0.028500237, -0.03745947, + -0.025934156, -0.004814706, 0.008835779, -0.012380673, 0.007468967, + 0.01637529, -0.0018429917, 0.0284826, -0.002407353, 0.014408845, + 0.00768942, -0.017257104, -0.00033508943, 0.0071779676, + -0.027256878, -0.0019399914, -0.040810365, -0.015352386, + -0.05730029, 0.00308635, 0.043949623, -0.030131591, -0.010528862, + -0.0077335113, 0.025202252, 0.04715061, -0.058305558, 0.038896825, + -0.015026114, 0.016675107, -0.015590476, -0.0016666289, + 0.0130508505, -0.046771426, -0.03849119, -0.0051850677, 0.073922485, + -0.016754469, 0.0037565285, -0.015934383, -0.065183714, 0.04718588, + -0.0029011688, 0.0042856173, 0.013377122, -0.006825242, 0.055474933, + 0.021401633, -0.02235399, -0.016410563, -0.0142765725, 0.004267981, + -0.0039064367, -0.055748295, 0.012363035, 0.01167522, -0.021860175, + 0.0043032533, 0.024514437, -0.0027071696, -0.017398193, + 0.0043120715, -0.009047414, 0.0065430617, -0.039293643, + -0.011472403, 0.030978136, -0.031401407, -0.04954914, 0.027759513, + -0.0468067, 0.014893843, -0.0483146, -0.024435071, 0.02340335, + -0.00043208894, 0.00882696, -0.01979673, 0.025325704, -0.044461075, + 0.006886969, -0.008818143, 0.0049117054, -0.024099983, -0.005167431, + -0.0066576973, -0.011075586, 0.018130101, 0.0008377235, 0.01533475, + 0.0070897867, -0.063702255, -0.03418794, -0.009267868, -0.021613266, + -0.00061726995, -0.00322744, -0.025369795, -0.02207181, 0.013236032, + 0.017098378, 0.027574332, 0.0009964501, 0.022036538, -0.030484319, + -0.016886743, -0.018200645, -0.0067546973, 0.030299138, + 0.0009611775, -0.009770501, 0.014567572, 0.023526805, -0.053676035, + 0.04506071, 0.0074777845, 0.030501954, -0.009682321, -0.02372962, + -0.012424762, 0.035766385, -0.013553485, -0.005925792, 0.008359599, + 0.018835552, 0.0036859834, 0.016728016, -0.001172813, 0.027406786, + 0.029214505, -0.016287109, 0.0064107897, -0.0056612473, -0.0385441, + 0.024029437, -0.040713366, -0.031886403, -0.045254707, 0.005714156, + -0.0349463, 0.0052291583, 0.0066665155, 0.016736835, 0.004356162, + -0.002345626, 0.03151604, 0.019338185, 0.015775656, -0.09950392, + -0.007001605, -0.011833947, 0.042803265, 0.008562416, -0.039425917, + -0.08338436, -0.037062652, -0.033068035, 0.018121284, 0.015176023, + 0.02525516, 0.0064107897, -0.013818029, -0.009073868, -0.026163427, + -0.0151054775, -0.035202023, 0.023764893, 0.020475727, -0.027988784, + 0.00892396, -0.016551653, 0.028597236, 0.04570443, 0.0148056615, + 0.07217649, 0.013923847, -0.019867275, -0.14952925, 0.058367286, + 0.012424762, 0.06264409, 0.010811042, 0.0054760664, 0.026983516, + -0.016181292, 0.005767065, -0.04343817, -0.031551313, -0.021692632, + 0.013950301, 0.008703507, 0.015493477, -0.012971488, -0.01855337, + 0.0066224253, -0.027882965, 0.05995455, -0.0007936328, 0.05747665, + -0.03848237, -0.039796278, -0.03830601, 0.03682456, -0.025193432, + -0.00768942, -0.022159992, 0.018738551, 0.0032538946, -0.005828792, + 0.031683587, 0.08285526, -0.043085445, -0.048199967, 0.003597802, + 0.024981797, 0.017618649, 0.0036859834, 0.017239468, 0.035898656, + -0.022459809, -0.05572184, 0.014814478, -0.0070456956, -0.007830511, + -0.023182897, 0.029752413, -0.008253781, -0.0042062537, -0.0182271, + 0.018068373, -0.016287109, 0.0030069866, -0.0033244397, + -0.033050396, 0.037247833, -0.028447328, -0.015687475, + -0.0066665155, 0.00223099, -0.019920183, 0.001543175, 0.04078391, + 0.012380673, 0.016595745, -0.01828001, 0.03284758, -0.007839329, + 0.007407239, -0.02316526, -0.0013491758, -0.015087841, 0.023844257, + -0.049143508, -0.021771993, -0.013994392, 0.0029893504, + -0.021868993, -0.033782303, 0.0069663324, 0.019338185, 0.037380103, + 0.003641893, 0.013086123, -0.018271191, 0.018712098, -0.03128677, + 0.021348724, -0.0063226083, -0.01865919, -0.0118868565, + -0.022371627, -0.00044972525, 0.03457594, -0.04105727, 0.010149682, + 0.015255386, 0.008236145, -0.021181177, -0.011128495, 0.0011375403, + -0.024576163, 0.00731024, -0.04319126, -0.008527143, -0.028835325, + -0.00028218055, 0.031110404, 0.03949646, 0.044452257, -0.013712212, + -0.041797996, 0.02093427, 0.028403237, -0.015255386, 0.00731024, + -0.047547426, -0.0005643611, 0.016163655, -0.0033244397, + 0.012027946, -0.011710493, -0.0025131707, -0.004144527, 0.010714043, + 0.003976982, -0.010528862, -0.03949646, -0.08931015, 0.026401518, + -0.009647048, 0.035969205, 0.0021692629, 0.014770388, -0.0054319757, + 0.0042062537, -0.00721324, 0.01518484, -0.010846316, -0.0065430617, + 0.015087841, 0.0039858003, -0.0071603316, -0.019205915, + -0.008244963, 0.038985007, -0.026983516, -0.011428312, 0.006128609, + 0.013271305, -0.030546045, -0.020193547, 0.008941596, 0.05889637, + ], + }, + { + title: "Memes", + query: "memes", + minScore: 0.18, + showVideo: true, + textEmbedding: [ + 0.024733832, 0.02873802, -0.004280583, -0.048865262, 0.0050743334, + 0.007377628, 0.007221712, 0.0043231053, 0.05938246, -0.04826995, + 0.034428928, 0.002204075, 0.0025371667, 0.003791576, 0.0009284046, + 0.52122474, -0.025187403, -0.031905934, -0.0012969316, + -0.0030332608, 0.057624865, 0.010906982, -0.0064137876, 0.006725618, + -0.009695095, -0.015981317, -0.011906258, 0.01809326, -0.011303858, + -0.011211725, 0.017916081, -0.007306757, -0.014471772, 0.016895546, + -0.007604413, -0.04029701, 0.00023387291, -0.0073634526, + -0.025541758, 0.001346541, 0.010573891, -0.0027143431, 0.026902473, + 0.032359507, 0.026491422, -0.029255377, -0.014464686, 0.027859226, + 0.04314601, 0.004401063, 0.0140182, -0.0009921881, 0.03883708, + 0.05593815, 0.028865587, 0.02632842, -0.06859563, 0.026725296, + 0.012905533, -0.010609326, 0.008135943, 0.0043231053, -0.023004591, + 0.032324072, -0.061728273, 0.034372233, -0.00027639527, 0.009284046, + 0.033408392, 0.016023839, 0.011133768, -0.009113957, 0.0074343234, + -0.004642023, 0.023203027, -0.022359667, 0.015988404, 0.009503745, + -0.048666827, -0.0018851574, 0.016796328, -0.06535684, 0.01110542, + 0.021360392, -0.046115484, 0.0014953692, 0.031388577, 0.023465248, + 0.0019843762, -0.04834082, 0.009305307, -0.038496897, 0.018674398, + 0.014195377, -0.011870822, -0.010580977, 0.13177675, -0.039184343, + 0.04032536, -0.06712861, -0.0038766204, -0.030892486, -0.0062720464, + 0.027200127, 0.013266971, 0.033642262, -0.047660466, -0.01650576, + 0.01250157, 0.0125582665, 0.00073705404, -0.044598855, 0.14651075, + -0.01353628, 0.009964403, 0.053946685, -0.0039687525, -0.017916081, + -0.01284175, -0.020651687, 0.017278247, -0.03042474, -0.018532656, + -0.012480309, 0.0067823143, 0.018086173, 0.05493887, -0.015017476, + 0.009220262, 0.0036214867, -0.010432149, 0.0007654023, 0.024875574, + -0.013699283, -0.019468147, 0.012374003, 0.008887171, 0.014648949, + -0.042047516, -0.026753645, -0.0068177497, -0.0016371105, + 0.008306031, -0.01579705, -0.019446887, 0.0078028506, -0.0058397357, + -0.014415076, 0.013387453, -0.03543529, 0.0050955946, 0.032508336, + -0.044322457, -0.027214302, -0.03252251, 0.015549005, -0.010751067, + -0.0049892887, -0.0067327046, 0.025803978, 0.059467502, 0.023543207, + 0.009624224, 0.028220663, -0.016895546, 0.02160844, -0.031806715, + -0.5259943, -0.0060665216, -0.0310484, -0.020935168, 0.06222437, + -0.02355738, 0.039900135, 0.0019347668, -0.014450511, 0.0020410726, + -0.0069594905, -0.018801965, 0.000106305866, 0.011048723, + 0.0074910205, 0.020949343, 0.021700572, 0.063492954, -0.03522268, + 0.014974954, -0.025889022, 0.0240393, -0.000616574, 0.03145945, + -0.041756947, -0.02143835, -0.03777402, -0.009525006, 0.029347507, + 0.006520093, -0.008206814, 0.014656036, 0.012600789, 0.019787066, + -0.0164278, -0.022869937, 0.015145043, -0.055392448, -0.0055987756, + -0.019021664, 0.011310944, -0.013266971, -0.0017150679, + 0.0066618347, 0.0062791333, -0.023160506, 0.009078521, + -0.0023316422, -0.023940083, -0.09124587, -0.0089367805, + -0.0024946444, 0.010347105, 0.06452766, -0.07113989, 0.020113071, + -0.0065838764, 0.008001288, -0.0124661345, -0.04612966, + 0.0021828138, 0.04277748, -0.025577193, 0.007937505, -0.014634774, + -0.013047273, -0.048631392, -0.010481758, -0.014025288, + -0.020155592, 0.0029127807, 0.0016512844, -0.0065130065, + -0.022246275, -0.016052186, -0.028000964, 0.0070091, -0.02741274, + 0.015641136, 0.017164854, -0.0039829263, -0.055392448, -0.008695819, + -0.012898446, -0.050835468, -0.01534348, 0.10378288, -0.023188854, + 0.01031167, 0.020587903, -0.015003301, 0.008674559, -0.014776516, + -0.006236611, -0.028915197, -0.015371829, -0.014174115, 0.0448469, + 0.04323814, 0.0011339292, -0.042359345, 0.017816864, 0.021282436, + 0.016094709, 0.021672223, 0.021211565, -0.014450511, 0.018752355, + 0.027426915, 0.020807602, 0.0008929693, 0.018568091, -0.0074201496, + 0.02531497, 0.014797776, -0.0051948135, -0.004415237, -0.0017930256, + -0.039318997, 0.013642587, 0.014266248, 0.0065271803, 0.024613352, + 0.010942417, 0.019978417, -0.04790851, -0.01700185, 0.032458726, + 0.014174115, 0.027589917, 0.027575742, 0.012990577, 0.008894257, + -0.015471048, -0.009872272, 0.011084158, 0.030488525, -0.0033734394, + -0.02495353, 0.010396714, 0.024124345, 0.042097125, -0.03175002, + -0.026292983, -0.008178465, -0.010134493, -0.039106388, 0.04943223, + 0.019609889, -0.06208971, 0.03557703, -0.08570379, -0.0124661345, + 0.05873045, -0.033592656, -0.01963115, 0.039928485, -0.002941129, + -0.0027568655, -0.043004267, 0.038433116, 0.044811465, -0.008894257, + -0.027667874, -0.01206926, 0.0035789642, 0.01387646, -0.048191994, + -0.010906982, -0.0030332608, 0.04902118, -0.022083273, -0.010389627, + 0.0079658525, -0.034393493, -0.018057823, 0.03714327, -0.02440074, + 0.024939355, -0.017930256, 0.01201965, -0.024514133, 0.0072996696, + 0.0053436416, 0.0141315935, 0.003068696, -0.036703873, -0.03748345, + -0.03376274, -0.04908496, -0.009404526, 0.0015449787, 0.054350648, + -0.010155753, -0.0018709833, 0.0033805268, -0.020821776, + 0.0054712086, -0.0085328175, 0.013578803, 0.040176533, 0.007710719, + 0.010772328, 0.020389466, -0.026144156, -0.014025288, 0.035612464, + -0.02476218, -0.047596682, 0.0051877266, -0.035725858, -0.090976566, + -0.029021503, -0.012785052, -0.0106235, 0.002955303, 0.0332383, + -0.023940083, 0.0064988323, -0.0044790204, 0.024003865, 0.038893774, + 0.0543223, 0.011403076, -0.022097446, 0.007398888, 0.020807602, + -0.06272755, -0.0075902385, -0.021948619, 0.056760244, 0.010729806, + -0.19647451, 0.03880164, 0.00046774582, -0.003791576, 0.017646775, + 0.03071531, 0.022295883, -0.01589627, -0.0041388418, 0.016193926, + 0.030332608, 0.022657324, -0.04556978, 0.0057972134, -0.00049609406, + 0.0049255053, -0.015818313, -0.02384795, 0.027526133, 0.011615688, + -0.02782379, 0.06167158, 0.04608714, 0.013968592, -0.011133768, + -0.050204717, 0.004053797, -0.019517757, 0.006123218, -0.005308206, + 0.03252251, -0.047724247, 0.01818539, 0.0067823143, -0.016633324, + 9.9218814e-5, -0.0116794715, -0.043911412, -0.027561568, + -0.024173955, 0.028362405, -0.008802126, -0.0065271803, 0.00725006, + -0.043394055, 0.022175403, -0.02570476, 0.010446324, -0.014330031, + 0.0042238864, -0.02873802, -0.07274156, -0.04075058, 0.030963358, + -0.013621326, 0.008015462, -0.034216315, -0.021289522, -0.033330433, + -0.008702907, -0.024351131, 0.0047058063, -0.011360554, 0.008880083, + -0.019914633, 0.028121445, 0.008901345, -0.038128372, -0.027115082, + 0.004259322, -0.03988596, 0.03615108, 0.0054641217, -0.025931545, + 0.018369654, 0.020991866, 0.019213013, -0.0070445356, 0.008950954, + -0.006590964, 0.024939355, 0.0034443103, -0.019964242, -0.009602964, + 0.030438915, 0.0110203745, 0.029999517, -0.07240139, 0.0074484977, + -0.0033380042, 0.014266248, 0.023982603, -0.033139084, 0.014244986, + 0.00029765643, -0.013798501, 0.02211162, -0.013422888, 0.025874848, + -0.009595877, 0.041650638, 0.08546283, -0.0069736647, 0.006569702, + -0.013337842, 0.006243698, -0.014755256, 0.012005476, 0.03403205, + -0.024173955, 0.024492873, -0.011183377, 0.024960618, + ], + }, + { + title: "Visiting Cards", + query: "business card", + minScore: 0.2, + showVideo: false, + textEmbedding: [ + 0.0029489065, -0.009914337, 0.008136701, 0.013697645, 0.027322732, + -0.019538447, -0.019248221, 0.020445405, -0.0040579853, 0.020186275, + 0.02225932, 0.016019454, 0.013091278, 0.008665328, -0.021046588, + 0.50537205, -0.03424152, -0.05618988, -0.007680631, 0.007110544, + 0.017449856, 0.014583871, -0.029193653, 0.0013008356, 0.029888125, + -0.011790443, -0.011386199, 0.010857572, 0.0028400715, 0.039740272, + 0.033521138, 0.009370162, -0.022176398, -0.037345905, -0.0037211154, + 0.033816542, -0.007317848, -0.005400282, 0.004275655, 0.019217126, + -0.046778258, -0.0075717964, 0.0063901604, -0.0028037932, + -0.00079812226, -0.012811417, -0.02258064, 0.0021404189, + 0.047353525, 0.014521679, -0.04745718, -0.016491072, -0.03712305, + 0.030546315, -0.07583198, -0.0063331523, 0.048996415, -0.010888668, + -0.0035760025, -0.016869402, -0.012583383, -0.0021248711, + 0.03339675, -0.03584813, -0.07071674, 0.037713867, -0.0074525964, + -0.032723013, 0.0317435, 0.016993785, -0.025710938, -0.04251297, + -0.044834778, 0.013568078, -0.009007379, 0.01095086, -0.052111164, + 0.011831904, 0.0012230964, 0.002337358, 0.03213738, 0.014526862, + 0.028245235, 0.024783252, 0.008421745, -0.012438269, 0.0185693, + -0.0464673, 0.027270906, -0.012407173, -0.021792883, 0.0036692894, + -0.017708985, 0.011847451, 0.006089569, -0.0054987515, 0.19703254, + -0.015724046, 0.012915069, 0.008732702, 0.008768979, -0.019232674, + -0.020512778, -0.012707765, -0.0034671675, -0.022891598, + -0.057112385, -0.022456259, -0.013692461, 0.021202065, 0.01960064, + -0.04331627, 0.24108475, 0.030681064, -0.037097137, 0.062424563, + 0.024897268, -0.038081832, 0.004410403, 0.039486323, -0.008805258, + 0.015822515, 0.026752643, -0.018579664, -0.0065404563, 0.015656672, + -0.03855345, -0.034184508, 0.06779375, -0.010121642, -0.0024513756, + -0.0041357246, -0.0024358276, -0.001803549, -0.013998236, + -0.016019454, 0.010588077, 0.023725998, -0.05693618, -0.02987776, + -0.0074525964, 0.022513267, -0.013490339, -0.020087805, 0.00878971, + 0.035640825, -2.073045e-5, 0.01727883, 0.0146823395, -0.022269685, + 0.016796846, 0.0018709231, -0.014905193, 0.00049753074, + -0.029851845, 0.007359309, -0.03926347, 0.015718862, 0.002710506, + 0.016807212, 0.0074992394, 0.0026534975, 0.00048198292, + -0.0057941605, 0.0066337436, 0.0014200357, -0.005970369, + -0.50913984, 0.004182368, -0.022435527, -0.015553019, 0.0639638, + 0.042305663, 0.04190142, -0.007561431, -0.0012179138, -0.019792397, + 0.0012386444, 0.0001762088, 0.0035863677, 0.043466568, 0.016143836, + 0.003529359, 0.004425951, -0.0038973242, 0.011417294, -0.0047835507, + 0.027213896, 0.04382935, 0.019372603, -0.011868183, -0.009453085, + 0.012764773, -0.031831603, -0.0061154827, -0.03019908, -0.021637406, + 0.019408882, 0.0019590273, -0.021870622, 0.031753864, -0.054510716, + -0.0465865, -0.00498049, -0.044928063, 0.030240541, 0.031095672, + 0.015148776, 0.026286209, -0.00472136, -0.008877815, 0.01420554, + -0.076547176, -0.0077946484, 0.034101587, -0.04702184, 0.043451022, + 0.028162314, -0.028462905, 0.0050685946, 0.0014511314, 0.018626308, + -0.006975796, -0.032650456, -0.010251207, 0.009732946, 0.021855075, + 0.005586856, 0.011013051, -0.06129994, -0.018439734, 0.0056438646, + -0.021476744, 0.013080913, 0.013459245, 0.02295379, 0.008297361, + -0.0020004883, -0.04693892, -0.007551066, -0.00392842, 0.01938297, + 0.0010261572, -0.011318824, 0.039512236, -0.028841237, -0.007152005, + -0.002430645, 0.14335105, 0.008515031, -0.018097682, 0.02194318, + -0.026265478, -0.03372844, 0.031458456, -0.0007566614, 0.023554971, + 0.0071001784, 0.0072349263, 0.01585361, -0.0015340532, -0.008281815, + 0.00416682, -0.03297178, 0.009292424, -0.004052803, 0.0068047694, + -0.07608075, -0.006887692, 0.009670755, 0.004612525, -0.045669176, + 0.0019538447, -0.031935256, -0.039097626, -0.010588077, 0.031795327, + 0.02345132, -0.048913494, -0.0077687358, -0.013516253, 0.026654173, + -0.017900743, -0.023466866, 0.022611737, -0.0030421934, + -0.013593991, -0.026120367, 0.11547897, -0.00031095673, + 0.0024461928, 0.04492288, -0.053588208, -0.02704287, -0.034345172, + -0.016019454, 0.0131431045, -0.085704856, 0.014925922, 0.015915802, + 0.014837818, 0.03104903, 0.018579664, 0.011691973, -0.019942692, + -0.0064627174, 0.007613257, 0.011868183, 0.01936224, 0.03600361, + 0.025643567, 0.023104087, -0.006296874, -0.007950127, 0.020004883, + -0.046498396, -0.063222684, -0.017107802, -0.014713435, + 0.0045399684, -0.0034049763, -0.08453877, -0.02008262, -0.005306995, + 0.006866961, 0.04562253, -0.06647218, -0.03928938, 0.023777824, + 0.022145301, 0.004944212, 0.015267976, 0.004296385, -0.010183833, + -0.015464915, 0.014101888, 0.020631978, -0.024736607, 0.014863731, + 0.021528572, 0.023586068, -0.01144839, 0.000114017465, + -0.0072608395, -0.04225902, 0.026654173, -0.04146608, 0.011225538, + -0.020979214, 0.014936289, -0.013982688, -0.061455414, 0.008069327, + 0.013360774, -0.017973298, 0.018781785, -0.10951895, -0.010468877, + 0.016755385, -0.0023425405, 0.021062136, 0.009748493, -0.008919275, + -0.040642045, -0.02446193, 0.03081063, -0.0010261572, -0.005213708, + -0.0103341285, 0.0024617407, 0.013075731, 0.010645086, 0.0020212189, + -0.0071416395, 0.0070898137, 0.045524064, -0.035189938, + -0.012821783, -0.0982675, 0.0015236881, -0.010137189, -0.026125548, + 0.0019020187, -0.0017154446, -0.012930617, 0.012427905, 0.030644784, + -0.015775872, 0.015604846, 0.014817089, 0.020549057, -0.03503446, + 0.049872275, 0.019331142, -0.02659198, -0.014713435, -0.0070898137, + 0.05996282, 0.00022285232, -0.02797574, -0.01950217, -0.014252184, + 0.02234224, -0.005260351, -0.01075392, 0.006815135, -0.023565337, + -0.040538393, 0.0065663694, 0.0056231343, -0.019346692, + -0.033624787, -0.015806967, -0.0064523523, -0.037418462, + -0.006400526, -0.020181092, -0.023078172, 0.013127556, -0.06507288, + -0.069566205, 0.054458886, -0.020409126, 0.027965376, 0.025788678, + -0.024632957, 0.0109560415, 0.02715689, 3.6278285e-5, 0.005379551, + -0.042507786, 0.011598687, 0.00924578, 0.011780077, 0.00484056, + -0.02635358, 0.0052085253, -0.018009577, 0.013060183, 0.032292854, + 0.015765507, 0.01236053, 0.01107006, -0.047187682, 0.014122617, + -0.026607532, -0.00565423, 0.05966223, -0.017071525, 0.056734055, + 0.01607128, 0.02081337, 0.026970314, -0.018087316, 0.03444882, + 0.0071001784, -0.011438025, -0.0012490095, 0.054132383, + -0.021741059, 0.013246756, -0.012044391, 0.01835163, -0.0059185433, + -0.008126336, -0.0072193784, -0.024114693, -0.002632767, + -0.00064782647, -0.0048198295, -0.004006159, -0.024285719, + 0.052007515, -0.012287973, 0.0088259885, 0.025482906, -0.0002954089, + 0.011142616, -0.0033738804, -0.0059548216, 0.0020523143, + -0.014760079, -0.027198348, -0.008758615, 0.038138844, -0.035837762, + -0.10033019, 0.03762058, -0.0065715523, -0.0008706788, -0.024788434, + 0.013070548, 0.010930129, -0.019232674, 0.022653198, 0.025902696, + 0.017366933, -0.0015651488, 0.0071571874, -0.0034775329, + -0.0015444184, 0.020901475, 0.019061647, 0.010556981, 0.0018501924, + 0.016693193, 0.018346447, -0.006561187, -0.017138898, -0.025902696, + 0.025799042, 0.02654534, + ], + }, + { + title: "Babies", + query: "photo of toddler", + minScore: 0.2, + showVideo: true, + textEmbedding: [ + -0.037668705, 0.00064175244, -0.023759263, 0.025042767, + 0.0014709831, 0.015027101, -0.018747823, 0.018531503, -0.021221096, + 0.014623303, 0.040452033, 0.011789497, 0.06196877, -0.01336864, + 0.025980156, 0.55503654, -0.00842931, 0.0072323335, -0.006705953, + -0.07496245, 0.0052782334, -0.024631757, -0.04707146, -0.016930727, + -0.01767343, -0.02683823, -0.015690487, -0.0075856578, 0.021934954, + 0.014457457, -0.012885524, -0.03559923, -0.014536774, -0.010960266, + 0.01573375, 0.021466259, 0.010058929, 0.0024949026, 0.009402756, + 0.0049104877, -0.003208762, -0.0012186086, 0.0063814707, + -0.009265752, 0.017680641, -0.026355116, -0.027436718, -0.027804464, + 0.015329951, 0.0061939927, 0.00616515, 0.04787906, -0.0113496445, + -0.010246406, -0.007008802, 0.012777363, -0.016916307, 0.0013916654, + 0.017622955, 0.026124371, 0.0368539, -0.01377244, -0.0018243075, + 0.03783455, 0.001521458, 0.03125118, 0.0034395044, -0.019815007, + -0.015762594, 0.089218006, 0.0068213237, -0.02516535, -0.007787558, + 0.025792679, 0.014089711, -0.021963798, -0.066093296, 0.0018964144, + 0.05002064, -0.070527874, 0.010131036, -0.039413694, 0.009474862, + 0.018675717, -0.009186434, 0.0127917845, -0.025331194, 0.011674126, + -0.016635088, -0.0004326421, -0.007845243, 0.02827316, 0.007080909, + 0.038959417, -0.0016007758, 0.021862846, 0.034106616, 0.011313591, + 0.007621712, 0.02106246, 0.0036125614, 0.0018531504, -0.00077875576, + -0.03751728, -0.029729724, -0.0143420845, -0.07822169, 0.006979959, + 0.0038721466, 0.013498433, -0.015265056, -0.0040740464, 0.056019936, + -0.057426028, 0.002610274, -0.06806181, 0.003403451, 0.011890447, + 0.0072323335, 0.0034683477, -0.03414988, 0.015366005, 0.01470983, + -0.005847879, -0.06406708, 0.0052061267, -0.036046296, -0.07235218, + -0.0017810432, 0.012013029, 0.06053384, 0.017868118, 0.00915038, + -0.05428937, -0.030883435, -0.016195236, 0.0074919187, -0.007419812, + -0.046905614, 0.039031528, -0.028201055, 0.033673976, 0.0070881196, + 0.00023074244, 0.012964842, 0.011609229, 0.019613108, -0.0147170415, + 0.0021415784, 0.009532548, -0.011666915, -0.04653787, -0.08192078, + 0.03661594, 0.018675717, -0.04123079, 0.02106967, 0.007448655, + 0.03256353, -0.051859368, -0.042269133, 0.0046509025, -0.010505992, + 0.0009950768, 0.04112984, 0.018625243, -0.017868118, -0.5596875, + -0.030256104, -0.039925657, -0.016606247, 0.09181386, -0.03318365, + -0.019180465, 0.0014060867, -0.008551892, 0.015070367, 0.003042916, + 0.006208414, 0.029974885, 0.00031006016, 0.03846909, 0.0027400665, + 0.0059055644, -0.023283355, 0.013628227, 0.014810781, -0.022893978, + 0.059697397, 0.028114527, -0.0072828084, -0.0042903675, 0.060483366, + -0.07522925, -0.024141429, -0.034236412, 0.019115571, -0.04477846, + 0.057909146, 0.0089412695, 0.037337013, -0.03711348, -0.002098314, + -0.030147944, -0.0020694714, -0.010830474, 0.026549803, 0.03926948, + 0.0018387288, 0.04306952, -0.009309015, 0.015596747, 0.015755383, + -0.03440226, 0.008645631, 0.021134567, 0.026412798, 0.0041245213, + 0.007996668, -0.026066687, 0.01881272, 0.01953379, -0.002350689, + 0.05210453, 0.003958675, 0.010087771, 0.013887811, -0.02608832, + -0.00090854836, -0.044403497, 0.023283355, -0.0044850563, + -0.016880251, -0.11022999, 0.011111692, -0.04955194, -0.0036197721, + 0.029664826, -0.009323437, 0.0034683477, 0.015380426, -0.023103088, + 0.0016873041, 0.027205976, -0.02619648, -0.01953379, 0.009705604, + 0.066735044, -0.07096773, 0.004636481, -0.003331344, 0.02949177, + 0.004492267, 0.06757148, -0.02508603, -0.0012907155, -0.038368143, + -0.019461684, 0.019129992, -0.020939877, -0.031099755, -0.021776319, + 0.023687156, -0.014096921, -0.008256254, -0.014428614, -0.010008453, + -0.027941467, 0.004636481, 0.0039082007, 0.008277886, 0.0074342336, + 0.012510567, 0.006186782, 0.027169922, 0.016808145, 0.0158347, + 0.0071962797, 0.008724948, -0.01120543, 0.043119997, 0.03249863, + 0.001788254, 0.043949224, 0.002538167, 0.02918892, -0.03585161, + 0.0010094981, 0.030688744, -0.041266844, -0.031070912, -0.015243424, + 0.0005263812, 0.009705604, -0.0072828084, -0.001694515, 0.004506688, + 0.042002335, 0.023391517, 0.010909791, -0.024754338, 0.003475558, + 0.014089711, -0.009575811, -0.012373564, -0.00015142473, + 0.004326421, -0.01438535, 0.040401563, 0.017449897, -0.04408623, + -0.0035548757, 0.004492267, -0.038288828, -0.021855637, + -0.039392065, -0.066655725, -0.017211946, -0.009272962, 0.028785119, + -0.019613108, -0.0060137254, 0.021055248, 0.044569347, + -0.0054657115, 0.0063309963, 0.015697697, 0.01951216, 0.008458153, + 0.00063454174, 0.002026207, -0.02291561, -0.032743797, 0.008623999, + -0.041879755, -0.00057685614, 0.015611168, 0.002653538, 0.003136655, + 0.006410314, -0.05578199, -0.011573176, 0.05498881, 0.020132279, + -0.021906111, -0.013700333, 0.013008106, -0.024213536, -0.020427918, + 0.011017952, 0.01490452, 0.0023290566, 0.022901189, -0.017594112, + 0.0047879056, 0.0012258192, -0.027090607, -0.048181906, + 0.0030357053, 0.03383982, -0.08334129, -0.01972127, -0.0069150627, + -0.025158137, -0.025230244, 0.029859515, 0.03844746, -0.036630366, + 0.010902581, 0.004809538, 0.021797951, 0.005919986, -0.009035009, + -0.03577229, 0.024588494, -0.061795715, 0.01254662, 0.02598737, + -0.05224153, -0.002804963, -0.013080212, 0.01294321, -0.04575911, + -0.015236213, 0.029816251, 0.0014205083, 0.00034611367, 0.003893779, + 0.029044706, -0.02569894, -0.013628227, -0.010924213, 0.008458153, + -0.033529762, 0.024213536, 0.019598687, -0.027595354, 0.002487692, + -0.031597294, -0.022771396, -0.029044706, 0.005775772, 0.017226366, + 0.0022569494, 0.04748968, -0.004362474, 0.014024814, 0.0047518522, + 0.0046653235, 0.027595354, -0.0006778059, 0.028713014, 0.012049083, + -0.014190662, -0.013145109, -0.015654434, 0.03022726, -0.022634393, + -0.020637028, -0.006179571, 0.052169424, 0.031215128, 0.044028543, + 0.0073621264, -0.013202795, 0.008400467, -0.0041100997, + -0.013736386, -0.021148989, -0.032513052, 0.012690835, 0.02477597, + -0.029037496, 0.0057685613, 0.0036558257, 0.017723905, 0.013260481, + 0.034596946, 0.020737978, -0.0069655376, -0.025504252, 0.028352479, + 0.02076682, 0.024653388, -0.0044345814, -0.0012835049, + 0.00035332437, 0.016180813, -0.01181834, -0.021091303, -0.02538167, + 0.011313591, -0.0062156245, 0.015452534, -0.02642001, 0.024516385, + -0.0024732705, -0.03708464, -0.028496692, -0.00493212, -0.041591328, + 0.036745735, 0.0012690835, -0.00585509, 0.034899794, -0.0050835446, + 0.013296533, 0.017781591, 0.023413148, 0.016887464, -0.0015286687, + -0.01572654, 0.011248694, 0.014017604, -0.0136498585, 0.002538167, + 0.027516035, 0.008133672, -0.00493212, 0.054000944, -0.033241335, + 0.01574096, -0.032556318, -0.030133521, -0.009842608, -0.050943606, + -0.053589933, -0.012236561, -0.0029491768, 0.009777712, + -0.028244318, 0.0030357053, 0.014515142, 0.07838033, 0.019093938, + -0.018344024, -0.058197573, -0.009777712, 0.00585509, 0.029852306, + 0.019461684, 0.022576706, 0.0042831567, -0.020824507, 0.011068427, + 0.0042110495, 0.018228654, -0.03414988, -0.013339797, -0.02361505, + 0.028648118, 0.00873937, + ], + }, + { + title: "Pets", + query: "photos of pets", + minScore: 0.2, + showVideo: true, + textEmbedding: [ + 0.015499058, 0.038108576, 0.0033366026, -0.024849616, 0.011684836, + -0.0008677857, -0.036285553, -0.00020853766, -0.00016144852, + 0.0013319502, 0.03972306, 0.0017893877, -0.0593996, -0.04062448, + -0.005630517, 0.5492949, -0.022737332, -0.0070768264, 0.023954922, + -0.06362417, 0.015277065, 0.04124337, 0.01919219, -0.03480561, + 0.0033635108, -0.04083302, -0.0294509, 0.016461022, 0.041976616, + 0.0049174526, 0.029154912, -0.0050990824, -0.0110794045, + 0.032767322, -0.0073997234, -0.03424054, -0.0033029674, 0.009142023, + 0.017564254, 0.0022737333, 0.020423237, -0.017362442, -0.019118194, + -0.035148688, -0.011671382, -0.04937634, -0.021701371, -0.013097511, + 0.03356111, -0.014732176, 0.04385345, 0.02055105, -0.010541243, + 0.013588583, 0.0069759213, 0.0060677733, -0.05872017, -0.020786496, + -0.0064848484, -0.015162706, -0.0145034585, 0.037805863, + 0.002166101, 0.056722246, -0.04638954, 0.029928518, -0.007749529, + 0.021593738, 0.035700303, 0.010837232, 0.005529612, 0.013938388, + 0.0011906828, -0.03349384, -0.004379291, -0.007971521, -0.11617566, + 0.014160381, -0.0051058093, -0.012249906, 0.03877455, 0.004769458, + 0.02775569, -0.00030944298, -0.02714353, 0.019246008, + -0.00057852385, 0.019071106, -0.008758582, -0.0080858795, + 0.037038982, 0.0074199047, -0.039379984, 0.032464605, -0.01099868, + 0.00442638, -0.031879354, 0.019905256, 0.032464605, -0.027681693, + -0.035337046, 0.026928267, 0.0038142211, 0.047533132, 0.0017153904, + 0.01219609, -0.061458066, 0.0035585945, 0.019461274, -0.011906828, + 0.0022602794, -0.005583428, 0.09441374, -0.0012983151, 0.010070351, + -0.008227147, -0.019521816, 0.021075757, 0.0072920914, 0.019044198, + -0.027681693, -0.0016212121, 0.06122935, -0.0110794045, + 0.0096869115, -0.014597637, 0.0067673833, -0.004708915, 0.011637747, + 0.029444173, 0.024291275, 0.049255252, 0.015129071, 0.019992707, + -0.02283151, -0.03871401, -0.0042582043, -0.010319252, -0.036124103, + 0.02380693, -0.02461417, -0.008543317, 0.016931914, 0.0041438453, + 0.029417265, 0.002805168, -0.0067808377, -0.00090142083, + -0.0064310324, -0.016676286, 0.006659751, -0.02201754, -0.036413368, + -0.020584686, -0.007305545, -0.01131485, -0.005085628, 0.00833478, + -0.0059197787, 0.024789074, -0.04277713, 0.016790645, 0.0060543194, + 0.032108072, 0.01810914, 0.028058408, -0.007581353, -0.5537482, + 0.016582107, -0.0077293473, 0.014732176, 0.073230356, -0.026168115, + 0.043483466, -0.010581604, 0.04939652, 0.010722872, 0.030251415, + -0.02236062, -0.051972967, -0.014658179, 0.010278889, 0.005771784, + -0.010278889, 0.002832076, 0.005381617, 0.007023011, -0.02176864, + 0.014416007, -0.030446498, 0.0064377594, -0.045400668, 0.0179746, + -0.020470327, -0.018687665, -0.023995286, 0.0030137056, + -0.030688671, 0.025266692, -0.004749277, 0.04636936, -0.046470266, + 0.01176556, -0.0087384, -0.003087703, 0.0022535522, -0.02700899, + 0.026417013, -0.029471083, 0.0011974098, 0.010029988, -0.024264365, + -0.027204074, -0.0325386, 0.0016750284, 0.06352999, -0.04159317, + -0.03649409, -0.012317176, -0.012216271, 0.023248585, 0.041061737, + 0.019595813, -0.014247832, -0.004439834, 0.00085433177, 0.004332202, + 0.01865403, -0.0039554886, -0.08877651, -0.006040865, 0.032464605, + -0.028132405, -0.08509682, -0.026201747, -0.025555953, -0.032646235, + 0.019703444, 0.041902617, -0.024721805, -0.03310367, -0.011570477, + -0.015801774, -0.010796869, -0.032733686, -0.030009242, 0.014981077, + -0.040241044, -0.080683894, -0.022905508, 0.010036716, + -0.0045541935, -0.0073728156, 0.054576326, -0.03471816, + 0.0070297373, -0.01978417, -0.035855025, 0.0007466994, 0.014133472, + -0.042541683, -6.7270216e-6, 0.022703698, -0.002865711, 0.037651137, + 0.056163903, 0.03125374, -0.050311394, 0.00961964, 0.010783415, + -0.010238527, 0.0041842074, -0.003107884, 0.020154156, + -0.0052807117, 0.019420912, 0.035686847, 0.030856848, -0.0030406138, + -0.01662247, 0.014920533, 0.039359804, 0.023786748, -0.0474255, + 0.017510436, 0.008240601, -0.010420156, 0.0060745003, -0.0180486, + 0.004029486, -0.032330066, 0.017100088, 0.012841884, 0.017833333, + 0.016461022, -0.011052496, 0.007366088, 0.053822897, -0.023558028, + -0.01187992, -0.021580286, -0.009175657, 0.00978109, -0.00096869114, + 0.02488998, -0.0069893748, 0.045434304, 0.0036594996, 0.035350498, + 0.008254056, 0.032215703, 0.027230984, 0.021943543, -0.006269584, + -0.008045517, -0.042212058, -0.057394948, -0.0020181064, + -0.018344587, 0.002172828, 0.020261789, 0.0054623415, -0.006040865, + 0.035646487, -0.06451887, -0.014691815, 0.006249403, -0.034543257, + 0.010265434, -0.016575381, -0.012061549, 0.01477254, -0.02380693, + 0.06783528, -0.022024268, 0.02039633, -0.012754433, -0.012835157, + 0.017086634, 0.00713737, -0.012969697, 0.014785993, -0.025825035, + 0.005448887, -0.012492078, 0.0017153904, 0.0024217279, -0.021674464, + 0.0074468125, -0.0071306424, -0.02226644, 0.015633598, -0.01878857, + -0.01104577, 0.02123048, -0.009673457, 0.04532667, -0.04788294, + -0.028737836, 0.05532975, 0.049181253, -0.002858984, -0.0058726897, + -0.0058054198, 0.039992142, 0.021297751, -0.029282724, -0.004419653, + -0.010581604, 0.028885832, 0.020181064, -0.0029195272, 0.05319056, + -0.026376652, 0.016595563, -0.03611738, -0.0125862565, -0.04194298, + -0.08883704, -0.011489753, -0.0068682893, 0.0015337608, + -0.022340437, -0.02640356, 0.024183642, 0.0024015466, -0.015546147, + -0.022730606, 0.04638954, -0.0015001257, -0.04510468, -0.04361801, + -0.0037200428, 0.011489753, -0.002542814, -0.0074199047, + 0.029598894, 0.00905457, -0.042595502, -0.058309823, 0.028724382, + -0.006424306, -0.027506793, -0.015418333, 0.04352383, 0.027109895, + 0.038444925, -0.041001197, 0.05113882, 0.034617253, -0.0030137056, + -0.022844965, 0.029894883, 0.01176556, -0.023255313, -0.0006121589, + -0.029767068, -0.012498806, -0.0061888597, -0.03656809, 0.058121465, + -0.088890865, 0.05002886, 0.02850239, 0.015875772, -0.023820383, + -0.0067404755, 0.017079907, 0.011920282, -0.023571484, -0.03588866, + 0.03321803, 0.017712247, -0.04509795, -0.024150006, -0.0108708665, + -0.020409781, 0.038788006, -0.0015270339, 0.017853515, -0.07197913, + -0.0029397083, 0.000941783, 0.004688734, 0.008872941, -0.009599459, + 0.0090411175, -0.03679681, 0.042299513, -0.011671382, -0.062742926, + 0.050264303, -0.004567648, 0.004930907, 0.020490507, -0.04079266, + -0.02689463, -0.018122597, 0.0011099585, -0.034697976, + 0.00029598895, -0.029262545, -0.017766064, 0.02682736, 0.005852509, + 0.0021593738, 0.049147617, -0.011644474, -0.007406451, 0.037294604, + -0.030910663, 9.41783e-5, -0.01976399, -0.0072920914, 0.016198669, + 0.0049510878, 0.0189702, 0.007480448, 0.006209041, -0.03825657, + -0.023833837, -0.0065992083, -0.0002488998, 0.006249403, + -0.042138062, -0.025206149, -0.07841689, -0.002811895, 0.0017221175, + 0.021102667, 0.020490507, 0.032377154, 0.014537094, -0.019999435, + 0.020786496, 0.012404627, 0.015485603, -0.010776688, -0.006760657, + -0.0032087893, 0.025152333, -0.015821954, 0.0032760596, -0.01903747, + -0.018990383, 0.0089402115, -0.015014712, -0.0043120207, 0.03105193, + 0.00023544575, 0.018963473, -0.03123356, + ], + }, + { + title: "Selfies", + query: "selfie", + minScore: 0.18, + showVideo: true, + textEmbedding: [ + -0.0011263192, 0.040301856, -0.02074704, -0.11898843, 0.03114752, + -0.038252916, 0.0115447715, -0.0012581225, 0.029248353, 0.06059357, + 0.04173372, -0.017290197, -0.024018157, 0.010490346, -0.013917232, + 0.4287502, 0.05462049, -0.034514494, 0.07627218, -0.03058436, + 0.02120236, 0.03208212, 0.033400156, -0.028265819, 0.010819853, + 0.017481912, -0.017937232, -0.03074612, 0.061078854, -0.02775658, + 0.0045052767, -0.040799115, 0.0027618785, 0.0077644135, 0.008447395, + -0.038318817, 0.018470436, -0.015582745, 0.025066594, -0.0488511, + -0.058676437, 0.032261856, -0.041805614, 0.075205766, 0.040613394, + -0.011484861, -0.008195769, -0.002935619, 0.036275864, 0.007171299, + 0.005332043, 0.04541223, 0.0035227428, 0.026061108, -0.062486753, + -0.044771187, 0.03306466, 0.0012760957, -0.008657081, -0.01927923, + 0.0028517444, -0.00859717, -0.038079172, -0.0409429, -0.086433016, + 0.030069128, 0.006236693, 0.05291903, 0.034460574, 0.072869256, + 0.01470206, 0.031824507, -0.033382185, 0.014372553, 0.011161344, + 0.003025485, -0.06787271, -0.011029541, 0.086672656, 0.0046191067, + 0.034748144, -0.021633716, -0.018116964, 0.031518962, 0.02063321, + -0.0005451864, -0.037054703, 0.030308772, 0.022011153, -0.020004148, + 0.023838425, -0.004810821, -0.0072551733, 0.020111987, + -0.0012641135, 0.0024443523, 0.01323425, 0.021118484, -0.050055303, + -0.03371768, -0.013461911, 0.021328172, 0.009340062, -0.018021107, + -0.004379465, 0.032759115, -0.060647495, 0.015151391, -0.034400664, + 0.02549795, -0.022035118, -0.015391031, 0.12818472, -0.08661874, + -0.024036132, 0.071635105, -0.02102862, -0.087325685, -0.0015876308, + -0.018626204, -0.035227433, -0.021406054, 0.037348267, -0.009933176, + 0.02047145, 0.0014797917, 0.039013777, -0.04082308, -0.024868889, + -0.0091004195, 0.0050864094, 0.023161437, -0.018338634, -0.01685285, + 0.0063684965, -0.008279645, 0.025414074, 0.004307572, 0.015492881, + -0.020657172, -0.024437532, -0.007752431, 0.01153878, -0.02080695, + -0.008495322, -0.036785107, -0.021519886, -0.029014701, 0.00661413, + -0.047509104, 0.024563344, 0.027708651, -0.035485048, 0.0050684363, + 0.03207613, -0.019375086, -0.009999079, -0.002120835, -0.07661966, + -0.016739022, 0.027522927, 0.055093784, -0.016181853, 0.008165814, + 0.0416139, -0.075697035, -0.019261258, -0.43341124, 0.052601505, + 0.035790592, -0.010694042, 0.07215632, -0.009094428, -0.01707452, + 0.022250796, -0.045370292, 0.013072493, 0.0041877506, 0.0365874, + 0.04126642, -0.01696668, -0.015115443, 0.027061615, -0.028930828, + 0.04953408, 0.05953915, 0.044375777, -0.04473524, 0.058460757, + -0.060240105, 0.014426471, -0.0213761, 0.009124383, -0.03601226, + -0.04032582, -0.009963132, 0.003217199, 0.02758284, -0.03369372, + -0.009795383, 0.077338584, 0.021975206, -0.01600212, -0.02601318, + -0.045885526, 0.0046071247, 0.025827456, 0.061444305, 0.049929492, + 0.044603437, 0.007171299, -0.004331536, -0.027798515, 0.01712245, + 0.0054458734, -0.008069957, -0.06565003, 0.008788884, 0.048713304, + 0.0040679295, 0.009519793, -0.015187336, 0.026091065, -0.03308862, + 0.001815291, 0.024293747, -0.034975808, 0.02951196, 0.057034887, + -0.01295267, -0.033507995, -0.0050085257, 0.02380248, -0.09486843, + 0.00876492, 0.012766948, 0.029493988, -0.03177658, 0.019225309, + -0.025875386, 0.01176045, -0.023149453, -0.031932347, 0.015486889, + -0.025743583, 0.030470528, 0.043944422, -0.04116457, -0.075020045, + 0.0061468272, 0.0092741605, -0.009376008, 0.022640213, 0.04531038, + -0.022580303, 0.019992165, -0.017889302, -0.050444722, -0.009987096, + 0.0007488825, -0.050366838, 0.012677082, -0.014228767, 0.0014797917, + 0.051708832, -0.024185907, -0.011604683, -0.054290984, 0.058394857, + -0.028601317, 0.004427393, 0.016367575, 0.056339923, -0.043602932, + -0.007818333, 0.002324531, -0.0070275124, 0.042081203, -0.01714042, + 0.005308079, 0.04495691, -0.0101069175, -0.025258306, -0.043680813, + 0.030488504, 0.0003414904, -0.026384626, 0.0055776765, 0.015175354, + 0.041913453, -0.0587663, 0.008477349, -0.04929444, 0.04883912, + -0.043507077, -0.013995115, -0.0037983318, 0.09000968, + -0.0077883773, -0.024335682, 0.0062187198, -0.040194016, -0.0264685, + 0.03414904, -0.05403337, -0.018051064, 0.00040739204, 0.036281858, + -0.020117978, -0.050085258, -0.0228499, -0.04105074, -0.028199919, + 0.021957234, 0.029877415, 0.027277295, -0.059275545, 0.084264256, + -0.03755196, 0.009250196, 0.00046730263, -0.026606295, -0.029032674, + 0.011736486, -0.0040799114, -0.03198627, -0.011808378, 0.013282179, + 0.008471359, 0.007105396, 0.025360154, -0.01599613, 0.010058989, + 0.06759114, -0.020070048, -0.05330845, -0.018506382, 0.008681046, + -0.075097926, -0.016810913, -0.048587494, -0.0036845016, + -0.04048758, -0.040301856, 0.046892025, -0.0206392, -0.015696576, + -0.01752984, -0.11967141, 0.01940504, -0.012060003, 0.007542744, + 0.024389602, 0.012617171, 0.0044873036, 0.00024563345, -0.06508687, + -0.0065002996, -0.05510577, 0.043351308, -0.073037006, + -0.0032531454, -0.0022286742, -0.015558782, 0.032717176, + -0.01012489, 0.07116181, 0.06544633, 0.0058592563, -0.013881286, + 0.013995115, -0.03325637, 0.02165768, 0.009813355, 0.014252732, + -0.042201024, 0.0027379142, -0.059413336, 0.005302088, 0.014468409, + -0.038768146, 0.0030674224, 0.02618692, -0.05269736, 0.028092079, + -0.043327343, -0.00565556, -0.013449929, 0.012413475, -0.087115996, + 0.03048251, -0.086552836, -0.007500807, 0.024808979, -0.013575741, + 0.058406837, -0.010214756, -0.015211299, -0.025743583, -0.11988111, + 0.0047029816, -0.06276234, 0.02550394, 0.013431956, 0.031015715, + 0.020651182, 0.077284664, -0.0051942486, 0.009603669, 0.015001614, + -0.014294668, 0.0037084657, 0.007590672, 0.024802987, -0.016373565, + 0.06445181, -0.036209963, 0.005206231, -0.03969676, -0.031524956, + -0.009747454, -0.056807227, -0.02108853, 0.022700125, 0.01832665, + 0.0025941287, 0.012407484, 0.032213926, 0.045268446, 0.027774552, + 0.020375593, -0.0032291813, -0.030308772, 0.007452878, -0.012245725, + -0.05944329, -0.008387484, -0.024581317, 0.027936311, -0.019482926, + -0.01814692, -0.062564634, -0.048108205, -0.057358403, -0.023323195, + -0.049623948, -0.05750219, -0.01786534, 0.0009705517, -0.012754966, + -0.050294947, 0.02753491, 0.09078852, -0.019434998, -0.008974607, + -0.03320245, 0.059245586, -0.048689343, -0.0057094796, 0.007291119, + -0.0055716857, 0.025456011, -0.0036964838, 0.03136919, -0.023419052, + 0.057238586, -0.0349818, -0.01328817, -0.032765105, -0.032363705, + -0.0046610446, -0.018093, 0.016774967, 0.003930135, 0.010718006, + -0.0008806857, 0.044243973, 0.04494493, 0.0025641737, 0.010975622, + 0.00605097, -0.053146686, -0.043033782, 0.028775059, 0.050420757, + -0.0063325497, -0.00938799, 0.034634314, -0.019177383, 0.023928292, + 0.040739205, -0.047119685, -0.024785014, 0.026708145, 0.0089566335, + 0.0398705, 0.025605788, -0.014947694, -0.0062906127, -0.014342598, + 0.0042776163, -0.0048707314, 0.015846353, -0.022646205, + -0.014324623, -0.0026121018, 0.01780543, 0.037641827, 0.027127517, + -0.009939168, -0.050019357, -0.013030554, + ], + }, + { + title: "Wallpapers", + query: "high resolution hd wallpaper", + minScore: 0.18, + showVideo: false, + textEmbedding: [ + 0.032093976, -0.022385579, -0.00020051774, 0.005241311, -0.05675209, + 0.012348551, 0.039089818, -0.040042277, 0.020720165, 0.101189055, + -0.02948168, -0.02221291, -0.04773436, 0.0058929934, -0.014816034, + 0.49386406, 0.009563583, -0.0051299124, 0.03526327, 0.04364046, + -0.015127949, 0.013312151, 0.02672456, -0.014086371, 4.45595e-5, + -0.005029653, 0.005230171, -0.0012810855, 0.012348551, -0.032238796, + 0.034138143, -0.016425746, -0.034266256, -0.029414838, 0.004812426, + 0.011462931, -0.03292947, -0.050123867, 0.0028295282, 0.018514471, + 0.03807609, 0.014337019, 0.031481285, 0.037268452, -0.009312935, + -0.012209302, -0.033285942, 0.01945579, 0.0030244759, 0.020174311, + -0.007558405, 0.0059876824, 0.009658271, 0.007614104, -0.0013757745, + -0.0177681, 0.02490319, -0.018787399, -0.047478143, 0.0024452023, + 0.022107081, -0.019316543, -0.022942571, 0.064511016, -0.03565874, + 0.04229253, -0.022859022, -0.027036475, -0.0076363836, 0.05596116, + 0.03557519, 0.05645131, -0.013735466, 0.0093407845, -0.0032249936, + -0.004556209, -0.072086126, -0.043874394, 0.0070292605, 0.068293, + -0.007491566, -0.049021017, -0.0035703299, -0.006043382, + -0.023365887, 0.062132653, 0.044966105, -0.0012532359, -0.008750372, + -0.006082372, -0.05675209, -0.0057815947, -0.033274807, + 0.0031525844, -0.024752801, -0.0045116493, -0.003096885, + -0.030021962, -0.019355532, -0.027827406, 0.014743623, 0.021789595, + -0.002049737, 0.08173326, 0.009351925, -0.042838387, -0.06335803, + -0.0041551734, 0.031230638, 0.013223032, 0.041451473, 0.0005569937, + 0.12252748, -0.04196391, -0.0048291357, 0.1443115, -0.011964225, + 0.0019884675, -0.014242329, -0.028829996, 0.035369102, 0.030551108, + 0.037920132, 0.0424652, 0.015478856, 0.006862163, -0.07678716, + -0.027147874, 0.020631047, -0.02044724, 0.020057343, 0.027465362, + -0.002216835, -0.017244525, -0.017996468, -0.0032138538, + 0.011368242, 0.03188789, -0.041234244, -0.014426137, 0.005625637, + -0.019299833, -0.019344391, -0.010265394, -0.008143248, + 0.0090010185, 0.026362512, -0.0127774365, -0.011869536, + -0.019349962, 0.00793716, 0.0035536198, 0.05486945, 0.0034477913, + -0.023722362, -0.034010038, 0.0047678663, 0.017055148, -0.021388559, + -0.015840901, -0.025120417, -0.015378597, 0.013451398, 0.014877303, + 0.018330663, -0.06190985, 0.012226013, -0.49835342, 0.033302654, + -0.040287357, -0.010204125, 0.0561951, -0.024117827, -0.009056718, + 0.0024674824, 0.012365261, 0.0026958496, 0.005920843, 0.010744409, + 0.058796257, 0.018341804, -0.014559816, -0.0038766763, 0.015373027, + 0.026323525, 0.0065836655, 0.0025176115, 0.021388559, 0.007820192, + 0.009530162, 0.01413093, -0.017038438, -0.044648618, 0.011490781, + -0.015573544, -0.045528665, 0.028206162, 0.049700547, 0.047884747, + 0.005085353, 0.057281237, -0.052491087, 0.00707382, 0.0379257, + 0.024262648, -0.016414605, -0.046776332, -0.010967206, -0.033831798, + -0.01248223, -0.038616374, 0.030734912, -0.016726522, 0.030902011, + -0.003013336, 0.04066611, -0.046553534, -0.0009134697, 0.027309401, + 0.009947908, -0.024635833, -0.02480293, 0.017523022, -0.029392557, + -0.026100725, -0.05679665, 0.056423463, 0.006962422, -0.014119791, + -0.029024944, 0.034477912, 0.031642813, -0.038772333, -0.0042164424, + 0.010989486, -0.008934179, -0.03391535, -0.022831174, -0.0058874236, + 0.00013367849, -0.028022354, -0.013612926, -0.07437537, + -0.016481444, -0.012866555, -0.026407074, -0.011563189, + -0.047622964, -0.06853808, 0.01962289, -0.00980866, 0.017110847, + -0.0231041, 0.005408409, -0.032127395, 0.00531372, -0.0134124085, + -0.032461595, -0.002851808, 0.011680159, -6.126931e-5, 0.020023923, + 0.014905152, -0.018965635, 0.009936769, -0.023482855, -0.039886322, + -0.028880125, -0.007591825, 0.017127557, 0.0039379457, -0.016726522, + -0.020848276, 0.0020107473, 0.0014871733, 0.0025398915, + -0.018319523, -0.0135182375, -0.06772486, -0.043985795, -0.03196587, + 0.009106847, 0.031213928, -0.014699064, 0.05031881, -0.0011084175, + 0.010354513, 0.026340235, 0.02676355, 0.019968225, -0.014905152, + 0.0074302964, -0.050497055, -0.0018157995, -0.018792968, + -0.020068483, -0.01665968, -0.008299206, 0.06564171, -0.0021444259, + 0.021020943, -0.014437278, 0.024986738, 0.025009017, -0.004327841, + 0.024652543, -0.031169368, 0.009530162, 0.024524432, 0.00013924843, + 0.08978739, 0.022574956, -0.0054418286, -0.0062717493, -0.004506079, + 0.013445828, -0.044553928, 0.020113043, -0.06200454, 0.0068510226, + -0.04795159, -0.06583666, -0.031770922, 0.0006294029, -0.050491482, + -0.0017601001, 0.053048085, -0.07610762, 0.0155122755, -0.008254647, + -0.027320541, 0.028551497, -0.009491173, 0.0056479163, + -0.0071016704, 0.016425746, 0.0070571103, -0.008388326, 0.012810856, + 0.035318974, 0.018397503, -0.0025788809, 0.059659597, -0.0021945552, + -0.02670228, -0.023644384, 0.005831724, -0.025471324, 0.023700083, + -0.025070287, -0.0097640995, -0.007302188, -0.022491407, + -0.014648935, 0.010387933, -0.00892304, 0.06877758, 0.010527181, + -0.008187808, -0.0020998663, 0.0022056953, -0.0030801753, + -0.006800893, 0.0020218873, 0.04506636, 0.042843957, -0.0009970188, + -0.043228284, -0.038315598, -0.009608141, 0.02392845, 0.03625472, + -0.02561614, 0.012120184, -0.0014927431, -0.02485306, 0.0248085, + -0.008182238, -0.11733073, 0.04351235, 0.011930806, 0.0059876824, + 0.024413036, -0.01686577, 0.0051466217, 0.019628458, -0.019155014, + 0.009591431, -0.01784608, 0.036978815, -0.023388166, -0.07350647, + 0.03270667, 0.005096493, 0.011746998, 0.015679374, 0.03409359, + -0.04006456, 0.0019996073, -0.10097182, -0.060623195, + -0.00049572444, 0.016442455, -0.06061763, -0.02830085, -0.007190789, + -0.054824892, 0.04801843, -0.011992075, -0.07789, 0.03106911, + -0.0056367763, 0.003737428, 0.008544284, 0.016392326, -0.013150621, + -0.05674095, 0.013702045, 0.00797615, -0.027977794, -0.032316778, + 0.057698984, -0.02484192, -0.007903741, 0.015712794, -0.052897695, + 0.008327057, -0.0178795, -0.014743623, -0.004701027, -0.013757746, + 0.06597034, 0.03799811, 0.060962964, 0.019004626, -0.024385184, + 0.006087941, -0.01336228, -0.033982188, 0.03980277, 0.03016121, + -0.0328125, 0.032311205, 0.013835724, 0.012593628, -0.016564993, + -0.015412017, -0.0017601001, -0.06927331, -0.0041050436, + 0.065608285, 0.00060155324, -0.010120575, 0.009658271, -0.029370278, + 0.0031470144, -0.00444481, -0.025866788, 0.017378204, 0.008087549, + -0.0195839, -0.002049737, 0.016208518, -0.012103474, -0.017606571, + 0.06707318, -0.012576918, 0.020202164, 0.021717185, 0.0134959575, + 0.03835459, 0.023315758, -0.006750764, 0.009847648, -0.00021722756, + 0.010794538, -0.012844276, 0.012604767, 0.00971954, -0.05551557, + -0.0033642421, -0.07514402, 0.03486781, 0.013401269, 0.08324828, + -0.042598877, -0.10107208, 0.04008684, -0.0031637242, 0.0026234405, + -0.009212676, -0.031731933, -0.028601626, -0.0345169, 0.036728166, + -0.00064054277, 0.014816034, -0.045924135, 0.0036037494, + -0.011674589, 0.004272142, -0.036165603, 0.041791238, -0.032366905, + 0.023571974, -0.022095941, -0.027716009, 0.03546936, -0.0002840668, + 0.0011418371, 0.0044949395, -0.0117804175, + ], + }, + { + title: "Food", + query: "photo of food", + minScore: 0.2, + showVideo: true, + textEmbedding: [ + -0.012083651, 0.016745469, -0.007044219, -0.033847954, -0.020761909, + 0.01960847, 0.0015722477, -0.0116099175, -0.018303985, -0.039670076, + 0.027504038, 0.026577167, 0.017823385, -0.006968696, -0.00054925686, + 0.5646292, 0.018441299, -0.0029522558, -0.016690543, -0.043597262, + 0.015530238, -0.021654453, 0.007071682, -0.021935945, -0.016676812, + -0.0141914245, -0.040198736, 0.023013864, 0.011094988, -0.006103617, + -0.009577666, -0.0047854003, 0.016072629, -0.014088438, -0.01623054, + 0.03081331, 0.0015035907, -0.013195896, 0.033078995, -0.003844798, + 0.046000265, -0.0061997366, -0.013662764, -0.0039065895, + -0.024757752, -0.052172538, -0.02633, 0.00061791396, -0.0044009206, + -0.0244282, 0.012056189, 0.0056161513, 0.016347257, -0.006831382, + -0.030909428, 0.01824906, -0.046158176, -0.015420386, -0.010133789, + 0.042663526, -0.0068451134, -0.008781244, 0.0029385241, -0.0399859, + -0.054431356, 0.04163367, -0.00893229, -0.0073463107, 0.04817669, + 0.049240876, 0.032866158, -0.008389899, -0.02981778, -0.019670261, + 0.017260397, 0.002279416, -0.07170548, 0.017596817, 0.012275891, + 0.0028904642, -0.009742443, -0.009357964, 0.011129317, 0.026790004, + -0.006069288, 0.013786348, 0.0063713794, -0.0044215177, + 0.0052110744, -0.028774194, 0.054905087, 0.029206732, -0.006851979, + 0.0040233065, -0.010978271, -0.0033436012, -0.052337315, + 0.028478969, -0.029364644, -0.017280994, -0.020720715, -0.00521794, + 0.03899037, 0.035736024, -0.0045245034, 0.0014417992, -0.07982762, + -0.011671708, 0.023109982, 0.0014143364, 0.0009886624, -0.019471155, + 0.12529236, -0.04319905, 0.0256091, -0.03793305, 0.013271418, + -0.0105457315, -0.03239929, 0.012028726, -0.03534468, -0.009200052, + 0.0021215046, -0.0411668, -0.025355069, 0.011836486, 0.034452137, + 0.0034191238, -0.022368485, 0.006790188, -0.001139708, -0.021702511, + 0.0074630277, 0.0008650796, -0.013031119, -0.017157411, 0.02173684, + 0.023295356, -0.005286597, 0.014143364, -0.013978587, 0.0003844798, + 0.009941549, -0.015001577, -0.0030209126, -0.003130764, + -0.0036182296, 0.01395799, 0.00801915, -0.0167592, -0.023432672, + 0.024853874, 0.03587334, -0.027600158, 0.002162699, 0.013443061, + 0.02809449, 0.009893489, 0.006618545, -0.010943944, 0.026549704, + -0.016608154, 0.025739549, 0.021427885, 0.043020543, -0.054191053, + -0.030023754, -0.5698471, -0.008657661, -0.0045931605, 0.016052032, + 0.08418048, 0.00749049, -0.01946429, -0.017603682, 0.0021695646, + 0.009763041, 0.01592845, -0.009701249, -0.0036250954, 0.0007964224, + 0.011637379, 0.005471972, 0.00083761674, -0.011760962, 0.019951755, + -0.027016573, -0.030566145, 0.045526527, -0.0017988163, + -0.005135552, -0.050092224, -0.02023325, 0.0066460078, -0.015180087, + -0.03463751, -0.018812047, -0.00787497, -0.0068725767, 0.040164407, + 0.031596, 0.00275315, 0.0007620939, 0.009783638, 0.003412258, + 0.020013547, 0.050600287, -0.0040988293, 0.021448482, -0.03798111, + 0.0060280943, -0.0066666054, -0.0037418124, -0.0048334603, + -0.0017095619, 0.027050901, -0.06111169, 0.0013319479, -0.013855004, + 0.021805497, -0.007497356, 0.061125424, -0.012399473, 0.014417993, + 0.0022382217, -0.009632592, 0.013930527, -0.04257427, -0.007085413, + -0.06352842, -0.020864895, 0.030854503, -0.014589635, -0.10236088, + -0.014170826, -0.01000334, -0.02037743, 0.004867789, 0.007984822, + -0.0056916745, -0.016360989, -0.0009886624, -0.0090078125, + 0.026247611, 0.016601289, 0.0041949493, 0.028760463, -0.009344232, + -0.059395265, -0.0018949362, -0.008369301, -0.004908983, + -0.017562488, 0.07001652, -0.01661502, -0.025162831, -0.004016441, + 0.02028131, 0.0069549647, 0.009714981, -0.0013250822, -0.015646955, + -0.009522741, -0.000116717085, 0.0065155593, 0.0032406154, + 0.007222728, -0.05040118, -0.0046412204, -0.017795922, -0.009234381, + 0.0075866105, 0.024174167, 0.02633, 0.0009955281, -0.00046000263, + 0.008204524, 0.016944574, 0.0029453898, -0.02254013, 0.029440168, + 0.014301275, 0.025444325, -0.020356832, 0.029755991, 0.03331243, + -0.031190922, -0.010875286, 0.020658923, 0.002300013, -0.03776141, + -0.00080328813, -0.040535156, -0.03139003, -0.0040027094, + 0.0072295936, -0.006577351, 0.0057260026, 0.029913902, 0.0082731815, + 0.025739549, 0.0049295803, 0.03047689, -0.016381586, 0.009817966, + -0.0132920155, 0.016827857, -0.0010710509, 0.02703717, + -0.0020459818, -0.013518585, -0.010037669, 0.022581322, + -0.0118227545, -1.3731422e-5, -0.02024698, -0.070950255, + 0.0020253847, -0.031781375, 0.0048334603, -0.026240747, 0.032859292, + -0.043803234, 0.045354884, -0.0061173486, 0.0026295672, + 0.0123926075, -0.036422595, 0.023878943, -0.0005904511, 0.011802156, + -0.003844798, -0.019581007, 0.07515894, -0.020713849, + -0.00033641982, -0.00565048, 0.015386058, -0.031753913, 0.02733926, + -0.010477074, 0.018880704, 0.044565327, 0.010971406, 0.026288806, + -0.022066394, 0.023652375, -0.016409049, -0.080521055, 0.020775642, + 0.005643614, 0.011156781, -0.022306696, 0.017583085, -0.027085228, + 0.009426621, 0.017823385, -0.0046343547, 0.011033197, -0.05370359, + 0.033641983, -0.00083761674, -0.021908483, -0.004085098, + 0.014163961, 0.0060418253, -0.008657661, 0.011115585, 0.005266, + -0.004270472, 0.002732553, -0.033113323, 0.007003025, 0.0036182296, + 0.035811547, -0.041606206, 0.008300644, -0.009584532, -0.115179166, + -0.017054426, -0.009872892, -0.012557385, 0.0027600157, + -0.024084914, 0.022045797, 0.019629067, -0.014562172, 0.0021901617, + 0.023103116, 0.034761094, -0.023830881, 0.04333637, 0.0147612775, + -0.0057809283, 0.012447534, -0.022203708, 0.013374405, 0.011136183, + -0.00029522556, 0.048327737, 0.037747677, 0.0027874787, 0.008410496, + 0.0029522558, 0.009344232, 0.007284519, 0.023597447, 0.042491883, + 0.0014761279, -0.010133789, -0.013182165, -0.01261231, -0.011335288, + 0.003748678, -0.02024698, -0.023995658, -0.030167934, -0.025217757, + -0.023501327, 0.0018880705, 0.023782821, -0.0058701825, 0.010662449, + -0.012866342, 0.013731421, 0.012481863, -0.008554676, -0.0046137576, + 0.013024253, 0.019443693, -0.007318848, 0.011706037, -0.006440037, + -0.034040194, -0.008589004, 0.029460765, 0.011383349, 0.035179902, + 0.009103932, -0.01989683, -0.04038411, -0.028039563, -0.017514428, + 0.004936446, -0.0047579375, 0.0049433117, 0.019965487, 0.014012916, + 0.013868735, 0.01487113, -0.07837895, 0.017610548, -0.0445104, + 0.020658923, -0.0017919504, 0.0121797705, -0.02048728, + -0.0024304616, -0.008197659, -0.02671448, -0.010683046, + -0.009783638, -0.019972352, -0.009591398, 0.009790503, 0.058392867, + 0.0005767197, -0.0031925554, -0.019574141, -0.010133789, 0.01763801, + 0.055049267, 0.0038173355, -0.024078049, 0.014315006, 0.013092911, + -0.024325214, -0.010751703, 0.02333655, -0.011912008, -0.009145127, + -0.006611679, 0.00260897, -0.05136238, -0.13511032, -0.01999295, + -0.1386805, 0.017802788, 0.004442115, 0.0072089965, -0.0012701565, + 0.025018651, -0.009996475, 0.0027668814, -0.00061791396, + -0.007044219, -0.010696777, -0.013312614, 0.029604943, -0.014424859, + 0.0148779955, -0.041283518, 0.02476462, -0.005197343, 0.00067283964, + -0.010030803, -0.024922531, -0.00048059976, -0.029584348, + 0.014397396, 0.007689596, -0.040693067, + ], + }, + { + title: "Celebrations", + query: "celebration with friends", + minScore: 0.2, + showVideo: true, + textEmbedding: [ + 0.026342282, 0.01797094, -0.003183855, -0.0350773, 0.01633098, + -0.010189708, -0.041939057, -0.044670034, -0.029567307, + -0.034555804, -0.013538245, -0.00022643796, -0.00014409689, + 0.016029064, -0.008419375, 0.4912194, 0.031111203, 0.007348941, + 0.039407067, -0.010114229, 0.025381636, -0.0009126136, -0.007877297, + 0.0039386484, -0.0057089813, 0.001605651, -0.0016674068, + 0.017922906, -0.014828255, -0.018464986, 0.006614733, -0.05048194, + -0.026932394, -0.025264986, 0.020564685, -0.05590959, 0.017476894, + -0.032106157, 0.081654906, 0.0328335, 0.032806057, -0.01785429, + -0.037245613, 0.016962262, -0.023384865, -0.027028458, -0.02778325, + -0.018533604, 0.0028064582, 0.02000202, 0.0020173562, -0.002312412, + 0.016193746, 0.104593754, 0.01206983, -0.0011870839, 0.024791526, + 0.017168114, 0.0046042386, -0.05118184, -0.03469304, 0.0052217967, + 0.009215339, -0.036737844, -0.10656994, 0.012268821, 0.015946722, + 0.009229062, -0.017607268, 0.014917458, 0.0107729575, -0.018101314, + -0.019288396, 0.04593946, 0.013133402, 0.008151767, -0.029025229, + -0.010169122, 0.034761656, 0.075623415, -0.0019556005, 0.015946722, + 0.009078104, 0.038041577, -0.0042611505, 0.0004871847, 0.022925127, + 0.030610293, -0.029450657, 0.028538045, -0.034500908, 0.016454492, + 0.006504945, -0.006511807, 0.023062363, 0.03228456, -0.109788105, + -0.0023673058, -0.013895056, -0.062325332, 0.020530375, 0.000535217, + -0.007842988, -0.003801413, 0.006786277, 0.025621798, -0.042364486, + -0.012241374, 0.0052355197, 0.0058256313, -0.023179013, 0.010498487, + 0.11106439, -0.041486178, -0.033855908, 0.005715843, 0.0059560044, + -0.04880081, -0.027344098, 0.042289004, 0.027186278, -0.027028458, + 0.052567914, -0.034500908, 0.022726137, -0.02632856, 0.03277861, + -0.07358547, -0.008240969, -0.035084162, -0.024647428, -0.003609284, + -0.005180626, 0.027947934, -0.024503332, -0.0032318872, + -0.027323514, -0.012543291, -0.017819982, -0.019665794, 0.004274874, + -0.025964886, -0.016674068, -0.047373563, -0.0012694249, 0.0296222, + -0.01195318, 0.004590515, -0.017785672, -0.0040415744, 0.012783452, + -0.010697478, -0.088667616, 0.01750434, 0.020448033, -0.015493846, + -0.0060726544, 0.013414733, -0.035845812, 0.023858327, -0.029066399, + -0.010539657, 0.022568317, 0.020667609, 0.021758629, -0.040388297, + 0.018005248, -0.49567956, -0.019370737, -0.028901717, 0.008920283, + 0.05122987, -0.04781272, 0.058935624, 0.045706157, 0.008879113, + 0.024777802, 0.0050159437, 0.000102926344, -0.07427851, + -0.021093039, -0.014004845, 0.014327347, -0.022925127, 0.010011302, + -0.030335825, 0.018355198, 0.009002624, 0.016159438, -0.030877903, + 0.031934615, 0.0019693242, -0.044217158, 0.012255097, -0.009606459, + -0.015384058, 0.0067725535, 0.00030877904, -0.032092433, + 0.036586884, -0.014533199, 0.024510194, -0.011829668, -0.0058462163, + -0.04714713, 0.016694652, -0.04055298, 0.033505954, -0.004020989, + -0.0053658937, -0.015363472, 0.00406216, 0.03762301, -0.063533, + 0.0048238146, -0.022355603, -0.0031975785, -0.015987892, + -0.009771141, -0.0056746723, -0.04106075, 0.016118266, 0.025765896, + 0.035084162, 0.01633098, 0.03136509, -0.05513421, 0.039324727, + -0.012900102, 0.0027858731, -0.010663169, 0.018663976, -0.005633502, + 0.004638547, -0.020331383, -0.032476693, 0.009359436, -0.032408074, + -0.01578204, 0.005715843, -0.032593343, 0.028757619, -0.049871244, + 0.046824623, -0.07769567, 0.029601617, 0.008899698, 0.040038347, + -0.05852392, 0.04053239, -0.04418971, -0.02055096, -0.021971343, + 0.029423213, 0.007040162, 0.037986685, 0.014601817, -0.013133402, + -0.03594188, 0.03199637, -0.033931382, -0.028421395, -0.04235076, + 0.008227246, 0.0550107, -0.031241575, -0.0038219984, -0.047455907, + 0.035056714, 0.01930212, -0.02812634, 0.0036024218, 0.055353787, + -0.010670031, 0.040882345, 0.018787488, 0.029594755, -0.0191443, + -0.034713626, -0.019583452, 0.004508174, 0.019748135, 0.043084968, + -0.0004871847, 0.002332997, 0.037163273, -0.053816754, 0.0052149347, + 0.031145513, 0.039805047, -0.027851868, -0.017030878, -0.063210495, + -0.012364885, 0.02750192, -0.019164884, 0.013421595, 0.027460746, + -0.0044326945, -0.030376995, 0.018547326, -0.022787893, 0.00906438, + 0.004199395, 0.02437982, 0.02605409, 0.023233907, 0.006882341, + 0.031166095, -0.02895661, -0.0039386484, 0.013565692, -0.018190516, + 0.016042786, -0.031474873, -0.020873463, -0.03955116, 0.029196773, + 0.044409286, 0.016831888, 0.0009194754, -0.0063814335, -0.06200283, + 0.041740064, -0.04781958, -0.01933643, 0.011781636, 0.013764682, + -0.014903734, -0.028146923, 0.06463775, -0.0031358227, 0.038501315, + 0.059381638, -0.025999194, -0.023508377, 0.049452677, -0.029018367, + 0.018471848, -0.00203108, -0.02977316, -0.030829871, 0.07470394, + 0.01781312, 0.014862564, 0.026534412, -0.040470637, 0.025985472, + -0.06216065, -0.026589306, -0.02934087, 0.019357014, -0.022863371, + -0.025930578, -0.084303536, 0.038309183, -0.09027327, 0.0066764886, + 0.016749546, -0.033396166, 0.01418325, 0.0047414736, -0.044553384, + -0.031769935, 0.043942686, -0.013798991, 0.02378971, 0.031241575, + 0.012913825, 0.029231083, 0.025223818, -0.022609487, 0.006312816, + 0.049795765, 0.0027035319, 0.020221597, 0.026616752, -0.03675157, + -0.073194355, -0.009407467, 0.0020653887, -0.006779415, + -0.0150684165, -0.061556816, -0.011507166, -0.023096673, + -0.025367914, 0.0039592334, -0.0063265394, 0.025539456, 0.027097076, + -0.09998951, 0.017689608, 0.03093966, 0.005969728, -0.0029162464, + 0.016619174, 0.008405651, 0.028421395, -0.1283766, 0.04167831, + -0.018238548, -0.0108552985, -0.03868658, -0.044937644, 0.022046823, + 0.009098689, -0.0033553988, -0.02437982, -0.018705148, + -0.0015576186, 0.018684562, -0.023796571, 0.01890414, 0.043544706, + -0.030075077, -0.030720085, -0.022142887, -0.0152468225, + 0.006902927, 0.0066559035, 0.010361252, 0.017133806, -0.011136631, + 0.011479719, 0.015617357, 0.027323514, 0.010656307, -0.017964078, + -0.012687388, -0.03907084, 0.004624824, 0.023062363, 0.0024222, + -0.045157216, 0.0034171545, -0.0027035319, -0.041520488, + -0.02848315, -0.030322101, 0.010368113, -0.034720488, -0.014725328, + 0.034816552, 0.047256913, 0.03532432, -0.009640767, -0.030150557, + 0.017600406, -0.019631485, -0.00691665, 0.006079516, 0.05363149, + 0.01277659, 0.008954592, 0.007822402, 0.02562866, -0.017524926, + -0.0154183665, -0.018389506, -0.025361052, -0.043819174, + 0.0038631689, -0.00929768, -0.026472656, 0.007486176, -0.045610093, + 0.02891544, -0.046941273, -0.0001578204, 0.033341274, -0.047188297, + -0.016186884, -0.007897881, 0.014766499, 0.014979214, -0.015672252, + 0.066078715, 0.031022001, 0.009798588, -0.028297883, -0.06480929, + -0.007122503, -0.018272856, 0.003924925, -0.02610212, -0.102102935, + 0.075760655, 0.012275682, 0.006779415, 0.008590919, 0.0196109, + 0.02055096, 0.0050433907, -0.007211706, 0.0054207873, 0.021168519, + -0.016536832, -0.02660303, 0.040422607, -0.006902927, -0.0059354194, + -0.06325853, -0.0034994958, -0.019528558, -0.021223411, + -0.003520081, 0.017998386, 0.06544057, -0.04656388, -0.021017559, + -0.10281656, + ], + }, + { + title: "Sunset", + query: "photo of setting sun", + minScore: 0.2, + showVideo: true, + textEmbedding: [ + 0.0338652, 0.003039766, 0.02503756, -0.016871026, 0.031680975, + -0.0032925399, -0.04358078, 0.026450502, 0.039121594, 0.020092271, + 0.01947654, -0.027597705, 0.010940565, -0.031583752, 0.02112281, + 0.522237, 0.003124024, -0.024194982, 0.032102264, -0.012509059, + 0.005405469, 0.014570137, -0.02804492, 0.035323508, 0.0032990212, + -0.028531026, 0.02337833, 0.008775786, -0.027306044, -0.053276923, + 0.032380965, -0.0024434794, -0.038914192, -0.013954407, + -0.039717883, 0.027856963, -0.0070063695, 0.007142478, -0.004958254, + 0.014233105, 0.033670757, 0.018335817, -0.02804492, -0.015600677, + 0.0031499495, -0.024065355, 0.0024629235, 0.016721955, + -0.0022879262, 0.0064878594, 0.006604524, 0.04352245, -0.050684374, + 0.0024629235, -0.025199596, 0.02790233, 0.012787758, -0.005509171, + -0.014719209, 0.02385147, -0.004932328, 0.011847959, -0.0054702824, + -0.042926166, 0.018873772, 0.036341086, 0.047871456, -0.013157196, + 0.013228492, 0.0053989873, 0.01867933, 0.028414361, -0.037818838, + -0.046212222, 0.016611772, 0.010324835, -0.039542884, 0.03268559, + 0.025588479, -0.035498504, -0.03513555, -0.0043165977, 0.0059499047, + 0.005424913, -0.019178396, -0.06280455, -0.010506313, -0.039763253, + -0.0074341404, 0.0057295375, 0.042854868, 0.018880254, -0.007310994, + 0.0327504, -0.023067223, -0.015600677, 0.014894205, -0.015983077, + 0.027131047, 0.0049647354, -0.011958141, -0.013183122, 0.006960999, + -0.058941647, 0.038071614, 0.015516418, -0.06952573, 0.054495424, + -0.003778643, -0.015179386, 0.0267292, -0.01641733, 0.04549927, + 0.027228266, -0.013422933, 0.0068767415, 0.0048351074, 0.0075637675, + -0.022503344, 0.0068184095, 0.015224756, -0.032717995, -0.027351415, + -0.01595715, 0.0047314055, 0.02521256, 0.033087432, -0.016683066, + -0.00031110612, 0.020785777, 0.059492562, -0.020403376, + -0.038486417, 0.033625387, -0.042226177, -0.024032949, -0.044416882, + -0.0011796107, 0.020766335, -0.0061897156, 0.023592213, + -0.0055804662, 0.0041416003, -0.031830046, 0.060205515, -0.05368525, + -0.0046277037, -0.0109146405, -0.040631756, 0.014090515, + -0.03293836, -0.016533993, 0.0020481155, -0.0076156184, + -0.0033249469, -0.011050749, 0.02821992, -0.052797303, -0.026411613, + -0.022030203, -0.0120423995, -0.024305167, 0.032316152, + 0.0032147632, -0.018808957, -0.057327785, -0.016339552, -0.5266703, + 0.0148164295, 0.013397008, -0.013947925, 0.068773896, 0.02880324, + -0.056407433, -0.049057547, 0.028336585, -0.012722944, -0.026469946, + -0.0066823, -0.025847733, 0.00931374, -0.0016981208, 0.042621538, + 0.05301767, -0.023339441, 0.0072785867, -0.011958141, -0.05072326, + 0.02134966, 0.027980108, 0.005800833, -0.014284956, 0.020882998, + -0.037818838, -0.0012573872, 0.0034740183, -0.018925622, + -0.08952727, -0.020545967, -0.012411838, 0.029768968, -0.03866142, + 0.033281874, 0.007498954, 0.0067471145, 0.04041139, 0.040566944, + -0.0043360414, -0.026366243, -0.011614629, 0.025387555, 0.018510815, + -0.029328233, 0.007356364, 0.015775673, -0.018329335, 0.0134294145, + -0.020818185, 0.0025536628, -0.023352403, -0.042271543, 0.034850366, + 0.031402275, -0.008944301, 0.007712839, -0.0109081585, -0.032030966, + 0.013072939, 0.039322518, 0.003311984, 0.01735713, 0.036768854, + -0.031784676, -0.0821385, 0.0012833127, 0.022898708, -0.00058332394, + 0.040949345, 0.06251288, -0.0040573427, 0.030339329, 0.016734917, + -0.02187465, 0.028893983, -0.0639712, -0.004932328, -0.05363988, + -0.013202567, -0.08604029, -0.013422933, 0.020857073, -0.02982082, + -0.002780511, 0.0313245, -0.031972636, 0.017823787, 0.018335817, + -0.013649781, 0.0057619447, 0.008976708, -0.01735065, -0.025076449, + 0.0066369306, -0.022282977, 0.03600405, 0.05933053, -0.0054638013, + -0.0038953077, 0.0067730392, 0.030352293, 0.04864922, -0.029866187, + 0.008555418, -0.015542344, 0.00014259032, 0.03542721, 0.029269902, + -0.020740408, -0.005321211, -0.028531026, 0.0011472038, -0.03497999, + 0.00058980536, 0.0020481155, 0.022483898, 0.034467965, -0.018620998, + 0.041565076, 0.000978688, 0.037241995, -0.030015262, 0.013584967, + 0.021414472, 0.019048769, -0.008043389, 0.043652076, -0.016864544, + 0.106294595, -0.013986813, 0.020708002, -0.014615507, -0.028686577, + -0.042880796, -0.024966266, -0.013085901, 0.022010759, 0.017551571, + 0.0266255, -0.042407654, 0.015451604, 0.072863646, -0.014388657, + 0.0135460785, 0.0051267697, 0.020345045, 0.0078035784, -0.05250564, + 0.034111492, -0.07254606, 0.013338676, -0.0032666142, -0.016871026, + 0.012483133, 0.039212335, -0.08336996, 0.01086927, 0.029982852, + 0.0541195, -0.0033573536, 0.061786972, -0.008354496, 0.016948802, + 0.0044915946, 0.07134052, -0.002061078, 0.056990754, -0.01693584, + 0.020526523, 0.079727426, 0.026269022, -0.0011536853, 0.02305426, + 0.015419197, -0.003124024, -0.0075767306, 0.02381258, 0.01952839, + 0.020008013, -0.023397774, 0.02135614, 0.010947047, 0.026094027, + 0.013850704, -0.010616496, 0.006202678, 0.006591561, -0.02983378, + -0.024188502, -0.005885091, -0.006131383, -0.009475774, 0.018549703, + -0.004977698, -0.03251707, 0.035978127, 0.028654171, 0.041053046, + 0.038123462, 0.02432461, -0.015730303, -1.9444133e-5, 0.009799843, + -0.0071554407, -0.015892338, 0.041416004, 0.004925847, 0.017344166, + -0.01985246, -0.07217662, 0.0030138404, 0.039400294, 0.0063063805, + -0.03166153, -0.0071943286, -0.0023916285, 0.031830046, + 0.0074082147, -0.01495902, 0.004809182, -0.012794239, 0.093824424, + -0.07693396, 0.043347456, -0.05726945, -0.020014493, -0.029243976, + 0.02413017, -0.02530978, 0.030462474, -0.01547753, 0.04019102, + -0.010979454, -0.014952539, -0.013844223, -0.005710094, 0.01820619, + -0.04529835, 0.00936559, -0.02991804, 0.00564528, -0.040385462, + -0.031253204, 0.0035064255, -0.03284762, -0.0063323057, 0.019521909, + 0.051118627, 0.007129515, -0.009825769, 0.013254417, 0.0068637785, + -0.011685924, -0.02597736, -0.0013481266, 0.02465516, 0.008367458, + -0.01900988, 0.035731833, 0.005431394, 0.02028023, -0.00093331834, + 0.0024953305, -0.030637473, -0.016812693, -0.07578675, 0.046607587, + 0.015885856, 0.037831802, -0.018964512, -0.033599462, -0.005632317, + -0.002262001, -0.036548488, -0.05151399, -0.018867292, 0.008717453, + -0.0008879488, 0.06401008, -0.00020740408, -0.013260898, + -0.00014907168, 0.027215306, -0.009702622, 0.015399754, 0.011109081, + -0.017804345, -0.0013934962, 0.046918694, 0.039154, 0.014498841, + -0.034610555, 0.0033573536, -0.043891888, 0.017700642, 0.012729425, + -0.0057943515, -0.04294561, 0.0020999664, -0.019599685, -0.01068131, + -0.022976482, 0.013643299, 0.006060088, 0.0070452574, 0.00073887705, + 0.027824553, -0.033100393, 0.034429077, 0.069435, 0.002061078, + -0.010979454, -0.028621763, -0.003227726, -0.014790503, 0.010571127, + -0.052797303, -0.12194064, 0.024557939, -0.028381951, 0.0019508946, + -0.042362284, 0.047404796, -0.020980218, -0.0071619223, 0.010733161, + 0.00837394, -0.033787422, -0.014647913, -0.017940454, -0.038486417, + -0.016916396, 0.0007129515, -0.008944301, -0.022004277, + -0.010849826, -0.05809259, -0.004277709, -0.012321099, -0.06377028, + 0.03492166, 0.021304287, 0.040677123, + ], + }, + { + title: "Hills", + query: "photo of mountains or hills", + minScore: 0.2, + showVideo: true, + textEmbedding: [ + 0.020085756, 0.022995783, 0.01930537, 0.011414018, 0.013222759, + -0.004777113, 0.0046385406, 0.001684753, 0.053211935, 0.024593016, + 0.0017430993, -0.03710103, 0.030733977, -0.022033067, 0.017905058, + 0.55763865, -0.01830619, 7.2933026e-6, 0.015527441, -0.013266518, + -0.02212788, 0.0019473118, -0.03455567, -0.009794906, 0.0030996536, + -0.022310212, -0.022601943, 0.0072568366, -0.016847529, 0.0481358, + 0.04608638, -0.0040915427, -0.036094554, 0.025074374, -0.01258824, + 0.033009488, -0.011523418, -0.0044051544, -0.008576924, + -0.022405026, 0.039989177, 0.018824015, -0.015753534, -0.034015965, + -0.0068848776, -0.012814333, -0.035693422, -0.024636777, + 0.029836902, -0.025563026, 0.0007147436, 0.020836966, -0.03551838, + 0.03173316, -0.005083432, -0.00560855, -0.012960199, -0.008905123, + 0.0091312155, 0.037925176, 0.00010210624, 0.014484499, 0.0044416212, + -0.013259225, 0.027882297, 0.040229857, -0.03148519, -0.015410749, + 0.048332717, 0.018036338, 0.019932596, 0.06964374, -0.0011231686, + -0.020501474, 0.013499903, 0.00014586606, -0.06148254, 0.015425335, + 0.041608293, 0.039551582, 0.0029100277, 0.0031288266, 0.02645281, + -0.00644728, -0.011166046, -0.049368367, -0.013084185, -0.01258824, + -0.016191132, 0.008350831, 0.046932403, 0.03791788, -0.008146619, + 0.0033913855, -0.0022755102, 0.022003895, 0.018539574, 0.052592, + -0.020012822, 0.001976485, -0.0065420927, -0.002625589, 0.0251546, + -0.06844765, 0.018597921, 0.012004776, -0.07617125, 0.026715368, + 0.025511973, -0.005061552, 0.001662873, -0.045335166, 0.012391321, + -0.0109253675, 0.021755923, -0.015717067, 0.007774661, 0.0122746285, + -0.011311912, -0.0040186094, -0.00472606, -0.04054347, 0.024461737, + -0.0031652933, -0.013069599, 0.00013127945, 0.102376096, + -0.055509325, 0.009174975, -0.0010575289, 0.0133759165, + -0.021894494, -0.010801381, -0.0005105312, 0.013178998, + -0.0062211873, -0.03951511, 0.009488587, -0.050068524, -0.008810309, + 0.009306254, 0.0073881154, 0.0036758247, 0.009145801, 0.009109335, + -0.055655196, 0.002049418, -0.018933414, -0.01413442, + -0.00037195845, -0.04357019, 0.00238491, 0.022536304, 0.02457843, + 0.009853251, -0.04352643, 0.014520965, 0.016526623, -0.023484435, + -0.009226028, -0.003515372, 0.031507067, 0.028604334, -0.02230292, + -0.039471354, -0.042738754, -0.037881415, -0.5623866, 0.022383146, + -0.026489275, -0.005688776, 0.08086814, -0.0054408037, -0.021668402, + -0.005645016, -0.015177363, -0.013893741, -0.01534511, -0.030551644, + -0.040069405, -0.0073224762, -0.0053168177, -0.034774467, + 0.021063058, -0.026007917, 0.02034102, -0.017664379, -0.006162841, + 0.02097554, 0.016417224, -0.038238786, -0.006316, -0.02627777, + -0.0813495, -0.005783589, -0.02592769, 0.0005032379, -0.0567346, + 0.012500721, 0.017153848, -0.01035649, -0.0148054045, 0.039289024, + 0.0024870161, 0.009182268, 0.019385599, 0.01903552, 0.011187926, + -0.032710463, 0.008204965, 0.028808545, -0.0016993396, 0.030281793, + -0.008540457, -0.016657902, -0.012092296, 0.020742152, -0.014499086, + -0.0016993396, -0.019378304, 0.025234828, 0.014338633, 0.034701534, + 0.0016920463, -0.010283557, 0.029253436, 0.03559861, -0.015016911, + -0.042585593, -0.10697816, -0.04332951, 0.00068557047, 0.018845895, + -0.070176154, -0.0068994644, -0.09547663, -0.0364811, -0.011516125, + 0.035861168, 0.0062576532, 0.021836147, 0.010261677, -0.05277434, + -0.012019362, -0.01183703, 0.046830297, -0.03769179, -0.03413995, + -0.09999117, 0.012777866, -0.0005178245, -0.0024943093, + -0.034417093, 0.007789247, -0.02926073, -0.0102325035, 0.018656267, + 0.0035883049, 0.022740517, 0.008234139, -0.026423635, -0.021427725, + 0.009692799, 0.029975474, -0.016074438, 0.017365353, -0.019123038, + -0.006439986, 0.015403455, -0.013222759, 0.011114993, 0.027437406, + 0.012427788, 0.016067147, 0.0063451733, 0.063641354, 0.03654674, + 0.01879484, 0.03968286, -0.026263181, 0.010268969, -0.018029043, + 0.021901788, -0.028093802, 0.010575289, 0.0008970762, -0.0022098708, + 0.015257589, 0.026372582, 0.00781842, 0.0033840926, -0.012216282, + 0.010983714, -0.018670855, -0.012697641, -0.019159507, 0.0055574966, + 0.041972958, 0.0055210297, 0.002961081, -0.02345526, 0.019961769, + 0.0208005, 0.0055210297, 0.011676578, 0.009401067, -0.01316441, + -0.018225962, -0.00242867, -0.009153095, 0.10668643, -0.0030923602, + -0.00940836, 0.0028298015, 0.033133473, 0.038246077, -0.0537954, + -0.0039237966, -0.016687077, 0.017037155, -0.0012106881, + -0.018780256, -0.0005907575, 0.046757363, -0.05332863, 0.021194337, + -0.044284936, 0.040047526, 0.015476389, -0.013930209, -0.019086573, + 0.024877455, -0.023156237, 0.047800303, -0.020567114, 0.018138442, + -0.035671543, -0.015841054, 0.014878337, 0.007249543, 0.013966675, + 0.0070161573, -0.009379188, 0.0036831177, -0.006782771, 0.01821867, + 0.02239044, 0.030945482, -0.020902606, -0.0072203698, 0.0013638476, + -0.024024138, 0.0011596351, -0.035277706, 0.014623072, -0.02981502, + -0.025511973, 0.05313171, 0.0173143, 0.028451173, 0.050491538, + -0.004711474, -0.01806551, -0.031040296, -0.03389927, -0.019801317, + -0.010743035, -0.00065639726, -0.021653816, 0.030879842, + -0.017868591, 0.0014149008, -0.011078526, -0.016008798, 0.03063187, + -0.012325682, 0.015666014, 0.008832189, -0.090925604, 0.0021734042, + -0.015126309, 0.011705751, -0.017321594, 0.0017285127, + 0.00019691917, -0.014396979, 0.0023703235, -0.026576793, + -0.0042228224, 0.0009189562, -0.07509914, 0.008380005, -0.0139375, + 0.0012909146, 0.0020567114, -0.01942936, -0.010268969, + -0.0022025772, 0.0010648222, -0.013499903, 0.0117422175, + -0.011034767, 7.2933026e-6, 0.026343409, 0.026846647, 0.020027408, + -0.049470473, 0.019990943, -0.0018597922, 0.008671737, -0.04440892, + -0.064574905, -0.013543664, -0.020691099, -0.004244702, + -0.012318389, 0.015841054, 0.0017868591, -0.0004959446, 0.011844324, + 0.013507197, -0.0019400185, -0.07307889, 0.020253502, -0.03182797, + -0.030515177, -0.008066393, 0.01636617, -0.028451173, 0.038895182, + 0.020122223, -0.0075996215, -0.010808675, 0.012566361, + -0.0017868591, 0.017438287, -0.020836966, 0.033439793, -0.009860545, + -0.02696334, -0.0075266883, 0.004361395, 0.021799682, 0.013354036, + 0.036772832, 0.006323293, 0.020370195, -0.07023451, 0.027065445, + -0.006264947, -0.049601752, 0.0049959123, -0.013076892, -0.02799899, + -0.004959446, -0.0074756355, 0.009889718, 0.07115346, 0.010152278, + -0.013798929, -0.004594781, -0.009379188, 0.012296508, 0.014010434, + 0.007125557, 0.059010115, 0.011567178, 0.0019473118, 0.0128435055, + -0.013003958, -0.0022828039, 0.05829537, -0.042366795, 0.007935113, + -0.053824574, 0.021901788, -0.0014076075, -0.019108452, + -0.004047783, 0.010837848, -0.014520965, -0.0011669284, + -0.0054335105, 0.018700028, 0.01035649, 0.016971515, -0.0676235, + -0.013018546, 0.008423764, -0.011465072, -0.015272176, + -0.0016701663, -0.011348379, 0.0039821435, -0.007876767, + -0.009328133, -0.035831995, -0.022930143, -0.0023776167, + -0.0005907575, -0.012704934, 0.008606098, -0.021763215, -0.02034102, + 0.017875886, -0.005995095, 0.016220305, -0.023907445, -0.0023922033, + -0.013550956, 0.016074438, 0.036313355, + ], + }, + { + title: "Greenery", + query: "outdoor photo of trees, leaves, flowers", + minScore: 0.2, + showVideo: true, + textEmbedding: [ + -0.007156132, -0.01483226, 0.0016425262, -0.0041434583, + 0.0028806115, 0.0021790299, -0.0032767986, 0.014353533, 0.02069253, + -0.05503701, -0.0010482455, 0.011753554, 0.06092204, 0.004613931, + 0.012496406, 0.49475536, -0.032041643, -0.0028558497, 0.031637203, + -0.016020821, -0.01912429, -0.027213112, -0.0074285106, + -0.043093614, -0.0060253474, -0.014312264, -0.025884233, + -0.008567549, -0.011307844, 0.018959211, -0.001411417, + -0.0012380852, 0.0058602695, -0.008121839, 0.0022120455, + 0.0027898184, 0.03533495, 0.0071808943, 0.0017993505, 0.019751586, + 0.021129988, -0.012323074, 0.0057529686, -0.044612333, 0.022607435, + -0.0024761704, -0.0050101182, 0.00935167, -0.008303424, + -0.0023110923, 0.035681613, 0.026585815, 0.005719953, -0.0041104425, + -0.019603014, 0.006751691, -0.040006656, -0.0006768199, + -0.024448056, 0.04070824, 0.02441504, -0.0032767986, -0.008749135, + -0.039148252, 0.019685555, 0.007255179, -0.020717291, -0.007445019, + 0.0030126737, 0.017696364, 0.05585415, -0.0048202784, 0.0039536185, + -0.030663243, 0.024134407, 0.0136602055, -0.1504686, 0.010086267, + 0.00266601, -0.04824405, -0.040988874, 0.0027320413, 0.020981416, + 0.0074202567, -0.0038463178, 0.02020555, -0.015789712, 0.0027733108, + -0.021105224, 0.018397946, 0.05896587, 0.012801801, -0.01747351, + 0.020238565, 0.009624049, 0.021633474, -0.14422867, 0.0062151873, + -0.041211728, 0.01747351, -0.012983386, 0.007981523, -0.0022202993, + -0.08149902, -0.012174504, 0.0051586884, -0.04341552, -0.0069580385, + -0.0065453434, -0.0015764951, 0.008798659, -0.040931094, -0.1643847, + 0.013907823, 0.003598701, 0.034435276, -0.008773897, -0.007898984, + 0.020956654, 0.016070344, -0.009739603, -0.0008006284, 0.00897199, + -0.01637574, -0.037992705, 0.018785879, 0.08574152, 0.007015816, + 0.019008733, 0.0040196497, -0.0010647532, 0.03245434, -0.04447202, + -0.016029077, 0.046386924, 0.027097557, -0.0012628469, 0.031397842, + 0.011118005, 0.011959903, 0.012091965, 0.001411417, 0.024084883, + 0.030423878, 0.0011142766, -0.00014031632, -0.0067104213, + -0.0011060227, -0.03654002, 0.049374834, 0.012281804, 0.007197402, + 0.052734174, -0.014749722, 0.0006768199, 0.0041434583, 0.025083605, + -0.029548965, -0.013635444, 0.009491987, 0.07705017, 0.005885031, + 0.0018158582, 0.021534426, -0.07587811, 0.077892065, -0.020898879, + -0.49878326, 0.02576868, -0.025182651, -0.0033015604, 0.06256457, + -0.005340274, 0.030168008, -0.012686246, -0.023655681, -0.022549657, + -0.008584057, 0.02725438, 0.028327389, 0.020552212, 0.040122215, + 0.0161859, 0.011687524, -0.0055053523, 0.002996166, -0.008798659, + 0.007981523, 0.03664732, -0.004878056, 0.0059758243, -0.026263913, + 0.068342306, -0.012248789, -0.01070531, -0.020618245, 0.030729273, + -0.0508853, 0.052527826, 0.017993504, 0.03138133, -0.048929125, + 0.041640934, -0.019099526, -0.022062676, -0.005076149, 0.012554184, + 0.009525002, -0.021237286, 0.017490016, 0.048103735, 0.0060253474, + 0.03127403, 0.0103338845, -0.016986528, 0.05153736, 0.10163853, + -0.03116673, 0.00072634325, -0.005530114, -0.008707866, 0.031389583, + 0.016532563, 0.01961127, -0.02354838, -0.002344108, -0.009624049, + -0.046543747, -0.0030291816, -0.11197242, -0.0019644285, 0.03652351, + -0.033188935, 0.03323846, 0.0069910544, -0.012851324, -0.014658929, + 0.011687524, -0.018934447, 0.015682412, -0.0070570856, -0.017712872, + -0.0020304597, -0.03505432, 0.04561931, -0.0029879122, -0.02274775, + -0.079873, -0.14792642, -0.05039832, 0.0027402951, -0.013354812, + 0.015682412, 0.020527452, -0.0041847276, -0.031554665, 0.011737047, + -0.086418346, 0.0014774483, 0.014386549, 0.026239151, -0.025537571, + 0.009888174, -0.008064061, 0.004498376, -0.021806806, -0.010267853, + 0.0031282285, 0.016053837, -0.01802652, -0.009962458, 0.010573247, + 0.023820758, -0.016062092, -0.0025834711, 0.042441558, 0.011604984, + -0.014898291, 0.028046755, -0.053410996, -0.014039885, -0.025034081, + -0.0015930028, 0.019371906, -0.014782737, 0.008064061, -0.03370068, + -0.008245647, 0.052808456, -0.010573247, -0.03406385, -0.031117208, + 0.109141335, -0.006759945, -0.012091965, -0.0025504555, -0.0355413, + -0.023350285, 0.05615954, 0.0042837746, 0.014328773, -0.029301347, + -0.016425263, -0.0052329735, 0.012892594, 0.007403749, 0.004671708, + 0.008039299, 0.00878215, -0.018084297, 0.066237554, -0.0022037916, + 0.011770062, -0.002344108, 0.017754141, 0.010465947, -0.028005486, + 0.0054640826, 0.0233833, -0.012438629, 0.081771396, 0.022186486, + -0.04242505, 0.03782763, -0.07913015, 0.007081847, 0.028682305, + -0.023507109, 0.034988288, -0.022136962, -0.005579637, 0.004646946, + -0.0242252, 0.015500827, -0.0072799404, 0.016590342, 0.027559776, + 0.016499547, -0.011976411, -0.0848501, -0.018686833, -0.010862134, + 0.002979658, -0.019338889, -0.0014361787, -0.023895044, + -0.027163588, 0.016400501, 0.06977848, -0.008352947, 0.0015682412, + 0.010482455, -0.019107781, 0.053138614, -0.005736461, -0.038199052, + 0.06096331, 0.053221155, -0.008740881, -0.0403038, -0.0022368073, + -0.006900261, -0.040254276, 0.01100245, 0.010688801, -0.0033263222, + -0.0025999788, -0.02467091, -0.023556633, 0.008130093, 0.052882746, + -0.019726822, 0.012752278, 0.007445019, 0.0031199746, 0.023564888, + -0.005356782, 0.035739392, 0.020453166, -0.036168594, 0.006446297, + 0.016565578, -0.01453512, -0.038669527, 0.013264019, -0.0073789875, + -0.0015187177, 0.004192982, 0.014741467, -0.010408169, -0.030919112, + -0.053881466, -4.9523405e-5, -0.011753554, 0.007395495, + -0.023663934, -0.020477928, -0.045487247, 0.020230312, 0.009665318, + 0.00039618724, 0.05012594, -0.029152777, -0.01074658, -0.06847437, + 0.010845627, -0.011547208, -0.0008914213, -0.002509186, -0.03701049, + 0.035962246, -0.0059345546, -0.0015022099, -0.01889318, + -0.008410726, -0.0030374355, -0.016499547, -0.011737047, + 0.009104053, -0.00052824966, 0.06893658, -0.05145482, 0.026263913, + 0.04291203, 0.07261782, -0.00014857022, 0.0032933066, -0.008641834, + 0.0005695192, -0.0022285532, 0.008097077, 0.03805874, -0.0139986165, + 0.011794825, -0.015872251, 0.017052561, -0.041319028, 0.057645246, + -0.025908995, -0.028236596, -0.043242186, -0.013808776, -0.0138583, + -0.008641834, -0.031686727, 0.008468502, 0.008518025, 0.022632197, + 0.031554665, -0.004267267, -0.03546701, -0.045751374, -0.054417968, + 0.010185314, 0.009450716, -0.008220885, -0.00070983544, -0.06394297, + 0.0075935894, -0.013594175, -0.005406305, -0.016152885, 0.012422121, + 0.05346877, 0.02166649, 0.005431067, 0.004770755, 0.02445631, + 0.0012133234, 0.003937111, -0.00054475747, 0.010251345, 0.020172535, + 0.0040279035, -0.04656851, -0.012224028, 0.01836493, -0.029623251, + -0.00047872626, -0.027411206, -0.00184062, 0.0011307844, 0.03762128, + 0.00024761702, 0.01772938, 0.02786517, -0.12921482, 0.037456203, + -0.009830396, 0.012644976, -0.0031447362, 0.0035821933, + 0.0043745674, 0.0148652755, -0.010994197, -0.016342724, + -0.021889346, -0.0096818255, 0.023069654, 0.0021872837, 0.019495714, + -0.027328666, 0.000998722, 0.016458279, 0.008229139, -0.027535014, + 0.011695778, 8.2539016e-5, -0.0024431548, 0.020832846, 0.02932611, + 0.10528676, + ], + }, +]; diff --git a/src/clip-keywords.ts b/src/clip-keywords.ts new file mode 100644 index 0000000..f8c3a37 --- /dev/null +++ b/src/clip-keywords.ts @@ -0,0 +1,57 @@ +// Keywords for a file from its CLIP embedding. +// +// Ente stores no keywords. A file's ML data holds a CLIP embedding, the 512 +// numbers Ente's image model gave the photo, and Ente's photos app sorts files +// into the categories of its Discover section with it: a file falls in a +// category when the cosine similarity of its CLIP embedding and the text +// embedding of the category's query is at least the category's `minScore`, +// unless the file is a video and the category leaves out videos. A file's +// keywords are the titles of the categories it falls in. The categories and +// their text embeddings are in `clip-keyword-vectors.ts`. + +import { DISCOVER_CATEGORIES } from "./clip-keyword-vectors.js"; +import { clipEmbedding } from "./library/mldata.js"; +import type { MLData } from "./mldata-fetch.js"; + +// How many numbers a CLIP embedding from Ente's image model has. +const EMBEDDING_LENGTH = 512; + +const norm = (vector: number[]): number => Math.hypot(...vector); + +const cosineSimilarity = (a: number[], b: number[]): number => { + let dot = 0; + a.forEach((value, i) => { + dot += value * (b[i] ?? 0); + }); + return dot / (norm(a) * norm(b)); +}; + +// The titles of the Discover categories a file falls in, highest score first, +// or undefined when its ML data has no CLIP embedding of 512 finite numbers +// that are not all zero. Tests pass their own `categories`. +export const clipKeywords = ( + mlData: MLData, + isVideo: boolean, + categories = DISCOVER_CATEGORIES, +): string[] | undefined => { + const embedding = clipEmbedding(mlData); + if ( + !embedding || + embedding.length !== EMBEDDING_LENGTH || + norm(embedding) === 0 + ) { + return undefined; + } + + const matches: { title: string; score: number }[] = []; + for (const category of categories) { + if (isVideo && !category.showVideo) continue; + const score = cosineSimilarity(embedding, category.textEmbedding); + if (score >= category.minScore) { + matches.push({ title: category.title, score }); + } + } + return matches + .sort((a, b) => b.score - a.score) + .map((match) => match.title); +}; diff --git a/src/library/mldata.ts b/src/library/mldata.ts index 06307d8..fcc624a 100644 --- a/src/library/mldata.ts +++ b/src/library/mldata.ts @@ -61,7 +61,7 @@ export interface MLIndex { // Pull the CLIP embedding out of a payload, or undefined when it is absent or // misshapen. Kept strict so a bad payload is skipped rather than corrupting the // packed index. -const clipEmbedding = (payload: MLData): number[] | undefined => { +export const clipEmbedding = (payload: MLData): number[] | undefined => { const clip = payload.clip; if (typeof clip !== "object" || clip === null) return undefined; const embedding = (clip as { embedding?: unknown }).embedding; diff --git a/src/metadata-backup.ts b/src/metadata-backup.ts index 35e13e2..fb07840 100644 --- a/src/metadata-backup.ts +++ b/src/metadata-backup.ts @@ -1,6 +1,7 @@ import { mkdirSync, readFileSync, writeFileSync } from "node:fs"; import { join } from "node:path"; import * as jpeg from "jpeg-js"; +import { clipKeywords } from "./clip-keywords.js"; import type { Client } from "./client.js"; import { describeError } from "./errors.js"; import { readExifTags } from "./exif.js"; @@ -97,7 +98,8 @@ const extractExif = async ( // Dump every decrypted metadata layer the account holds into a directory tree // of plain JSON: account, per-collection, and per-file records including the -// private and public magic metadata and (by default) the ML data. Collections +// private and public magic metadata and the ML data, with the keywords of its +// CLIP embedding in place of the embedding (see clip-keywords.ts). Collections // and files are enumerated from the library's cache, which the caller refreshes // first. Returns how many files have no ML data because their ML data request // failed or their ML data did not decrypt, gunzip or parse; they are still @@ -230,8 +232,16 @@ export const runMetadataBackup = async ( if (file.pubMagicMetadata) fileMeta.pubMagicMetadata = file.pubMagicMetadata; + // The ML data without the CLIP embedding, and the keywords that + // embedding gives. const ml = mlDataMap.get(file.id); - if (ml) fileMeta.mlData = ml; + if (ml) { + const { clip: _clip, ...mlDataWithoutClip } = ml; + fileMeta.mlData = mlDataWithoutClip; + const isVideo = file.metadata.fileType === "video"; + const keywords = clipKeywords(ml, isVideo); + if (keywords) fileMeta.keywords = keywords; + } const mlError = mlDataErrors.get(file.id); if (mlError) fileMeta.mlDataError = mlError; diff --git a/test/cli/backup-end-to-end.test.ts b/test/cli/backup-end-to-end.test.ts index 46895e3..8f075f7 100644 --- a/test/cli/backup-end-to-end.test.ts +++ b/test/cli/backup-end-to-end.test.ts @@ -86,10 +86,17 @@ const DAY = "2024/2024-03/2024-03-01"; const TOAST = new TextEncoder().encode("a few seconds of the wedding toast"); // Ente's ML data for beach.jpg: a face it found, and the photo's CLIP -// embedding. +// embedding, here that of a photo of a sunset (see clip-keywords.test.ts). const ML_DATA = { face: { faces: [{ faceID: "100_1", score: 0.98 }] }, - clip: { embedding: [0.5, 0.6, 0.7] }, + clip: { + embedding: JSON.parse( + readFileSync( + new URL("../clip-keywords-sunset.json", import.meta.url), + "utf-8", + ), + ).embedding, + }, }; // Each file's ID, its owner, its original as uploaded, and the metadata its @@ -486,7 +493,10 @@ describe("the first backup of the account", () => { }, updationTime: TAKEN, }); - expect(beach.mlData).toEqual(ML_DATA); + // The JSON holds the ML data without its CLIP embedding, and the + // keywords the embedding gives in its place. + expect(beach.mlData).toEqual({ face: ML_DATA.face }); + expect(beach.keywords).toEqual(["Sunset"]); expect(beach.imageMetadata.exif.Make.description).toBe("Canon"); expect(beach.imageMetadata.exif.Model.description).toBe("EOS R5"); @@ -497,6 +507,7 @@ describe("the first backup of the account", () => { metadata: { title: "toast.mp4", fileType: "video" }, }); expect(toast).not.toHaveProperty("mlData"); + expect(toast).not.toHaveProperty("keywords"); expect(toast).not.toHaveProperty("imageMetadata"); expect(toast).not.toHaveProperty("imageMetadataError"); diff --git a/test/cli/backup.test.ts b/test/cli/backup.test.ts index c6258dd..df203c7 100644 --- a/test/cli/backup.test.ts +++ b/test/cli/backup.test.ts @@ -52,6 +52,7 @@ import { tmpdir } from "node:os"; import { describe, it, expect, beforeEach, afterEach, vi } from "vitest"; import { runBackup, type BackupLibrary } from "../../src/backup.js"; +import { DISCOVER_CATEGORIES } from "../../src/clip-keyword-vectors.js"; import { Library } from "../../src/library/index.js"; import type { ContentSource } from "../../src/library/content.js"; import type { CollectionsPage, FilesPage } from "../../src/client.js"; @@ -946,9 +947,19 @@ describe("the backup lock", () => { }); }); -// Also serves ML data: file 100 has `ML_PAYLOAD`, the other two have none. -// While `mlError` is set, every ML data request fails with it. -const ML_PAYLOAD = { face: { faces: [] }, clip: { embedding: [0.5, 0.25] } }; +// Also serves ML data: file 100 has `ML_PAYLOAD`, whose CLIP embedding is that +// of a photo of a sunset (see clip-keywords.test.ts), and the other two have +// none. While `mlError` is set, every ML data request fails with it. +const SUNSET_EMBEDDING: number[] = JSON.parse( + readFileSync( + new URL("../clip-keywords-sunset.json", import.meta.url), + "utf-8", + ), +).embedding; +const ML_PAYLOAD = { + face: { faces: [] }, + clip: { embedding: SUNSET_EMBEDDING }, +}; class MLClient extends MockClient { mlError?: string; @@ -968,16 +979,99 @@ const fileJSON = (outDir: string, fileID: number): Record<string, unknown> => JSON.parse(readFileSync(saved(outDir, `${fileID}.json`), "utf-8")); describe("ML data in each file's JSON", () => { - it("writes a file's ML data, and no ML field for a file that has none", async () => { + // The JSON holds the ML data without its CLIP embedding, and in its place + // the keywords the embedding gives. + it("writes a file's ML data and keywords, and no ML field for a file that has none", async () => { const lib = await openLibrary(stubSource(), new MLClient()); const outDir = join(root, "backup"); const result = await lib.backup({ downloadDirectory: outDir }); expect(result.failed).toBe(0); - expect(fileJSON(outDir, 100).mlData).toEqual(ML_PAYLOAD); + expect(fileJSON(outDir, 100).mlData).toEqual({ face: { faces: [] } }); + expect(fileJSON(outDir, 100).keywords).toEqual(["Sunset"]); expect(fileJSON(outDir, 101)).not.toHaveProperty("mlData"); expect(fileJSON(outDir, 101)).not.toHaveProperty("mlDataError"); + expect(fileJSON(outDir, 101)).not.toHaveProperty("keywords"); + await lib.close(); + }); + + // A file's ML data can hold faces and no CLIP embedding. Its JSON then has + // the ML data and no keywords. + it("writes no keywords for ML data without a CLIP embedding", async () => { + const faces = { face: { faces: [{ faceID: "101_1", score: 0.9 }] } }; + + // Gives file 101 ML data holding only faces. + class FacesClient extends MockClient { + async fetchMLData(args: { fileIDs: number[] }): Promise<{ + payloads: Map<number, MLData>; + errors: Map<number, unknown>; + }> { + const payloads = new Map<number, MLData>(); + if (args.fileIDs.includes(101)) payloads.set(101, faces); + return { payloads, errors: new Map() }; + } + } + const lib = await openLibrary(stubSource(), new FacesClient()); + const outDir = join(root, "backup"); + + const result = await lib.backup({ downloadDirectory: outDir }); + + expect(result.failed).toBe(0); + expect(fileJSON(outDir, 101).mlData).toEqual(faces); + expect(fileJSON(outDir, 101)).not.toHaveProperty("keywords"); + await lib.close(); + }); + + // Ente's photos app keeps videos out of some Discover categories, Identity + // among them. Here a photo and a video share one CLIP embedding, Identity's + // own text embedding, so the photo gets the keyword Identity and the video + // does not. + it("keeps a video out of a category that leaves out videos", async () => { + const identity = DISCOVER_CATEGORIES.find( + (c) => c.title === "Identity", + )!; + expect(identity.showVideo).toBe(false); + const toast = file(102, 1, "toast.mp4"); + const video = { + ...toast, + metadata: { ...toast.metadata, fileType: "video" as const }, + }; + + // Serves beach.jpg and the video in the Vacation album, and gives + // each ML data holding only that embedding. + class VideoClient extends MockClient { + override async filesSince(args: { + collectionID: number; + }): Promise<FilesPage> { + const files = + args.collectionID === 1 + ? [file(100, 1, "beach.jpg"), video] + : []; + return { files, deleted: [], cursor: 1 }; + } + async fetchMLData(args: { fileIDs: number[] }): Promise<{ + payloads: Map<number, MLData>; + errors: Map<number, unknown>; + }> { + const payloads = new Map<number, MLData>(); + for (const id of args.fileIDs) { + payloads.set(id, { + clip: { embedding: identity.textEmbedding }, + }); + } + return { payloads, errors: new Map() }; + } + } + const lib = await openLibrary(stubSource(), new VideoClient()); + const outDir = join(root, "backup"); + + const result = await lib.backup({ downloadDirectory: outDir }); + + expect(result.failed).toBe(0); + expect(fileJSON(outDir, 100).keywords).toContain("Identity"); + expect(fileJSON(outDir, 102)).toHaveProperty("keywords"); + expect(fileJSON(outDir, 102).keywords).not.toContain("Identity"); await lib.close(); }); @@ -993,7 +1087,7 @@ describe("ML data in each file's JSON", () => { const result = await lib.backup({ downloadDirectory: outDir }); // File 100's ML data was cached by the first run and is kept. - expect(fileJSON(outDir, 100).mlData).toEqual(ML_PAYLOAD); + expect(fileJSON(outDir, 100).mlData).toEqual({ face: { faces: [] } }); expect(fileJSON(outDir, 100)).not.toHaveProperty("mlDataError"); for (const fileID of [101, 200]) { expect(fileJSON(outDir, fileID).mlDataError).toBe( @@ -1026,7 +1120,7 @@ describe("ML data in each file's JSON", () => { expect(result.failed).toBe(0); expect(result.skipped).toBe(3); - expect(fileJSON(outDir, 100).mlData).toEqual(ML_PAYLOAD); + expect(fileJSON(outDir, 100).mlData).toEqual({ face: { faces: [] } }); for (const fileID of [100, 101, 200]) { expect(fileJSON(outDir, fileID)).not.toHaveProperty("mlDataError"); } diff --git a/test/cli/metadata-backup.test.ts b/test/cli/metadata-backup.test.ts index 0b75804..c66c799 100644 --- a/test/cli/metadata-backup.test.ts +++ b/test/cli/metadata-backup.test.ts @@ -41,6 +41,7 @@ import { beforeAll, afterAll, describe, expect, it, vi } from "vitest"; import { init, toBase64, encryptBlob } from "../../src/crypto/index.js"; import * as jpegJs from "jpeg-js"; import { Client } from "../../src/client.js"; +import { DISCOVER_CATEGORIES } from "../../src/clip-keyword-vectors.js"; import { Library } from "../../src/library/index.js"; import { runMetadataBackup, @@ -56,8 +57,8 @@ import { type MetaMockState, } from "../ente-server.js"; -// One file per ML data request, so the two files of the mock account are -// fetched in two requests and one of them can fail on its own. +// One file per ML data request, so each file of the mock account is fetched in +// a request of its own and one of them can fail on its own. vi.mock("../../src/mldata-fetch.js", async (importOriginal) => ({ ...(await importOriginal<typeof import("../../src/mldata-fetch.js")>()), MLDATA_BATCH_SIZE: 1, @@ -66,6 +67,21 @@ vi.mock("../../src/mldata-fetch.js", async (importOriginal) => ({ const TEST_EMAIL = "metabackup@example.com"; const TEST_PASSWORD = "metapass"; +// The CLIP embedding of a photo of a sunset (see clip-keywords.test.ts), which +// the ML data of beach.jpg holds. +const SUNSET_EMBEDDING: number[] = JSON.parse( + readFileSync( + new URL("../clip-keywords-sunset.json", import.meta.url), + "utf-8", + ), +).embedding; + +// Identity, a Discover category of Ente's photos app that leaves out videos. +const IDENTITY = DISCOVER_CATEGORIES.find((c) => c.title === "Identity")!; + +// ML data holding faces and no CLIP embedding, which file 302 has. +const FACES_ONLY = { face: { faces: [{ faceID: "face-def", score: 0.9 }] } }; + let mock: MetaMockState; let testDir: string; @@ -204,6 +220,65 @@ const buildMetaMock = async (): Promise<MetaMockState> => { updationTime: 1710000000000000, }; + // A file in coll 10 with the ML data given. `fileType` is Ente's number: 0 + // an image, 1 a video. + const vacationFile = ( + id: number, + title: string, + fileType: number, + mlData: object, + ) => { + const fileKey = sodium.crypto_secretstream_xchacha20poly1305_keygen(); + const { ciphertext: encKey, nonce } = encryptSecretbox(fileKey, ck1); + const meta = encryptStreamBlob( + new TextEncoder().encode( + JSON.stringify({ + title, + fileType, + creationTime: 1700000000000000, + modificationTime: 1700000000000000, + }), + ), + fileKey, + ); + const ml = encryptBlob( + new Uint8Array(gzipSync(Buffer.from(JSON.stringify(mlData)))), + fileKey, + ); + return { + raw: { + id, + collectionID: 10, + ownerID: 42, + encryptedKey: toBase64(encKey), + keyDecryptionNonce: toBase64(nonce), + metadata: { + encryptedData: toBase64(meta.ciphertext), + decryptionHeader: toBase64(meta.header), + }, + file: { + decryptionHeader: toBase64(sodium.randombytes_buf(24)), + }, + thumbnail: { + decryptionHeader: toBase64(sodium.randombytes_buf(24)), + }, + updationTime: 1700000000000000, + }, + mlData: { + encryptedData: toBase64(ml.ciphertext), + decryptionHeader: toBase64(ml.header), + }, + }; + }; + // Files 300 and 301 in coll 10: a photo and a video whose ML data holds + // only a CLIP embedding, Identity's own text embedding. + const identityML = { clip: { embedding: IDENTITY.textEmbedding } }; + const identityPhoto = vacationFile(300, "passport.jpg", 0, identityML); + const identityVideo = vacationFile(301, "passport.mp4", 1, identityML); + // File 302 in coll 10: a photo whose ML data holds faces and no CLIP + // embedding. + const facesPhoto = vacationFile(302, "party.jpg", 0, FACES_ONLY); + // Encrypt ML data for file 100 (gzipped JSON, encrypted with file key) const mlPayload = JSON.stringify({ face: { @@ -230,7 +305,7 @@ const buildMetaMock = async (): Promise<MetaMockState> => { clip: { version: 1, client: "test", - embedding: [0.5, 0.6, 0.7], + embedding: SUNSET_EMBEDDING, }, }); const gzipped = gzipSync(Buffer.from(mlPayload)); @@ -270,12 +345,23 @@ const buildMetaMock = async (): Promise<MetaMockState> => { keyAttributes: account.keyAttributes, encryptedToken: account.encryptedToken, collections: [rawColl1, rawColl2], - filesByCollection: { 10: [rawFile1], 20: [rawFile2] }, + filesByCollection: { + 10: [ + rawFile1, + identityPhoto.raw, + identityVideo.raw, + facesPhoto.raw, + ], + 20: [rawFile2], + }, encryptedMLData: { 100: { encryptedData: toBase64(mlCiphertext), decryptionHeader: toBase64(mlHeader), }, + 300: identityPhoto.mlData, + 301: identityVideo.mlData, + 302: facesPhoto.mlData, }, fileCiphertexts: { 100: encFileBody1 }, }; @@ -432,7 +518,9 @@ describe("quak backup-metadata", () => { expect(account.email).toBe(TEST_EMAIL); }); - it("fetches and decrypts ML data by default", async () => { + // The CLIP embedding is left out of the ML data, and the keywords it gives + // are written in its place. + it("fetches and decrypts ML data by default, with keywords for the CLIP embedding", async () => { const outDir = join(testDir, "ml-data"); await runBackup(outDir); @@ -452,8 +540,41 @@ describe("quak backup-metadata", () => { expect(fileMeta.mlData.face.faces[0].faceID).toBe("face-abc"); expect(fileMeta.mlData.face.faces[0].score).toBeCloseTo(0.98); expect(fileMeta.mlData.face.faces[0].detection.box.x).toBeCloseTo(0.1); - expect(fileMeta.mlData.clip).toBeDefined(); - expect(fileMeta.mlData.clip.embedding).toEqual([0.5, 0.6, 0.7]); + expect(fileMeta.mlData).not.toHaveProperty("clip"); + expect(fileMeta.keywords).toEqual(["Sunset"]); + }); + + // Ente's photos app keeps videos out of some Discover categories, Identity + // among them. Files 300 and 301, a photo and a video, share one CLIP + // embedding, Identity's own text embedding, so the photo gets the keyword + // Identity and the video does not. + it("keeps a video out of a category that leaves out videos", async () => { + expect(IDENTITY.showVideo).toBe(false); + const outDir = join(testDir, "video-keywords"); + await runBackup(outDir); + + const vacation = join(outDir, "collections", "10-Vacation"); + const fileJSON = (fileID: number) => + JSON.parse(readFileSync(join(vacation, `${fileID}.json`), "utf-8")); + expect(fileJSON(300).keywords).toContain("Identity"); + expect(fileJSON(301)).toHaveProperty("keywords"); + expect(fileJSON(301).keywords).not.toContain("Identity"); + }); + + // A file's ML data can hold faces and no CLIP embedding. File 302's JSON + // then has the ML data and no keywords. + it("writes no keywords for ML data without a CLIP embedding", async () => { + const outDir = join(testDir, "no-clip"); + await runBackup(outDir); + + const fileMeta = JSON.parse( + readFileSync( + join(outDir, "collections", "10-Vacation", "302.json"), + "utf-8", + ), + ); + expect(fileMeta.mlData).toEqual(FACES_ONLY); + expect(fileMeta).not.toHaveProperty("keywords"); }); it("extracts EXIF from downloaded files when --exif is set", async () => { @@ -541,7 +662,7 @@ describe("quak backup-metadata when a file's ML data cannot be read", () => { "utf-8", ), ); - expect(ok.mlData.clip.embedding).toEqual([0.5, 0.6, 0.7]); + expect(ok.keywords).toEqual(["Sunset"]); expect(ok.mlDataError).toBeUndefined(); const failed = JSON.parse( @@ -599,7 +720,7 @@ describe("quak backup-metadata when a file's ML data cannot be read", () => { "utf-8", ), ); - expect(ok.mlData.clip.embedding).toEqual([0.5, 0.6, 0.7]); + expect(ok.keywords).toEqual(["Sunset"]); }); it("exits 0 when every ML data request succeeds", async () => { diff --git a/test/clip-keywords-sunset.json b/test/clip-keywords-sunset.json new file mode 100644 index 0000000..499071f --- /dev/null +++ b/test/clip-keywords-sunset.json @@ -0,0 +1,109 @@ +{ + "photo": "https://upload.wikimedia.org/wikipedia/commons/d/db/Sunset_off_the_Massachusetts_coast_-_NOAA.jpg", + "sha256": "be62f3289c9bf7b75af68cd6978021d54e8a531d5d4cc493f6e9fbf5e1ab74d3", + "embedding": [ + -0.0021123015, -0.04437615, -0.062354308, 0.006249992, 0.022141185, + 0.011159019, 0.01227392, -0.00030532264, 0.03186437, 0.09196922, + 0.039111234, -0.037084445, -0.032962628, -0.019820206, -0.013141825, + 0.0047183544, 0.017137334, 0.046581306, 0.0047622235, 0.04982521, + 0.023128154, 0.032080866, 0.037709303, 0.019241406, 0.0032100384, + -0.014275843, 0.049337693, 0.025953151, 0.014263995, -0.0062328726, + -0.040504098, -0.015083303, -0.008123875, -0.006233639, -0.05352683, + -0.0048083956, 0.0763486, -0.013155067, 0.025114346, 0.022016674, + 0.0001588023, -0.010341572, -0.0037518279, -0.019181008, 0.04549337, + -0.0010725886, 0.004636866, 0.017177915, -0.0117317885, 0.0026097358, + 0.030738998, 0.013158572, -0.08856403, -0.0121391015, 0.011477229, + -0.0033104012, 0.035524756, -0.018607879, -0.0071739843, -0.031906743, + 0.0056713386, -0.0044195866, 0.00292471, 0.00061686034, -0.043075223, + 0.09040427, 0.001522537, -0.011445652, 0.009609886, -0.0053201183, + -0.0057452377, 0.00972853, -0.0024397348, -0.021255083, 0.015893811, + -0.006020548, -0.09428023, 0.014277583, -0.017975299, -0.011878315, + 0.011825521, 0.00014203975, -0.0020437292, -0.05305343, -0.024840152, + -0.011336872, -0.002796541, -0.00036171873, 0.004530499, 0.044486605, + 0.021602718, -0.01292857, 0.024530916, 0.019559948, -0.039928272, + -0.0681174, 0.049101, 0.02461532, 0.0365531, -0.04070358, -0.011011939, + -0.0027188526, -0.020370876, 0.012904856, 0.043157287, -0.051658224, + -0.3726012, 0.019549074, -0.0499252, -0.04800559, -0.011493859, + 0.02893256, 0.060341954, 0.0013929688, -0.051283866, -0.024286803, + 0.044124287, -0.005995806, -0.062817656, 0.007369614, -0.021470634, + -0.028147545, 0.00411659, 0.04234773, 0.03787647, 0.008579682, + -0.038568925, -0.027498025, -0.028416378, 0.0022012168, 0.010906191, + -0.013745787, 0.018267838, 0.013531097, -0.061559845, 0.004682517, + -0.005993303, 0.0028113858, -0.0028286583, 0.0026029332, -0.06693403, + -0.0072381413, -0.02419584, 0.0037009937, -0.0011296495, -0.030310456, + 0.0005999609, 0.009945354, 0.024915686, 0.038672045, 0.023009432, + -0.05093051, -0.09101409, -0.06686167, -0.06211481, -0.022600474, + 0.0024902367, -0.0067171026, -0.016769778, -0.0032803628, 0.008623083, + -0.0016110836, 0.014925073, 0.033811048, 0.012829449, -0.052575592, + 0.03728281, -0.0051201633, 0.021238064, -0.031086605, -0.0043402985, + 0.25054494, -0.028396713, -0.010725523, -0.023445267, 0.021751683, + 0.003130971, 0.012270548, -0.014836475, 0.014466885, 0.0021478906, + -0.088153616, 0.015356315, 0.039639276, -0.040283255, 0.014923924, + -0.029303031, -0.004475201, 0.047299225, -0.06726505, -0.012491676, + -0.002080582, 0.03506341, 0.04146718, 0.0074114986, -0.009582633, + 0.006623749, -0.05454898, -0.0034387247, -0.014780821, 0.03698328, + -0.034441486, 0.22032379, -0.021792699, 0.008001907, 0.0341019, + 0.0025784625, -0.0071689896, -0.014151225, -0.050547987, -0.030372301, + -0.03288388, -0.042987447, -0.0033656165, 0.021502906, -0.0030374376, + -0.024413, -0.03506603, 0.030891743, 0.0069994032, 0.004887366, + 0.030707076, 0.0065348223, 0.0008240555, 0.016809713, -0.024151647, + -0.0040458064, 0.044567548, 0.03908212, -0.061782435, 0.0026002831, + 0.02003242, -0.0115451, -0.045135964, -0.0663542, 0.005240975, + 0.0010777109, -0.009276002, -0.011919081, 0.027654119, -0.013634551, + 0.0129154315, -0.013195512, 0.040571272, -0.099290505, -0.04656693, + -0.20979854, 0.04181004, -0.06769166, -0.04121946, 0.018260444, + 0.005617506, -0.15694222, 0.032472793, 0.014189598, 0.008345103, + -0.041118417, 0.0074527003, -0.011494104, 0.004906474, -0.0027100458, + 0.0009994594, -0.041061398, -0.045274835, 0.015187793, 0.034275036, + -0.02813289, 0.02098019, -0.015043198, 0.03716667, 0.013542642, + -0.008104835, 0.014965486, -0.027978558, 0.021163663, -0.006942737, + -0.034969814, -0.038961593, 0.016802894, -0.012318175, -0.047821593, + -0.01933216, 0.0064432374, 0.0322358, -0.020437784, 0.02659447, + -0.03022022, -0.019443465, -0.094178624, -0.017009107, 0.03860671, + -0.00023695534, -0.033089854, -0.014677462, 0.012356399, 0.018040499, + -0.19360113, 0.011710817, -0.019871691, 0.020124774, 0.024948105, + -0.024573864, -0.028349072, -0.041731454, 0.032646254, 0.015098165, + 0.0018447012, -0.01129152, -0.02481687, 0.036048, 0.20797811, + 0.04317757, -0.017239755, 0.033431605, -0.011384422, 0.0099174455, + -0.19739223, -0.008901062, -0.056426458, 0.014591864, 0.0044474266, + 0.008209326, -0.012241819, 0.042553645, -0.021552453, 0.008611734, + 0.048944127, -0.013872049, 0.019179989, 0.008183264, -0.053223096, + -0.027327595, -0.0033542586, -0.012353858, -0.010941209, 0.010212546, + 0.029714134, -0.011385593, -0.0013529479, 0.014505385, 0.01148663, + 0.012613636, -0.0074430504, -0.014008101, -0.028146038, -0.042778917, + 0.02143165, 0.016812252, -0.06286215, 0.02085532, -0.035128277, + 0.0241282, 0.01397908, -0.034992814, 0.013153766, 0.0068236147, + 0.013594184, -0.06859393, 0.051849406, 0.029675119, -0.0037699796, + -0.00013216575, 0.02916647, 0.031859048, -0.015006051, 0.0001439966, + 0.0026584554, -0.0046948595, 0.039754897, 0.034873154, 0.0012870439, + -0.011516082, -0.074089095, 0.019241294, 0.00076195505, 0.0027334464, + -0.036206458, -0.0011109262, -0.048838835, -0.00204685, 0.01179991, + 0.0068136845, 0.009852495, 0.017308988, 0.03159545, 0.058803353, + 0.038116634, 0.008836143, -0.010460637, -0.010994099, -0.0012926942, + -0.048370842, 0.037696566, -0.08093239, -0.0041242186, -0.005866373, + 0.02048607, -0.12549639, 0.011705739, -0.0021425558, 0.018078592, + -0.038228087, 0.004245971, -0.11560507, 0.01381203, -0.02734893, + 0.029595908, 0.101082794, -0.042842254, -0.08397301, -0.1546237, + -0.037624564, 0.0069606556, -0.008020479, 0.0043268185, 0.016504597, + 0.044554908, -0.05240209, 0.020519335, -0.050994243, -0.019861093, + 0.022066997, -0.0188911, 0.012919696, -0.022872692, -0.012961374, + -0.020071112, 0.0074553066, 0.06402014, 0.04065211, 0.014139608, + 0.06221546, -0.02574805, 0.010114545, 0.020619567, 0.032264773, + -0.009148828, 0.022849955, -0.016593235, -0.032456633, -0.006737303, + -0.0037493357, -0.065912865, -0.0024181998, -0.0037048983, -0.019304488, + 0.009085037, 0.057529982, -0.0378338, 0.01792042, 0.01885012, + -0.0043600523, 0.017382368, -0.027792772, 0.006749118, -0.0053297766, + -0.011628587, 0.015736576, 0.024801968, 0.011543913, -0.01159873, + -0.000759976, 0.042183932, 0.05764386, -0.06422416, 0.010577374, + -0.02261249, 0.02282793, -0.05141075, -0.11287078, -0.020670144, + -0.020953743, 0.030885734, -0.012597732, -0.121472664, 0.028447151, + -0.0415664, -0.010061708, 0.06441338, 0.0271207, -0.0016693748, + -0.0045694243, 0.020342957, 0.030528478, 0.007129517, -0.0029600926, + -0.007061397, 0.06036486, -0.004736018, -0.0090786135, -0.07601116, + -0.039556272, -0.051269546, -0.019473685, 0.029858151, 0.028464556, + 0.012424476, 0.013742254, 0.008742927, 0.006065751, -0.009892663, + 0.07699999, -0.003443197, 0.0027863425, 0.029197995, 0.0211013, + 0.01098379, 0.016684106, -0.028917195, 0.008122037, 0.0265241, + -0.04461223 + ] +} diff --git a/test/clip-keywords.test.ts b/test/clip-keywords.test.ts new file mode 100644 index 0000000..13a6a5d --- /dev/null +++ b/test/clip-keywords.test.ts @@ -0,0 +1,129 @@ +// `clipKeywords`: the keywords quak writes for a file in place of its CLIP +// embedding. +// +// Ente's ML data for a file holds a CLIP embedding, 512 numbers its image +// model gave the photo. Ente's photos app puts a file in a category of its +// Discover section when the cosine similarity of that embedding and the text +// embedding of the category's query is at least the category's minimum score, +// and keeps videos out of some categories. `clipKeywords` applies that rule +// and returns the titles of the categories a file falls in, highest score +// first; `quak backup` and `quak backup-metadata` write them as `keywords`. + +import { readFileSync } from "node:fs"; +import { describe, expect, it } from "vitest"; + +import { DISCOVER_CATEGORIES } from "../src/clip-keyword-vectors.js"; +import { clipKeywords } from "../src/clip-keywords.js"; + +// 512 numbers: the ones given, then zeros. +const vector = (...start: number[]): number[] => [ + ...start, + ...new Array<number>(512 - start.length).fill(0), +]; + +const withEmbedding = (embedding: unknown) => ({ + face: { faces: [] }, + clip: { embedding }, +}); + +// Two made-up categories, each with a text embedding along one axis. The +// embedding [3, 4] has a cosine similarity of 3/5 with "Across" and 4/5 with +// "Up". Videos are kept out of "Across". +const ACROSS = { + title: "Across", + query: "across", + minScore: 0.6, + showVideo: false, + textEmbedding: vector(1), +}; +const UP = { + title: "Up", + query: "up", + minScore: 0.5, + showVideo: true, + textEmbedding: vector(0, 1), +}; + +describe("clipKeywords", () => { + it("gives each category whose minimum score the similarity reaches, highest score first", () => { + expect( + clipKeywords(withEmbedding(vector(3, 4)), false, [ACROSS, UP]), + ).toEqual(["Up", "Across"]); + }); + + it("leaves out a category when the similarity is just below its minimum score", () => { + const stricter = { ...ACROSS, minScore: 0.6 + 1e-9 }; + + expect( + clipKeywords(withEmbedding(vector(3, 4)), false, [stricter, UP]), + ).toEqual(["Up"]); + }); + + it("keeps a video out of a category that leaves out videos", () => { + expect( + clipKeywords(withEmbedding(vector(3, 4)), true, [ACROSS, UP]), + ).toEqual(["Up"]); + }); + + it("gives an empty list for an embedding that falls in no category", () => { + expect( + clipKeywords(withEmbedding(vector(0, 0, 1)), false, [ACROSS, UP]), + ).toEqual([]); + }); + + it.each([ + ["no CLIP embedding", { face: { faces: [] } }], + ["a CLIP part that is not an object", { clip: null }], + ["a CLIP part without an embedding", { clip: {} }], + ["an embedding of 511 numbers", withEmbedding(vector(3, 4).slice(1))], + ["an embedding with NaN in it", withEmbedding(vector(3, NaN))], + ["an embedding with Infinity in it", withEmbedding(vector(Infinity))], + ["an embedding of strings", withEmbedding(vector(3, 4).map(String))], + ["an embedding of zeros", withEmbedding(vector())], + ])("gives no keywords for ML data with %s", (_, mlData) => { + expect(clipKeywords(mlData, false, [ACROSS, UP])).toBeUndefined(); + }); +}); + +// The CLIP embedding Ente's image model gives a public-domain NOAA photo of a +// sunset, made by bin/clip-keyword-vectors from the photo at `photo`. +const SUNSET: { photo: string; sha256: string; embedding: number[] } = + JSON.parse( + readFileSync( + new URL("clip-keywords-sunset.json", import.meta.url), + "utf-8", + ), + ); + +describe("Ente's Discover categories", () => { + it("are the 16 of Ente's photos app, each with a text embedding of norm 1", () => { + expect(DISCOVER_CATEGORIES.map((c) => c.title)).toEqual([ + "Identity", + "Screenshots", + "QR Codes", + "Receipts", + "Notes", + "Memes", + "Visiting Cards", + "Babies", + "Pets", + "Selfies", + "Wallpapers", + "Food", + "Celebrations", + "Sunset", + "Hills", + "Greenery", + ]); + for (const category of DISCOVER_CATEGORIES) { + expect(category.textEmbedding).toHaveLength(512); + expect(Math.hypot(...category.textEmbedding)).toBeCloseTo(1, 5); + } + }); + + it("give a photo of a sunset the keyword Sunset and no other", () => { + expect( + clipKeywords({ clip: { embedding: SUNSET.embedding } }, false), + ).toEqual(["Sunset"]); + }); +});