geowatch.tasks.dino_detector.building_validator module

Uses the building detector to validate a construction event.

Given a site model:

  • search for the K highest quality images at the start of the sequences.

  • search for the K highest quality images at the end of the sequence.

  • run the building detector on all of the chosen images.

  • test if the site boundary intersects detections in the start images.

  • test if the site boundary intersects detections in the end images.

StartTest | EndTest | Result
----------+---------+-------
    T     |    T    | Reject
----------+---------+-------
    T     |    F    | Reject
----------+---------+-------
    F     |    T    | Accept
----------+---------+-------
    F     |    F    | Reject
----------+---------+-------
    ?     |    T    | Accept
----------+---------+-------
    T     |    ?    | Reject
----------+---------+-------
    ?     |    F    | Reject
----------+---------+-------
    F     |    ?    | Accept
----------+---------+-------

Dataflow:

  • BAS outputs a region model with candidate site summaries

  • We should be given a kwcoco path that indexes all of the data we could look at. In MLOPs this will be a region cropped kwcoco path that indexes existant images on disk. In smartflow this will be a virtual kwcoco file that requires network access.

class geowatch.tasks.dino_detector.building_validator.BuildingValidatorConfig(*args, **kwargs)[source]

Bases: DataConfig

Valid options: []

Parameters:
  • *args – positional arguments for this data config

  • **kwargs – keyword arguments for this data config

default = {'box_isect_threshold': <Value(0.1)>, 'box_score_threshold': <Value(0.01)>, 'end_min_score': <Value(0.1)>, 'input_kwcoco': <Value(None)>, 'input_region': <Value(None)>, 'input_sites': <Value(None)>, 'output_region_fpath': <Value(None)>, 'output_site_manifest_fpath': <Value(None)>, 'output_sites_dpath': <Value(None)>, 'start_max_score': <Value(1.0)>}
geowatch.tasks.dino_detector.building_validator.main(cmdline=1, **kwargs)[source]

Example

>>> # xdoctest: +SKIP
>>> cmdline = 0
>>> kwargs = dict()
>>> main(cmdline=cmdline, **kwargs)
geowatch.tasks.dino_detector.building_validator.make_decisions(output_kwcoco, site_id_to_summary, config)[source]

Make yes/no decision about sites with dino predictions in the kwcoco file.

Returns:

mapping from site-ids to the decision made for it

Return type:

Dict

geowatch.tasks.dino_detector.building_validator.building_in_image_features(coco_img, site_id, config)[source]
exception geowatch.tasks.dino_detector.building_validator.CouldNotValidate[source]

Bases: Exception