Oasis
Oasis is Cactus Compute's Mirage with a new CPU engine and a retrained text reader. Mirage turns a photo into a JSON record of the scene, the objects in it with boxes and masks, the text it can read, how the objects relate and a short reasoning trace; given a form, it fills in choices, counts, text and boxes. Oasis keeps Mirage's 22 MB of mostly 2-bit weights, runs them several times faster, reads more of the text, and always returns valid JSON.
Oasis and Mirage
Both models described the same photos with the same options, Mirage on its own runtime. results/comparison.json holds every figure with the hashes of both runtimes and weight files.
| Mirage | Oasis | |
|---|---|---|
| Describe a photo | 891 ms | 296 ms |
| Read the text in a photo | 917 ms | 101 ms |
| Fill a four-field form | 729 ms | 164 ms |
| Records that are not valid JSON, of 300 COCO photos | 58 | 0 |
Empty records at conf 0.5, of 300 COCO photos |
2 | 0 |
| ICDAR2013 words read | 80.9% | 81.6% |
| IIIT5K words read | 77.6% | 78.7% |
| Accented letters read | 0.7% | 30.4% |
| COCO objects found, F1 | 0.273 | 0.294 |
| COCO mask IoU | 0.670 | 0.680 |
| COCO outline IoU | 0.673 | 0.676 |
Timings are medians over 24 photos. Words are read end to end: each word image is placed in a scene, found by the engine's own text detector and read. Accented letters are counted on 500 synthetic lines in the seven description languages, set in fonts the reader never trained on. Objects are scored against COCO val2017 boxes at IoU 0.5, and masks and filled outlines against COCO's instance outlines.
What changed
The engine is new. It multiplies Mirage's 2-bit weights in place with integer kernels, keeps its worker threads awake while the decoder writes, and skips the decoder when only text is requested. Every record it writes parses. On about one photo in five, Mirage's runtime adds a phantom box in the top-right corner, as an object or as a line of text, with a nan score that breaks the JSON; the same phantom box becomes the answer to box questions in forms. When the decoder's reasoning trace falls into a loop, Mirage's runtime spends the whole token budget on it and returns an empty record; Oasis closes the trace and the description is written. Outlines follow the probability field between mask cells, keywords steer the description toward the words an application cares about, and a language the model was not trained to describe in is refused with an error.
The text reader is retrained. Mirage's reader never learned 67 of its 306 characters, and on accented text cut as tightly as its detector cuts it, it writes almost no accents; Oasis's reader learned from TextOCR word crops and from synthetic lines in the seven description languages, cut as tightly as the detector cuts text, through the same 2-bit quantiser the engine runs, with Mirage's reader as its teacher on real words. The rest of the model is Mirage's, unchanged.
Use
git clone https://huggingface.co/phanerozoic/oasis && cd oasis
cmake -S engine -B engine/build -DCMAKE_BUILD_TYPE=Release && cmake --build engine/build -j
engine/build/oasis_cli oasis.oasis photo.jpg '{"language": "de"}'
import sys
sys.path.insert(0, "engine/python")
from oasis_engine import Oasis
model = Oasis("oasis.oasis")
record = model.describe("photo.jpg", sections=["objects", "text"], mask_format="polygons")
form = model.extract("photo.jpg", {
"sign": {"enum": ["stop", "yield", "speed limit"]},
"cars": {"type": "integer", "minimum": 0, "maximum": 10},
"where": {"x-source": "bbox", "x-of": "sign"},
})
Options and form fields follow Mirage's: language (en, de, fr, es, it, nl, pl), keywords, conf, text_conf, max_objects, max_text_lines, max_tokens, sections, fields, masks, mask_format (largest, polygons, merged or bitmap), mask_threshold, nms and reasoning. Boxes and outlines use a 0β1000 scale on each image axis. The engine builds with GCC, Clang and MSVC.
Files
| Path | Contents |
|---|---|
oasis.oasis |
Engine weights |
oasis.safetensors |
Float32 weights for further training |
engine/ |
C++ engine, C API, command-line tool and Python binding |
reference/ |
PyTorch forward pass, quantiser, reader training, export and benchmarks |
results/comparison.json |
The measurements above |
The reference tools read Mirage's mirage.safetensors and mirage.cact from reference/weights/mirage/, beside cq_plan.json. Oasis is released under Apache-2.0, as Mirage is; NOTICE records what comes from Mirage, TextOCR and Pillow.
- Downloads last month
- -
Model tree for phanerozoic/oasis
Base model
Cactus-Compute/mirage