feat(polygon): add full-frame operator review
This commit is contained in:
@@ -6,6 +6,8 @@ import { createServer } from "vite";
|
||||
let server;
|
||||
let decodeGroundQualification;
|
||||
let decodeGroundFailurePreview;
|
||||
let decodeGroundReview;
|
||||
let decodeGroundReviewFrame;
|
||||
let fetchGroundQualification;
|
||||
let GroundQualificationContractError;
|
||||
|
||||
@@ -70,6 +72,8 @@ before(async () => {
|
||||
({
|
||||
decodeGroundQualification,
|
||||
decodeGroundFailurePreview,
|
||||
decodeGroundReview,
|
||||
decodeGroundReviewFrame,
|
||||
fetchGroundQualification,
|
||||
GroundQualificationContractError,
|
||||
} = await server.ssrLoadModule("/src/core/polygon/groundQualification.ts"));
|
||||
@@ -132,3 +136,61 @@ test("treats missing qualification as a generic run", async () => {
|
||||
});
|
||||
assert.equal(result, null);
|
||||
});
|
||||
|
||||
test("decodes a complete ordered frame review", () => {
|
||||
const decoded = decodeGroundReview({
|
||||
schema_version: "missioncore.polygon-ground-review/v1",
|
||||
access: "read-only",
|
||||
run_id: "goose-ground-abc",
|
||||
identity_sha256: "b".repeat(64),
|
||||
source_id: "goose-3d/v2025-08-22",
|
||||
frame_count: 2,
|
||||
preview_points: 12_000,
|
||||
frames: [0, 1].map((sequence) => ({
|
||||
sequence,
|
||||
frame_id: `2022-07-22_flight__0071_000${sequence}`,
|
||||
source_point_count: 100_000,
|
||||
point_count: 12_000,
|
||||
current: {
|
||||
ground_iou: 0.5,
|
||||
natural_ground_recall: 0.55,
|
||||
obstacle_non_ground_recall: 0.91,
|
||||
latency_ms: 3_000,
|
||||
},
|
||||
patchworkpp: {
|
||||
ground_iou: 0.7,
|
||||
natural_ground_recall: 0.75,
|
||||
obstacle_non_ground_recall: 0.94,
|
||||
latency_ms: 20,
|
||||
},
|
||||
ground_iou_delta: 0.2,
|
||||
})),
|
||||
});
|
||||
assert.equal(decoded.frames.length, 2);
|
||||
assert.equal(decoded.frames[1].sequence, 1);
|
||||
assert.equal(decoded.frames[0].patchwork.groundIou, 0.7);
|
||||
});
|
||||
|
||||
test("decodes a point-aligned review frame with intensity", () => {
|
||||
const decoded = decodeGroundReviewFrame({
|
||||
schema_version: "missioncore.polygon-ground-review-frame/v1",
|
||||
access: "read-only",
|
||||
run_id: "goose-ground-abc",
|
||||
source_id: "goose-3d/v2025-08-22",
|
||||
frame_id: "2022-07-22_flight__0071_0001",
|
||||
source_point_count: 2,
|
||||
point_count: 2,
|
||||
sampling: "deterministic-even-index",
|
||||
points_xyz_m: [[0, 0, 0], [1, 1, 1]],
|
||||
intensity_0_255: [12, 255],
|
||||
ground_truth_ground: [1, 0],
|
||||
evaluated: [1, 1],
|
||||
current_ground: [0, 0],
|
||||
patchwork_ground: [1, 0],
|
||||
current_disagreement: [1, 0],
|
||||
patchwork_disagreement: [0, 0],
|
||||
safety: { navigation_or_safety_accepted: false },
|
||||
});
|
||||
assert.deepEqual(decoded.intensity0To255, [12, 255]);
|
||||
assert.equal(decoded.frameId, "2022-07-22_flight__0071_0001");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user