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.
- Logical
Output - Logical output: the semantic contract the model exposes.
- Physical
Output - Physical output: a concrete tensor produced by the converter.
- Quantization
- Quantization parameters for a quantized tensor.
- Schema
V2 - Root of the edgefirst.json schema v2 metadata.
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.
- Decoder
Kind - Decoder framework for a logical output.
- Decoder
Version - YOLO architecture version for Ultralytics decoders.
- Logical
Type - Semantic type of a logical output.
- NmsMode
- HAL NMS mode.
- Physical
Type - Semantic type of a physical output.
- Score
Format - Score format for
scoreslogical outputs. - Stride
- FPN stride.
Square(s)means(s, s);Rect(sx, sy)supports non-square inputs.
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.