SuitMk2 eyes: ship fingerprints

Fingerprints for telling Star Citizen ships apart from a picture of the screen. Made for the SuitMk2 companion in SC Toolbox. Published by SC Toolbox contributors.

A fingerprint is a list of numbers that a vision model gives for one video frame. Frames that look alike get similar numbers. This folder holds those numbers and the labels that go with them. It holds no video and no pictures.

It does not work well enough yet to name a ship from one frame. Read "What it cannot do yet" before using it.

Notice

Star Citizen®, Roberts Space Industries® and Cloud Imperium® are registered trademarks of Cloud Imperium Rights LLC

This is an unofficial Star Citizen fan site, not affiliated with the Cloud Imperium group of companies. All content on this site not authored by its host or users are property of their respective owners.

Everything here is free. It is not for sale. If Cloud Imperium asks for anything here to be changed or removed, it will be.

Official site: https://robertsspaceindustries.com

The fingerprints were measured from footage made by the creators listed in sources.md; that list is the credit to them, and none of their footage is included here.

What it cannot do yet

It cannot name a ship from one frame. That is the finding of the measurement in report.md. The numbers below are copied from it.

What does carry information:

What is here

885 files, 576 MB. The largest file is fingerprint_table/v2_clip_pm_all.f16.npy at 20.0 MB.

PathFilesSizeContents
emb/720395.7 MBper-video embeddings, 15 variants x 40 videos, plus crop rectangles
fingerprint_table/22153.3 MBthe five gallery tables with row labels
results/5323.2 MBevery scoring run: tables, counts, per-frame predictions (no pictures)
meta/72.6 MBframe labels, source lists, search queries and results
meta/frame_index/40891 kBtime of every kept frame, one file per video
labels/28 kBhand-set time ranges and crop rectangles
logs/835 kBmeasurement and embedding logs
scripts/2272 kBthe scripts that were run
spotcheck/214 kBroom-label spot check notes and list
(top level)9418 kBindex.html, README.md, NOTICE.txt, sources.json, sources.md, manifest.json, report.md, FREEZE.sha256.txt, verify.py

Embeddings. Each emb/<variant>/<video id>.npy is one 2-D float16 array. It has one row per kept frame of that video. Each row is one L2-normalised vector. Row n is frame n in meta/frame_index/<video id>.json, which gives its time in seconds. There are 15 variants, 40 videos each, 17,366 rows each:

The embeddings cover every kept frame, including 3,696 frames that got no label (title cards, talking heads, menus and the like). Labels exist for 13,670 frames in meta/frames_table.jsonl: 7,810 gallery, 4,039 test, 1,277 ships outside the ten, 544 with no ship.

Fingerprint table. Five tables built from the gallery rows only. Each has .f16.npy (float16, rows by width), .f16.npz (the same array compressed, key E), .int8.npy (the values times 127, rounded) and .rows.json (ship, view, room, source video id and time for each row). Sizes are in fingerprint_table/SIZES.json. The int8 files were written and sized but never scored.

Every data file is listed in manifest.json with its size, sha256 and contents.

Which ships

Ten ships: Polaris, Prospector, Reclaimer, Vulture, Fortune, Wolf (L-21), Ironclad, Ironclad Assault, Apollo, Hermes.

Used only as "not one of the ten": Caterpillar, Carrack, Zeus Mk II CL, one Origin ship that was not identified, and on-foot footage of Area18 and Seraphim station.

How it was made

  1. Sources. 40 YouTube videos, mostly ship reviews and tours. They are listed in sources.md and sources.json. They were downloaded with yt-dlp, video only, 480p or lower.
  2. Frames. One frame every 2 seconds with ffmpeg, scaled to 640x360. Black or flat frames were dropped (mean luma below 12 or deviation below 8). Near-duplicates were dropped (64-bit dHash within 6 bits of any of the last 25 kept frames). 17,366 frames were kept.
  3. Labels. Time ranges for exterior, interior and cockpit were set by eye for every video (labels/segments.txt). Frames outside a range are unused. Other room labels come from the words spoken near the frame.
  4. Overlay crop. Seven videos from one channel carry webcams along the bottom. The bottom 28% of those frames was cut before fingerprinting (labels/crops.tsv). Test frames were not cut.
  5. Fingerprint. The whole frame is squashed to 224x224 (bicubic) and normalised with the model's own mean and deviation. One vector per frame, L2-normalised, stored as float16.
  6. Split. Gallery and test are split by video, and no uploader is on both sides. One exception is noted in the report.
  7. Matching. First run: 20 nearest gallery rows by cosine similarity, a similarity-weighted vote per ship, no answer below a threshold (scripts/score.py). Second run: nearest single row, with the margin to the next ship as confidence (scripts/score2.py).

Models (not included)

A table is only valid for the exact model and preprocessing that built it. The weights are not here. Get them from their publishers.

ModelWhereWeight file and sha256
CLIP ViT-H/14, laion2B-s32B-b79K, vision tower with projectionhttps://huggingface.co/laion/CLIP-ViT-H-14-laion2B-s32B-b79KCLIP-ViT-H-14-laion2B-s32B-b79K.safetensors, 6ca9667da1ca9e0b0f75e46bb030f7e011f44f86cbfb8d5a36590fcd7507b030
DINOv2-base, revision f9e44c814b77203eaa57a6bdbbd535f21ede1415https://huggingface.co/facebook/dinov2-basemodel.safetensors, d73036b56966966d07975d696bde331762f37297e2f095de8cea0040c3aa0841
DINOv2-small, revision ed25f3a31f01632728cabb09d1542f84ab7b0056https://huggingface.co/facebook/dinov2-smallmodel.safetensors, ae1e99fcefd534ed978cdeb8326f08030c96e28b7a81ffcbc98a857c84d14be1

The CLIP file used was a vision-tower-only file that shipped with a ComfyUI install, loaded with ComfyUI's clip_vision_config_h.json (https://github.com/comfyanonymous/ComfyUI). We did not check which hosted file has that exact hash. Check each model's licence at its source.

40 videos are covered, 21 are not

The working folder holds 61 downloaded videos. This set covers the first 40. The other 21 arrived after the measurement. They have no frames, no fingerprints and no labels here. They are listed at the end of sources.md.

meta/source_table.md is the source list as it was written at the time of the measurement. It still shows those videos as not obtained.

Check it yourself

python verify.py needs only Python 3 and numpy. It loads the first-run fingerprint table, the test-frame embeddings, the labels and the frozen parameters from this folder, repeats the matching rule, and prints the totals of the first table in the report: exterior 1039 frames, 28 correct, 2 named as another ship, 1009 no answer; interior 3000 frames, 45, 8, 2947. We ran it on this folder and it matched.

That is the only number we reproduced from this folder alone. The scoring scripts read only files that are here, but we did not rerun them from this folder. The embeddings themselves, the room labels, the timings and the failure sheets cannot be reproduced from this folder, because they need the frames, the subtitles or the models.

Rebuild it from the sources

We have not rebuilt it from scratch ourselves. These are the steps the scripts took. Run them from the folder root.

  1. Get the videos in sources.md from YouTube yourself. scripts/download.py reads meta/manifest.tsv and needs yt-dlp. Mind the creators' rights and YouTube's terms.
  2. Cut frames with scripts/extract.py. It needs ffmpeg, numpy and Pillow.
  3. Get the three models. Set CLIP_H_WEIGHTS and CLIP_H_CONFIG to the CLIP weight and config files. Put the two DINOv2 models under hf/hub/ in the Hugging Face cache layout, at the revisions above. Create an empty file named GPU_OK; the scripts will not load a model without it.
  4. Run scripts/embed.py <model> and scripts/embed2.py <model> full (or cc). They need torch, transformers and safetensors.
  5. Labels. labels/segments.txt is included. scripts/build_table.py also reads subtitles and chapter titles, which are not included. Use the included meta/frames_table.jsonl, or fetch subtitles yourself and run scripts/vtt2txt.py first.
  6. Score with scripts/score.py tune <model> then test <model>, and scripts/score2.py. The test step refuses to overwrite an existing results.json. scripts/write_table.py writes the fingerprint tables.

Your result may differ a little. A video may have changed, and another ffmpeg version may cut slightly different frames.

The published scripts differ from the ones that were run in one way: the line that set the working folder now points at the folder the script is in, and scripts/models.py takes the model paths from the environment. FREEZE.sha256.txt holds the hashes of the originals as they were frozen before the test run. manifest.json marks each changed file and gives the hash of its original.

Left out on purpose

Videos, frames, contact sheets, thumbnails, subtitles and transcripts, video descriptions, model weights, and download logs.