Expand description
Schema v2 metadata types for EdgeFirst model configuration.
Schema v2 introduces a two-layer output model that separates the logical
contract (what the model produces semantically) from the physical
realization (what tensors the converter emitted). Each entry in the
top-level SchemaV2::outputs array is a LogicalOutput. A logical
output either IS a physical tensor (when the converter did not split it
further) or contains a outputs array of PhysicalOutput children
that realize it.
§Example — YOLOv8 detection, flat (TFLite)
use edgefirst_decoder::schema::SchemaV2;
let json = r#"{
"schema_version": 2,
"outputs": [
{
"name": "boxes", "type": "boxes",
"shape": [1, 64, 8400],
"dshape": [{"batch": 1}, {"num_features": 64}, {"num_boxes": 8400}],
"encoding": "dfl", "decoder": "ultralytics", "normalized": true,
"dtype": "int8",
"quantization": {"scale": 0.00392, "zero_point": 0, "dtype": "int8"}
},
{
"name": "scores", "type": "scores",
"shape": [1, 80, 8400],
"dshape": [{"batch": 1}, {"num_classes": 80}, {"num_boxes": 8400}],
"decoder": "ultralytics", "score_format": "per_class",
"dtype": "int8",
"quantization": {"scale": 0.00392, "zero_point": 0, "dtype": "int8"}
}
]
}"#;
let schema: SchemaV2 = serde_json::from_str(json).unwrap();
assert_eq!(schema.schema_version, 2);
assert_eq!(schema.outputs.len(), 2);Structs§
- Input
Spec - Input tensor specification.
- Letterbox
- Letterbox geometry for
resize: letterbox. - Logical
Output - Logical output: the semantic contract the model exposes.
- Physical
Output - Physical output: a concrete tensor produced by the converter.
- Preprocessing
- Input pre-processing declared by the model producer.
- Quantization
- Quantization parameters for a quantized tensor.
- Schema
V2 - Root of the edgefirst.json schema v2 metadata.
- Semantic
Params - Semantic segmentation decode fields of a logical output.
- Upsample
- Score-map upsampling.
Enums§
- Activation
- Activation function applied to or required by a physical tensor.
- BoxEncoding
- Box encoding for
boxeslogical outputs. - DType
- Quantized or floating-point data type of a model’s logical I/O.
- Decode
Mode - Semantic decode mode.
- Decoder
Kind - Decoder framework for a logical output.
- Decoder
Version - YOLO architecture version for Ultralytics decoders.
- Interpolation
- Resampling filter.
- Letterbox
Placement - Letterbox placement of the scaled image.
- Logical
Type - Semantic type of a logical output.
- Mask
Activation - Activation over mask-classification mask logits.
- NmsMode
- HAL NMS mode.
- Normalization
- Input normalization: a named preset or explicit per-channel
mean/std, both defined as(x - mean) / stdon 0–255 values. - Normalization
Preset - Named normalization presets, matching the
validation.normalizationvocabulary. - PadSpace
- Space a letterbox pad value is expressed in.
- Physical
Type - Semantic type of a physical output.
- Resize
Mode - How a frame is fitted to the fixed model input.
- Score
Format - Score format for
scoreslogical outputs. - Stride
- FPN stride.
Square(s)means(s, s);Rect(sx, sy)supports non-square inputs. - Upsample
Method - Score-map upsampling filter.
Constants§
- MAX_
SUPPORTED_ SCHEMA_ VERSION - Highest
schema_versionthis parser accepts. Files with a higher version are rejected rather than silently parsed against the wrong grammar.