pub struct VisionExpected {
pub regions: Vec<ExpectedRegion>,
pub text: Option<String>,
pub fields: BTreeMap<String, String>,
pub targets: Vec<ExpectedRegion>,
pub count: Option<usize>,
}Expand description
What a turn expects the agent to perceive. Each part present is scored by the
VisionCriteria thresholds that apply to it; parts left out are not scored.
§Example
use adk_eval::vision::VisionExpected;
let expected: VisionExpected = serde_json::from_str(r#"{
"regions": [{"label": "bear", "box": [1.4, 68.8, 586.0, 632.8]}],
"fields": {"invoice_number": "INV-4721"},
"count": 1
}"#).unwrap();
assert_eq!(expected.regions[0].bbox(), Some([1.4, 68.8, 586.0, 632.8]));Fields§
§regions: Vec<ExpectedRegion>Objects to find: region IoU, box error, mask IoU and detection scores.
text: Option<String>The page’s text in reading order: OCR character and word accuracy.
fields: BTreeMap<String, String>Field values a document answer extracts: exact and normalised field match.
targets: Vec<ExpectedRegion>Click targets: each matched answer region’s centre must fall inside its target.
count: Option<usize>How many regions the answer should hold.
Trait Implementations§
Source§impl Clone for VisionExpected
impl Clone for VisionExpected
Source§impl Debug for VisionExpected
impl Debug for VisionExpected
Source§impl Default for VisionExpected
impl Default for VisionExpected
Source§impl<'de> Deserialize<'de> for VisionExpected
impl<'de> Deserialize<'de> for VisionExpected
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for VisionExpected
impl PartialEq for VisionExpected
Source§impl Serialize for VisionExpected
impl Serialize for VisionExpected
impl StructuralPartialEq for VisionExpected
Auto Trait Implementations§
impl Forget for VisionExpected
impl Freeze for VisionExpectedwhere
*const u8 is !null: Freeze,
PhantomData<ExpectedRegion>: Freeze,
PhantomData<u8>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
impl Move for VisionExpected
impl RefUnwindSafe for VisionExpected
impl Send for VisionExpected
impl Sync for VisionExpected
impl Unpin for VisionExpected
impl UnsafeUnpin for VisionExpectedwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<ExpectedRegion>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
impl UnwindSafe for VisionExpected
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more