feat(research): preserve urban geometry pipelines and qualification suites
Preserve offline geometry, marking, replay and evaluation pipelines with source manifests and synthetic tests. Research qualification does not activate these methods as production navigation.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
"""Independent original-pixel whole-object measurements."""
|
||||
import cv2
|
||||
import numpy as np
|
||||
import shapely
|
||||
from arrow_evidence import directional_score
|
||||
import head_observation
|
||||
from observation_checks import branch_evidence
|
||||
|
||||
|
||||
def evidence(poly, kind, parameters, extent, grid, head_grid=None):
|
||||
records = []
|
||||
head_fields=head_observation.fields(grid if head_grid is None else head_grid)
|
||||
points = grid['points']; cell = grid['cell']
|
||||
target = shapely.contains_xy(poly, points[:, 0], points[:, 1]).reshape(grid['size'])
|
||||
for rank, view in enumerate(grid['views']):
|
||||
rgb, allowed, observed, paint = [view[k] for k in ['rgb','allowed','observed','paint']]
|
||||
score = directional_score(rgb, allowed, points, poly, cell=cell, kind=kind, parameters=parameters,
|
||||
observed=observed, paint_override=paint, semantic_extent=extent,
|
||||
alpha_good=allowed)
|
||||
score['branch_identity'] = branch_evidence(paint, allowed, observed, points, poly, kind, parameters)
|
||||
score['head_identity'] = head_observation.measure(head_fields[rank],poly,kind,parameters)
|
||||
near = cv2.dilate(paint.astype('uint8'), cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (5,5))) > 0
|
||||
known = target & allowed & observed
|
||||
score.update(observed_support=float(near[known].mean()) if known.any() else 0.,
|
||||
paint_valid=float(allowed[target].mean()) if target.any() else 0.,
|
||||
paint_coverage=float(observed[target].mean()) if target.any() else 0., rank=rank,
|
||||
surface_policy='visible-plan-xy; ED-span-is-quality-only', source_tiles=view['names'])
|
||||
records.append(score)
|
||||
return records
|
||||
|
||||
Reference in New Issue
Block a user