Spaces:
Paused
Paused
| // ISR Mission Planning & Assessment Functions | |
| // ββ Mission Planning βββββββββββββββββββββββββββββββββββββββββββββ | |
| // Takes a free-form mission objective and produces: | |
| // 1. Concrete object class queries for the detector (YOLO/DETR/GDINO) | |
| // 2. A refined mission statement for downstream assessment | |
| class MissionPlan { | |
| detector_queries string[] @description("ONLY the object classes directly targeted by the mission. Use COCO class names (person, car, truck, bicycle, motorcycle, bus, dog, cat, etc.). Include ONLY classes the mission explicitly asks to find β do NOT pad with tangentially related classes. Typically 1-4 items.") | |
| refined_mission string @description("A clear, one-sentence restatement of the mission objective that a downstream analyst LLM will evaluate each detection against.") | |
| reasoning string @description("Brief explanation of why these queries were chosen.") | |
| } | |
| function PlanMission(mission_text: string) -> MissionPlan { | |
| client GPT4oMini | |
| prompt #" | |
| You are an ISR (Intelligence, Surveillance, Reconnaissance) mission planner. | |
| Your job is to decide what BROAD object categories a visual detector (YOLO / DETR / Grounding DINO) should look for. | |
| IMPORTANT β separation of concerns: | |
| - The DETECTOR can only recognize broad visual categories (person, car, truck, bus, etc.). | |
| It CANNOT judge intent, context, or mission-specific conditions. | |
| - A DOWNSTREAM ANALYST LLM will later examine each detection and decide whether it | |
| satisfies the mission. That is where nuanced judgment happens. | |
| Therefore: | |
| - Output ONLY the object classes the mission EXPLICITLY targets. Keep the list MINIMAL. | |
| - NEVER pad with "context" classes that happen to appear in the scene but are not the | |
| mission target. Every extra class wastes GPU cycles on irrelevant detections. | |
| - NEVER output mission-specific or subjective labels (e.g. "stranded person", "cargo truck", | |
| "suspicious vehicle"). The detector cannot distinguish these from their parent category. | |
| - Use standard COCO class names when possible: person, car, truck, bus, motorcycle, bicycle, | |
| dog, cat, horse, sheep, cow, elephant, bear, zebra, giraffe, bird, | |
| boat, airplane, backpack, suitcase, handbag, umbrella, etc. | |
| KEY RULE β ask "Is the mission trying to FIND this class of object?" | |
| - YES β include it. NO β leave it out, even if it appears in the scene. | |
| Examples: | |
| - "identify person stranded on rooftop" β detector_queries: ["person"] | |
| (mission targets people, NOT rooftops. Downstream LLM judges context.) | |
| - "find motorcycles lane-splitting between traffic" β detector_queries: ["motorcycle"] | |
| (mission targets motorcycles, NOT the surrounding cars/trucks.) | |
| - "identify vehicles that can carry heavy cargos" β detector_queries: ["truck", "bus", "car"] | |
| (mission targets vehicles broadly β multiple vehicle classes needed.) | |
| - "find abandoned luggage in airport" β detector_queries: ["suitcase", "backpack", "handbag"] | |
| (mission targets luggage β multiple luggage classes needed.) | |
| Mission objective: "{{ mission_text }}" | |
| {{ ctx.output_format }} | |
| "# | |
| } | |
| // ββ Mission Suggestion ββββββββββββββββββββββββββββββββββββββββββ | |
| // Analyzes a video frame and suggests actionable ISR missions | |
| class MissionSuggestion { | |
| mission string @description("A concise mission objective. Imperative command, e.g. 'Identify vehicles that can carry heavy cargos'. 8-15 words.") | |
| reasoning string @description("One sentence: what you see in the image that makes this mission feasible.") | |
| } | |
| function SuggestMissions(frame: image) -> MissionSuggestion[] { | |
| client GPT4oMini | |
| prompt #" | |
| {{ _.role("system") }} | |
| You are an ISR (Intelligence, Surveillance, Reconnaissance) mission advisor. | |
| Given a single video frame, suggest 3-5 surveillance missions. | |
| HOW THE SYSTEM WORKS β read carefully: | |
| - A DETECTOR (YOLO) finds broad object categories: person, car, truck, boat, etc. | |
| - An ANALYST LLM then examines EACH detected object's bounding box crop and decides: | |
| "Does this specific object satisfy the mission?" based on its VISUAL APPEARANCE. | |
| - The analyst judges each object INDEPENDENTLY. No spatial reasoning, no counting, | |
| no temporal tracking, no multi-frame analysis. | |
| THE BEST MISSIONS ask the analyst to make a VISUAL INFERENCE about each object. | |
| The mission should filter a broad category into a meaningful subset based on what | |
| the object LOOKS LIKE β its sub-type, visible attributes, condition, or equipment. | |
| Think of it as: "The detector found 20 [trucks]. Which ones are [interesting subset]?" | |
| The analyst looks at each truck's appearance and decides yes or no. | |
| Categories of visual inference (use these as inspiration, NOT as templates): | |
| - SUB-TYPE: narrowing a broad class by what variant it is | |
| - ATTRIBUTES: filtering by visible features like clothing, markings, equipment | |
| - CONDITION: filtering by visible state like loaded/empty, damaged/intact | |
| - CO-OCCURRENCE: filtering by what else appears in the same bounding box crop | |
| WHAT THE ANALYST CAN JUDGE (from a single object crop): | |
| - Sub-type or variant within a class | |
| - Visual attributes (clothing, markings, color, size, equipment, accessories) | |
| - Visible condition or state | |
| - What else is visible in the same crop (person holding something, vehicle carrying something) | |
| WHAT THE ANALYST CANNOT JUDGE: | |
| - Spatial relationships to other objects or scene landmarks (near, on, inside) | |
| - Counting or aggregation (how many, total) | |
| - Motion, direction, speed, or behavior over time | |
| - Scene-level context (restricted zone, authorized area) | |
| RULES: | |
| 1. Only reference objects you ACTUALLY SEE in the frame. Look at the image carefully. | |
| 2. Only target COCO-detectable objects (person, car, truck, bus, motorcycle, bicycle, | |
| boat, dog, cat, airplane, backpack, suitcase, horse, cow, etc.). | |
| 3. Each mission = a visual inference about object appearance or sub-type. | |
| 4. Use verbs like: identify, find, detect β NOT: count, track, monitor, follow, locate. | |
| 5. Be ORIGINAL β craft each mission specifically for what you see in THIS frame. | |
| Do NOT reuse generic templates. Every mission should feel tailored to the scene. | |
| {{ _.role("user") }} | |
| Analyze this video frame and suggest 3-5 missions based on the objects visible: | |
| {{ frame }} | |
| {{ ctx.output_format }} | |
| "# | |
| } | |
| // ββ Detection Assessment βββββββββββββββββββββββββββββββββββββββββ | |
| // Replaces hand-rolled JSON parsing with type-safe BAML output | |
| class DetectionInfo { | |
| track_id string | |
| class_label string | |
| confidence float @description("Detection model confidence 0.0-1.0. Lower values mean the detector is less sure about the class.") | |
| center_x float @description("Horizontal position in frame, 0.0=left edge, 1.0=right edge") | |
| center_y float @description("Vertical position in frame, 0.0=top edge, 1.0=bottom edge") | |
| speed_kph float | |
| direction string @description("Clock direction (e.g. '3 o'clock' for rightward) or 'stationary'") | |
| } | |
| class DetectionVerdict { | |
| track_id string | |
| mission_relevant bool @description("Does this broad object CLASS relate to the mission? e.g. 'person' is relevant to a rescue mission, 'dog' is not.") | |
| satisfies bool? @description("Based on visual context, does THIS SPECIFIC detection actually meet the mission criteria? e.g. a person on a rooftop satisfies 'find stranded people', but a person walking on a street does not. null if the image is too ambiguous to judge.") | |
| reason string @description("1-2 sentences: what you observe in the image that supports your verdict. Reference specific visual cues (location, posture, surroundings, motion).") | |
| features map<string, string> @description("2-5 observable properties from the image relevant to the mission. e.g. location: 'rooftop', posture: 'standing', surroundings: 'floodwater', vehicle_type: 'flatbed truck'") | |
| } | |
| // ββ PlanMission Tests ββββββββββββββββββββββββββββββββββββββββββββ | |
| test HeavyCargoVehicles { | |
| functions [PlanMission] | |
| args { | |
| mission_text "identify vehicles that can carry heavy cargos" | |
| } | |
| // Mission targets vehicles broadly β multiple vehicle types needed | |
| @@assert( {{ this.detector_queries|length >= 2 }} ) | |
| @@assert( {{ this.detector_queries|length <= 5 }} ) | |
| @@assert( {{ "truck" in this.detector_queries }} ) | |
| @@assert( {{ "cargo" not in this.detector_queries|join(" ") }} ) | |
| // No non-vehicle padding | |
| @@assert( {{ "person" not in this.detector_queries }} ) | |
| @@assert( {{ "dog" not in this.detector_queries }} ) | |
| } | |
| test PersonOnRooftop { | |
| functions [PlanMission] | |
| args { | |
| mission_text "identify person stranded on rooftop" | |
| } | |
| // Mission targets person only β rooftop is context for assessor | |
| @@assert( {{ "person" in this.detector_queries }} ) | |
| @@assert( {{ this.detector_queries|length <= 2 }} ) | |
| @@assert( {{ "stranded" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "rooftop" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "car" not in this.detector_queries }} ) | |
| @@assert( {{ "dog" not in this.detector_queries }} ) | |
| } | |
| test AbandonedLuggage { | |
| functions [PlanMission] | |
| args { | |
| mission_text "find abandoned luggage in airport terminal" | |
| } | |
| // Mission targets luggage β multiple luggage classes needed | |
| @@assert( {{ this.detector_queries|length >= 2 }} ) | |
| @@assert( {{ this.detector_queries|length <= 4 }} ) | |
| @@assert( {{ "abandoned" not in this.detector_queries|join(" ") }} ) | |
| // No non-luggage padding | |
| @@assert( {{ "person" not in this.detector_queries }} ) | |
| @@assert( {{ "car" not in this.detector_queries }} ) | |
| @@assert( {{ "airplane" not in this.detector_queries }} ) | |
| } | |
| test VehiclesBlockingHighway { | |
| functions [PlanMission] | |
| args { | |
| mission_text "locate vehicles blocking the highway exit ramp" | |
| } | |
| // Mission targets vehicles β multiple vehicle types needed | |
| @@assert( {{ "car" in this.detector_queries }} ) | |
| @@assert( {{ "truck" in this.detector_queries }} ) | |
| @@assert( {{ this.detector_queries|length <= 5 }} ) | |
| @@assert( {{ "blocking" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "highway" not in this.detector_queries|join(" ") }} ) | |
| // No non-vehicle padding | |
| @@assert( {{ "person" not in this.detector_queries }} ) | |
| @@assert( {{ "dog" not in this.detector_queries }} ) | |
| } | |
| test PeopleJaywalking { | |
| functions [PlanMission] | |
| args { | |
| mission_text "identify people jaywalking across the main road" | |
| } | |
| // Mission targets people only β road/vehicles are context | |
| @@assert( {{ "person" in this.detector_queries }} ) | |
| @@assert( {{ this.detector_queries|length <= 2 }} ) | |
| @@assert( {{ "jaywalking" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "road" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "car" not in this.detector_queries }} ) | |
| @@assert( {{ "truck" not in this.detector_queries }} ) | |
| @@assert( {{ "bus" not in this.detector_queries }} ) | |
| @@assert( {{ "bicycle" not in this.detector_queries }} ) | |
| } | |
| test BoatsNearRestrictedDock { | |
| functions [PlanMission] | |
| args { | |
| mission_text "find boats anchored near the restricted dock area" | |
| } | |
| // Mission targets boats only | |
| @@assert( {{ "boat" in this.detector_queries }} ) | |
| @@assert( {{ this.detector_queries|length <= 2 }} ) | |
| @@assert( {{ "anchored" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "restricted" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "dock" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "person" not in this.detector_queries }} ) | |
| } | |
| test DogsOffLeash { | |
| functions [PlanMission] | |
| args { | |
| mission_text "detect dogs off-leash in the public park" | |
| } | |
| // Mission targets dogs only β leash/park are context | |
| @@assert( {{ "dog" in this.detector_queries }} ) | |
| @@assert( {{ this.detector_queries|length <= 2 }} ) | |
| @@assert( {{ "leash" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "off-leash" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "park" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "person" not in this.detector_queries }} ) | |
| @@assert( {{ "cat" not in this.detector_queries }} ) | |
| } | |
| test DeliveryTrucksInDriveways { | |
| functions [PlanMission] | |
| args { | |
| mission_text "locate delivery trucks parked in residential driveways" | |
| } | |
| // Mission targets trucks only β delivery/residential are context | |
| @@assert( {{ "truck" in this.detector_queries }} ) | |
| @@assert( {{ this.detector_queries|length <= 2 }} ) | |
| @@assert( {{ "delivery" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "residential" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "driveway" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "car" not in this.detector_queries }} ) | |
| @@assert( {{ "person" not in this.detector_queries }} ) | |
| } | |
| test CyclistsOnSidewalk { | |
| functions [PlanMission] | |
| args { | |
| mission_text "identify cyclists riding on the pedestrian sidewalk" | |
| } | |
| // Mission targets cyclists = bicycle + person | |
| @@assert( {{ "bicycle" in this.detector_queries }} ) | |
| @@assert( {{ "person" in this.detector_queries }} ) | |
| @@assert( {{ this.detector_queries|length <= 3 }} ) | |
| @@assert( {{ "cyclist" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "sidewalk" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "pedestrian" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "car" not in this.detector_queries }} ) | |
| @@assert( {{ "truck" not in this.detector_queries }} ) | |
| } | |
| test PersonsLoiteringNearExit { | |
| functions [PlanMission] | |
| args { | |
| mission_text "find persons loitering near the emergency exit" | |
| } | |
| // Mission targets persons only β exit is context | |
| @@assert( {{ "person" in this.detector_queries }} ) | |
| @@assert( {{ this.detector_queries|length <= 2 }} ) | |
| @@assert( {{ "loitering" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "emergency" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "door" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "car" not in this.detector_queries }} ) | |
| } | |
| test OverturnedVehicles { | |
| functions [PlanMission] | |
| args { | |
| mission_text "detect overturned vehicles on the freeway" | |
| } | |
| // Mission targets vehicles β multiple vehicle types needed | |
| @@assert( {{ "car" in this.detector_queries }} ) | |
| @@assert( {{ "truck" in this.detector_queries }} ) | |
| @@assert( {{ this.detector_queries|length <= 5 }} ) | |
| @@assert( {{ "overturned" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "freeway" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "person" not in this.detector_queries }} ) | |
| @@assert( {{ "dog" not in this.detector_queries }} ) | |
| } | |
| test AircraftOutsideApron { | |
| functions [PlanMission] | |
| args { | |
| mission_text "locate aircraft parked outside designated apron area" | |
| } | |
| // Mission targets aircraft only | |
| @@assert( {{ "airplane" in this.detector_queries }} ) | |
| @@assert( {{ this.detector_queries|length <= 2 }} ) | |
| @@assert( {{ "designated" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "apron" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "person" not in this.detector_queries }} ) | |
| @@assert( {{ "car" not in this.detector_queries }} ) | |
| } | |
| test PersonsWithBackpacksNearFence { | |
| functions [PlanMission] | |
| args { | |
| mission_text "identify persons carrying large backpacks near the perimeter fence" | |
| } | |
| // Mission targets persons + backpacks | |
| @@assert( {{ "person" in this.detector_queries }} ) | |
| @@assert( {{ "backpack" in this.detector_queries }} ) | |
| @@assert( {{ this.detector_queries|length <= 3 }} ) | |
| @@assert( {{ "perimeter" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "fence" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "carrying" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "car" not in this.detector_queries }} ) | |
| } | |
| test MotorcyclesLaneSplitting { | |
| functions [PlanMission] | |
| args { | |
| mission_text "find motorcycles lane-splitting between traffic" | |
| } | |
| // Mission targets motorcycles only β surrounding traffic is context | |
| @@assert( {{ "motorcycle" in this.detector_queries }} ) | |
| @@assert( {{ this.detector_queries|length <= 2 }} ) | |
| @@assert( {{ "lane-splitting" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "traffic" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "car" not in this.detector_queries }} ) | |
| @@assert( {{ "truck" not in this.detector_queries }} ) | |
| @@assert( {{ "person" not in this.detector_queries }} ) | |
| } | |
| test CattleOnRoadway { | |
| functions [PlanMission] | |
| args { | |
| mission_text "detect cattle that have crossed onto the roadway" | |
| } | |
| // Mission targets cattle (COCO: cow) only | |
| @@assert( {{ "cow" in this.detector_queries }} ) | |
| @@assert( {{ this.detector_queries|length <= 2 }} ) | |
| @@assert( {{ "cattle" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "roadway" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "crossed" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "car" not in this.detector_queries }} ) | |
| @@assert( {{ "person" not in this.detector_queries }} ) | |
| } | |
| test BusesAtUnauthorizedStops { | |
| functions [PlanMission] | |
| args { | |
| mission_text "locate buses stopped at unauthorized pickup points" | |
| } | |
| // Mission targets buses only | |
| @@assert( {{ "bus" in this.detector_queries }} ) | |
| @@assert( {{ this.detector_queries|length <= 2 }} ) | |
| @@assert( {{ "unauthorized" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "pickup" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "car" not in this.detector_queries }} ) | |
| @@assert( {{ "truck" not in this.detector_queries }} ) | |
| @@assert( {{ "person" not in this.detector_queries }} ) | |
| } | |
| test PeopleSwimmingInRestrictedArea { | |
| functions [PlanMission] | |
| args { | |
| mission_text "identify people swimming in the restricted waterway" | |
| } | |
| // Mission targets people only β waterway is context | |
| @@assert( {{ "person" in this.detector_queries }} ) | |
| @@assert( {{ this.detector_queries|length <= 2 }} ) | |
| @@assert( {{ "swimming" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "restricted" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "waterway" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "boat" not in this.detector_queries }} ) | |
| @@assert( {{ "car" not in this.detector_queries }} ) | |
| } | |
| test TrucksWithOversizedLoads { | |
| functions [PlanMission] | |
| args { | |
| mission_text "find trucks carrying visible oversized loads on the bridge" | |
| } | |
| // Mission targets trucks only β bridge/load are context | |
| @@assert( {{ "truck" in this.detector_queries }} ) | |
| @@assert( {{ this.detector_queries|length <= 2 }} ) | |
| @@assert( {{ "oversized" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "cargo" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "bridge" not in this.detector_queries|join(" ") }} ) | |
| @@assert( {{ "car" not in this.detector_queries }} ) | |
| @@assert( {{ "person" not in this.detector_queries }} ) | |
| } | |
| // ββ Detection Assessment βββββββββββββββββββββββββββββββββββββββββ | |
| // Replaces hand-rolled JSON parsing with type-safe BAML output | |
| function AssessDetections(mission: string, detections: DetectionInfo[], frame_image: image) -> DetectionVerdict[] { | |
| client GPT4oMini | |
| prompt #" | |
| {{ _.role("system") }} | |
| You are an ISR analyst. A broad-net detector found candidate objects. Your job: decide | |
| which ones actually satisfy the mission using the image and metadata below. | |
| Reading the metadata: | |
| - **confidence**: detector certainty (0-1). Below 0.4 = likely false positive β verify visually before trusting the class label. | |
| - **position**: (x, y) in frame where (0,0)=top-left, (1,1)=bottom-right. Use this to locate each detection in the image. | |
| - **speed/direction**: from multi-frame tracking. speed=0 means stationary. Direction uses clock notation (12=up, 3=right, 6=down, 9=left). | |
| For each detection, decide: | |
| - **mission_relevant**: Does this object CLASS relate to the mission? (person vs dog, not this specific instance.) | |
| - **satisfies**: Based on what you SEE in the image β does this specific detection meet the mission criteria? Consider location, posture, surroundings, object subtype. Set null only when genuinely ambiguous. | |
| - **reason**: Cite what you observe in the image. No generic statements. | |
| - **features**: 2-5 observable properties from the image relevant to the mission. | |
| {{ _.role("user") }} | |
| Mission: "{{ mission }}" | |
| Detected objects: | |
| {% for d in detections %} | |
| - {{ d.track_id }}: {{ d.class_label }} (conf={{ d.confidence }}) at ({{ d.center_x }}, {{ d.center_y }}), {{ d.speed_kph }}kph {{ d.direction }} | |
| {% endfor %} | |
| {{ frame_image }} | |
| Assess every detection above. | |
| {{ ctx.output_format }} | |
| "# | |
| } | |
| // ββ AssessDetections Tests βββββββββββββββββββββββββββββββββββββββ | |
| // SAR flood scene: person + dog on rooftop, surrounded by floodwater | |
| // Wide net: detector found person + dog. Assessor must judge context from image. | |
| test SAR_PersonOnRooftop { | |
| functions [AssessDetections] | |
| args { | |
| mission "identify person stranded on rooftop needing rescue" | |
| detections [ | |
| { | |
| track_id "T01" | |
| class_label "person" | |
| confidence 0.87 | |
| center_x 0.45 | |
| center_y 0.35 | |
| speed_kph 0.0 | |
| direction "stationary" | |
| }, | |
| { | |
| track_id "T02" | |
| class_label "dog" | |
| confidence 0.72 | |
| center_x 0.52 | |
| center_y 0.40 | |
| speed_kph 0.0 | |
| direction "stationary" | |
| } | |
| ] | |
| frame_image { | |
| file "fixtures/sar_rooftop.jpg" | |
| media_type "image/jpeg" | |
| } | |
| } | |
| @@assert( {{ this|length == 2 }} ) | |
| // Person on rooftop: class is relevant AND visual context satisfies mission | |
| @@assert( {{ this[0].track_id == "T01" }} ) | |
| @@assert( {{ this[0].mission_relevant == true }} ) | |
| @@assert( {{ this[0].satisfies == true }} ) | |
| // Dog: class is not relevant to "person stranded" mission | |
| @@assert( {{ this[1].track_id == "T02" }} ) | |
| @@assert( {{ this[1].mission_relevant == false }} ) | |
| } | |
| // Wide net caught person + dog, but mission is about vehicles β both should be irrelevant. | |
| test NeitherPersonNorDogIsVehicle { | |
| functions [AssessDetections] | |
| args { | |
| mission "identify vehicles capable of transporting heavy cargo" | |
| detections [ | |
| { | |
| track_id "T01" | |
| class_label "person" | |
| confidence 0.87 | |
| center_x 0.45 | |
| center_y 0.35 | |
| speed_kph 0.0 | |
| direction "stationary" | |
| }, | |
| { | |
| track_id "T02" | |
| class_label "dog" | |
| confidence 0.72 | |
| center_x 0.52 | |
| center_y 0.40 | |
| speed_kph 0.0 | |
| direction "stationary" | |
| } | |
| ] | |
| frame_image { | |
| file "fixtures/sar_rooftop.jpg" | |
| media_type "image/jpeg" | |
| } | |
| } | |
| @@assert( {{ this|length == 2 }} ) | |
| // Neither person nor dog is a vehicle β both mission_relevant=false | |
| @@assert( {{ this[0].mission_relevant == false }} ) | |
| @@assert( {{ this[1].mission_relevant == false }} ) | |
| @@assert( {{ this[0].satisfies != true }} ) | |
| @@assert( {{ this[1].satisfies != true }} ) | |
| } | |