postprocessor
PostProcessor
Processes results from a model, provides support for caching model results and keeping track of tile results in the context of the "source" image
Source code in src/tcd_pipeline/postprocess/postprocessor.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
|
__init__(config, image=None)
Initializes the PostProcessor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
DotMap
|
the configuration |
required |
image
|
DatasetReader
|
input rasterio image |
None
|
Source code in src/tcd_pipeline/postprocess/postprocessor.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
add(results)
Add results to the post processor
Source code in src/tcd_pipeline/postprocess/postprocessor.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
cache_result()
abstractmethod
Store a prediction in the cache
Source code in src/tcd_pipeline/postprocess/postprocessor.py
131 132 133 134 135 136 |
|
initialise(image, warm_start=False)
Initialise the processor for a new image and creates cache folders if required.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image
|
DatasetReader
|
input rasterio image |
required |
warm_start
|
(bool, option)
|
Whether or not to continue from where one left off. Defaults to False to avoid unexpected behaviour. |
False
|
Source code in src/tcd_pipeline/postprocess/postprocessor.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
merge()
abstractmethod
Merge results from overlapping tiles
Source code in src/tcd_pipeline/postprocess/postprocessor.py
116 117 118 119 120 121 |
|
process()
abstractmethod
Processes the stored results into a ProcessedResult object that represents the complete prediction over the tiled input
Source code in src/tcd_pipeline/postprocess/postprocessor.py
123 124 125 126 127 128 129 |
|
setup_cache()
abstractmethod
Initialise the cache. Abstract method, depends on the type of postprocessor (instance, semantic, etc)
Source code in src/tcd_pipeline/postprocess/postprocessor.py
37 38 39 40 41 42 |
|