predict
Single model prediction logic.
kelp.xgb.inference.predict.PredictConfig
Bases: ConfigBase
XGBoost prediction config
Source code in kelp/xgb/inference/predict.py
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 |
|
kelp.xgb.inference.predict.build_prediction_arg_parser
Builds the base parser for prediction steps.
Returns: An instance of :class:argparse.ArgumentParser
.
Source code in kelp/xgb/inference/predict.py
58 59 60 61 62 63 64 65 66 67 68 69 |
|
kelp.xgb.inference.predict.main
Main entrypoint for running XGBoost inference.
Source code in kelp/xgb/inference/predict.py
174 175 176 177 178 179 180 181 182 |
|
kelp.xgb.inference.predict.parse_args
Parse command line arguments.
Returns: An instance of PredictConfig.
Source code in kelp/xgb/inference/predict.py
72 73 74 75 76 77 78 79 80 81 82 83 84 |
|
kelp.xgb.inference.predict.predict
Runs XGBoost prediction on files in the specified input directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_dir |
Path
|
The input directory. |
required |
model |
XGBClassifier
|
The XGBoost model. |
required |
spectral_indices |
List[str]
|
The list of spectral indices to append to the input image. |
required |
output_dir |
Path
|
The output directory. |
required |
Source code in kelp/xgb/inference/predict.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
|
kelp.xgb.inference.predict.predict_on_single_image
Runs inference on a single satellite image using specified XGBoost model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model |
XGBClassifier
|
The XGBoost model. |
required |
x |
ndarray
|
The array representing the satellite image. |
required |
transforms |
Callable[[Tensor], Tensor]
|
A set of transforms to apply to the input image. |
required |
columns |
List[str]
|
The column names for the input array. |
required |
decision_threshold |
float
|
The decision threshold. |
0.5
|
Source code in kelp/xgb/inference/predict.py
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 |
|
kelp.xgb.inference.predict.run_prediction
Runs the XGBoost inference on specified data directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_dir |
Path
|
The data directory. |
required |
output_dir |
Path
|
The output directory. |
required |
model_dir |
Path
|
The model directory. |
required |
spectral_indices |
List[str]
|
The spectral indices to append to the input image. |
required |
Source code in kelp/xgb/inference/predict.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
|