No description
  • Scheme 84.7%
  • Shell 11.7%
  • Makefile 3%
  • Common Lisp 0.6%
Find a file
ober 470c3c7c69
Some checks failed
required-ci / required (push) Has been cancelled
Merge pull request #3
2026-09-19 16:46:51 -04:00
.forgejo Use FreeBSD Forgejo CI runner 2026-08-03 14:52:18 -06:00
ssd-recognizer fix: scale ssd truth matching 2026-09-05 12:55:43 -06:00
support fix: scale ssd truth matching 2026-09-05 12:55:43 -06:00
.gitignore Add Jerboa SSD recognizer 2026-07-15 08:32:39 -06:00
.gitsafeignore Set up Forgejo CI/CD policy 2026-08-03 12:55:31 -06:00
AGENTS.md docs(agents): add checkout hygiene policy (work dirs under ~/work, cleanup when done) 2026-09-12 19:16:17 -06:00
dependencies.lock fix: scale ssd truth matching 2026-09-05 12:55:43 -06:00
jpkg.sexp Use FreeBSD Forgejo CI runner 2026-08-03 14:52:18 -06:00
LICENSE Switch to MIT license 2026-07-21 13:42:20 -06:00
Makefile fix: scale ssd truth matching 2026-09-05 12:55:43 -06:00
README.md Add Jerboa SSD recognizer 2026-07-15 08:32:39 -06:00
test-runner.ss Add Jerboa SSD recognizer 2026-07-15 08:32:39 -06:00
VERSION fix: scale ssd truth matching 2026-09-05 12:55:43 -06:00

jerboa-ssd-recognizer

jerboa-ssd-recognizer is the Jerboa-owned recognizer for Star Fleet Battles SSD review data. It replaces the decision-making parts of the Python truth/OCR service with reusable .ss code.

The library does not implement an OCR engine. It consumes OCR words from a backend through jerboa-vision:

((text . "PH-1") (conf . 88) (bbox . (x1 y1 x2 y2)))

From there it owns the parts that must be identical on the server and APK:

  • box-type aliases and canonical labels
  • OCR text-to-box candidates
  • learned truth examples from approved groups
  • negative examples from deleted/suppressed groups
  • race gating, such as PA Panels for Andromedans only
  • feature scoring by count, position, size, aspect, and optional color
  • compact truth lookup and source/page/dpi matching

Build

make test

By default the Makefile expects ../jerboa-vision beside this checkout. Override with JERBOA_VISION=/path/to/jerboa-vision if needed.

API Shape

The main entry point is:

(ssd-recognize-groups payload)

Expected payload fields:

  • source: source metadata with name, path, optional source_key
  • image: rendered image width and height
  • groups: detected SSD groups with id, bbox, count, cell_ids
  • ocr_words: backend OCR words in rendered image coordinates
  • learned_examples: examples generated from approved truth files
  • box_types: SFBOL box type id/name list
  • inventory: optional ship inventory counts from SFBOL/SFC data

The result contains suggestions, each with group_id, label, box_type_id, confidence, reason, source, ocr_text, and candidate alternatives.

Truth service logic lives in ssd-recognizer/truth-store.ss. The important entry point is:

(ssd-matching-truth-entries entries params)

It implements the Python service behavior for exact source-key matches, source-name/page/dpi fallback matches, compact metadata, and sorting more complete truth files first.

Migration Target

The current Python service can be retired in stages:

  1. Keep Python only as an OCR backend that returns words.
  2. Move /api/recognize scoring to this library.
  3. Move truth load/save/dump to the Jerboa SSD web service.
  4. Generate Android/Kotlin or Jerboa-Android code from this same data model.
  5. Replace the OCR backend with Android ML Kit for fully offline APK use.