AFRL/RDE annotation helper functions (sarpy.annotation.afrl_rde)¶
Simple helper functions for constructing the NGA modified AFRL/RDE structure assuming either a known ground truth scenario or inferred analyst truth scenario.
- class sarpy.annotation.afrl_rde.GroundTruthConstructor(collection_info: CollectionInfoType, subcollection_info: SubCollectionInfoType, label_source: LabelSourceType | None = None)¶
Bases:
object
This class is a helper for performing a ground truth construction.
- add_fiducial(the_fiducial: TheFiducialType) None ¶
Adds the given fiducial to the collection.
- Parameters:
the_fiducial (TheFiducialType) –
- add_fiducial_from_arguments(Name: str = None, SerialNumber: str | None = None, FiducialType: str | None = None, GeoLocation: GeoLocationType = None) None ¶
Adds a fiducial to the collection.
- Parameters:
Name (str) –
SerialNumber (None|str) –
FiducialType (None|str) –
GeoLocation (FiducialGeoLocation) –
- add_object(the_object: TheObjectType) None ¶
Adds the given object to the collection.
- Parameters:
the_object (TheObjectType) –
- add_object_from_arguments(SystemName: str = None, SystemComponent: str | None = None, NATOName: str | None = None, Function: str | None = None, Version: str | None = None, DecoyType: str | None = None, SerialNumber: str | None = None, ObjectClass: str = 'Unknown', ObjectSubClass: str = 'Unknown', ObjectTypeClass: str = 'Unknown', ObjectType: str = 'Unknown', ObjectLabel: str = None, Size: SizeType | ndarray | list | tuple | None = None, Orientation: OrientationType = None, Articulation: None | str | StringWithComponentType | List[StringWithComponentType] = None, Configuration: None | str | StringWithComponentType | List[StringWithComponentType] = None, Accessories: str | None = None, PaintScheme: str | None = None, Camouflage: str | None = None, Obscuration: str | None = None, ObscurationPercent: float | None = None, ImageLevelObscuration: str | None = None, GeoLocation: GeoLocationType = None, TargetToClutterRatio: str | None = None, VisualQualityMetric: str | None = None, UnderlyingTerrain: str | None = None, OverlyingTerrain: str | None = None, TerrainTexture: str | None = None, SeasonalCover: str | None = None) None ¶
Adds an object to the collection.
- Parameters:
SystemName (str) –
SystemComponent (None|str) –
NATOName (None|str) –
Function (None|str) –
Version (None|str) –
DecoyType (None|str) –
SerialNumber (None|str) –
ObjectClass (None|str) –
ObjectSubClass (None|str) –
ObjectTypeClass (None|str) –
ObjectType (None|str) –
ObjectLabel (None|str) –
Size (None|SizeType|numpy.ndarray|list|tuple) –
Orientation (OrientationType) –
Articulation (None|str|StringWithCompoundType|List[StringWithCompoundType]) –
Configuration (None|str|StringWithCompoundType|List[StringWithCompoundType]) –
Accessories (None|str) –
PaintScheme (None|str) –
Camouflage (None|str) –
Obscuration (None|str) –
ObscurationPercent (None|float) –
ImageLevelObscuration (None|str) –
GeoLocation (ObjectGeoLocation) –
TargetToClutterRatio (None|str) –
VisualQualityMetric (None|str) –
UnderlyingTerrain (None|str) –
OverlyingTerrain (None|str) –
TerrainTexture (None|str) –
SeasonalCover (None|str) –
- get_final_structure() ResearchType ¶
It is anticipated that this might be reused to localize for a whole series of different sicd files.
Gets a static copy of the constructed AFRL Research structure. This has the provided CollectionInfo and SubCollectionInfo populated. It also has the ObjectInfo and FiducialInfo with the GeoLocation ground truth details that have been provided.
No image location information has been populated, and there are no ImageInfo or SensorInfo populated, because these are independent of ground truth.
- Return type:
- localize_for_sicd(sicd: SICDType, base_sicd_file: str, layover_shift: bool = False, populate_in_periphery: bool = False, include_out_of_range: bool = False, padding_fraction: float | None = 0.05, minimum_pad: int | float = 0, md5_checksum: str | None = None)¶
Localize the AFRL structure for the given sicd structure.
This returns a static copy of the AFRL structure, and this method can be repeatedly applied for a sequence of different sicd files which all apply to the same ground truth scenario.
- Parameters:
sicd (SICDType) –
base_sicd_file (str) –
layover_shift (bool) –
populate_in_periphery (bool) –
include_out_of_range (bool) –
padding_fraction (None|float) –
minimum_pad (int|float) –
md5_checksum (None|str) –
- Return type:
- localize_for_sicd_reader(sicd_reader: SICDReader, layover_shift: bool = False, populate_in_periphery: bool = False, include_out_of_range: bool = False, padding_fraction: float | None = 0.05, minimum_pad: int | float = 0, populate_md5: bool = True)¶
Localize the AFRL structure for the given sicd file.
This returns a static copy of the AFRL structure, and this method can be repeatedly applied for a sequence of different sicd files which all apply to the same ground truth scenario.
- Parameters:
sicd_reader (SICDReader) –
layover_shift (bool) –
populate_in_periphery (bool) –
include_out_of_range (bool) –
padding_fraction (None|float) –
minimum_pad (int|float) –
populate_md5 (bool) –
- Return type:
- class sarpy.annotation.afrl_rde.AnalystTruthConstructor(sicd: SICDType, base_file: str, collection_info: CollectionInfoType, subcollection_info: SubCollectionInfoType, label_source: LabelSourceType | None = None, projection_type: str = 'HAE', proj_kwargs: Dict | None = None, md5_checksum: str | None = None)¶
Bases:
object
This class is a helper for performing an analyst truth construction.
- property image_info: ImageInfoType¶
The basic image info object derived from the sicd
- Type:
- property sensor_info: SensorInfoType¶
The basic sensor info object derived from the sicd.
- Type:
- add_fiducial(the_fiducial: TheFiducialType) None ¶
Adds the given fiducial to the collection. Note that this object will be modified in place.
- Parameters:
the_fiducial (TheFiducialType) –
- add_fiducial_from_arguments(Name: str | None = None, SerialNumber: str | None = None, FiducialType: str | None = None, ImageLocation: ImageLocationType = None)¶
Adds a fiducial to the collection.
- Parameters:
Name (None|str) –
SerialNumber (None|str) –
FiducialType (None|str) –
ImageLocation (FiducialImageLocation) –
- add_object(the_object: TheObjectType, padding_fraction: float | None = 0.05, minimum_pad: int | float = 0)¶
Adds the object to the collection. Note that this object will be modified in place.
- Parameters:
the_object (TheObjectType) –
padding_fraction (None|float) – Default fraction of box dimension by which to pad.
minimum_pad (float|int) – The minimum number of pixels by which to pad for the chip
- add_object_from_arguments(padding_fraction: float = 0.05, minimum_pad: int | float = 0, SystemName: str = None, SystemComponent: str | None = None, NATOName: str | None = None, Function: str | None = None, Version: str | None = None, DecoyType: str | None = None, SerialNumber: str | None = None, ObjectClass: str = 'Unknown', ObjectSubClass: str = 'Unknown', ObjectTypeClass: str = 'Unknown', ObjectType: str = 'Unknown', ObjectLabel: str = None, Size: None | SizeType | ndarray | list | tuple = None, Orientation: OrientationType = None, Articulation: None | str | StringWithComponentType | List[StringWithComponentType] = None, Configuration: None | str | StringWithComponentType | List[StringWithComponentType] = None, Accessories: str | None = None, PaintScheme: str | None = None, Camouflage: str | None = None, Obscuration: str | None = None, ObscurationPercent: float | None = None, ImageLevelObscuration: str | None = None, ImageLocation: ImageLocationType = None, TargetToClutterRatio: str | None = None, VisualQualityMetric: str | None = None, UnderlyingTerrain: str | None = None, OverlyingTerrain: str | None = None, TerrainTexture: str | None = None, SeasonalCover: str | None = None) None ¶
Adds an object to the collection.
- Parameters:
padding_fraction (None|float) – Default fraction of box dimension by which to pad.
minimum_pad (float|int) –
SystemName (str) –
SystemComponent (None|str) –
NATOName (None|str) –
Function (None|str) –
Version (None|str) –
DecoyType (None|str) –
SerialNumber (None|str) –
ObjectClass (None|str) –
ObjectSubClass (None|str) –
ObjectTypeClass (None|str) –
ObjectType (None|str) –
ObjectLabel (None|str) –
Size (None|SizeType|numpy.ndarray|list|tuple) –
Orientation (OrientationType) –
Articulation (None|str|StringWithComponentType|List[StringWithComponentType]) –
Configuration (None|str|StringWithComponentType|List[StringWithComponentType]) –
Accessories (None|str) –
PaintScheme (None|str) –
Camouflage (None|str) –
Obscuration (None|str) –
ObscurationPercent (None|float) –
ImageLevelObscuration (None|str) –
ImageLocation (ObjectImageLocation) –
TargetToClutterRatio (None|str) –
VisualQualityMetric (None|str) –
UnderlyingTerrain (None|str) –
OverlyingTerrain (None|str) –
TerrainTexture (None|str) –
SeasonalCover (None|str) –
- get_final_structure() ResearchType ¶
This is not anticipated to be reused, so the raw progress to date is returned. Care should be taken in modifying the returned structure directly.
- Return type:
- sarpy.annotation.afrl_rde.convert_afrl_to_native(research: ResearchType, include_chip: bool = False) FileLabelCollection ¶
Converts an AFRL structure to a label structure for simple viewing.
- Parameters:
research (ResearchType) –
include_chip (bool) – Include the chip definition in the geometry structure?
- Return type: