File size: 932 Bytes
699f3cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from __future__ import annotations

from src.core.frame_state import CanonicalTranslation, FrameEnvelope, FrameResult


def build_empty_result(frame: FrameEnvelope) -> FrameResult:
    return FrameResult(frame_url=frame.frame_url)


def build_protocol_placeholder_result(frame: FrameEnvelope, _: bytes | None = None) -> FrameResult:
    """Gercek inference baglanana kadar protokol smoke testi icin kullanilir."""
    result = build_empty_result(frame)
    if str(frame.health_status) == "1":
        result.detected_translations.append(frame.ground_truth_translation(source="echo_ground_truth"))
    else:
        result.detected_translations.append(
            CanonicalTranslation(
                translation_x=0.0,
                translation_y=0.0,
                translation_z=0.0,
                source="placeholder_fallback",
            )
        )
    result.diagnostics["processor"] = "placeholder"
    return result