Configuration API Reference¶
This contains the API used for configuring various components of Raster Vision pipelines. This serves as the lower-level companion to the discussion of Pipelines and Commands.
rastervision.pipeline¶
-
class
rastervision.pipeline.pipeline_config.
PipelineConfig
¶ Base class for configuring Pipelines.
This should be subclassed to configure new Pipelines.
rastervision.core¶
StatsAnalyzerConfig¶
ClassConfig¶
-
class
rastervision.core.data.
ClassConfig
¶ Configures the class names that are being predicted.
-
colors
¶ Colors used to visualize classes. Can be color strings accepted by matplotlib or RGB tuples. If None, a random color will be auto-generated for each class. Defaults to None.
- Type
Optional[List[Union[List, str]]]
-
null_class
¶ Optional name of class in names to use as the null class. This is used in semantic segmentation to represent the label for imagery pixels that are NODATA or that are missing a label. If None, and this Config is part of a SemanticSegmentationConfig, a null class will be added automatically. Defaults to None.
- Type
Optional[str]
-
DatasetConfig¶
-
class
rastervision.core.data.
DatasetConfig
¶ Config for a Dataset comprising the scenes for train, valid, and test splits.
-
class_config
¶ - Type
-
train_scenes
¶ - Type
List[SceneConfig]
-
validation_scenes
¶ - Type
List[SceneConfig]
-
test_scenes
¶ Defaults to [].
- Type
List[SceneConfig]
-
SceneConfig¶
ChipClassificationLabelSourceConfig¶
-
class
rastervision.core.data.label_source.
ChipClassificationLabelSourceConfig
¶ Config for a source of labels for chip classification.
This can be provided explicitly as a grid of cells, or a grid of cells can be inferred from arbitrary polygons.
-
vector_source
¶ - Type
-
ioa_thresh
¶ Minimum IOA of a polygon and cell for that polygon to be a candidate for setting the class_id. Defaults to None.
- Type
Optional[float]
-
use_intersection_over_cell
¶ If True, then use the area of the cell as the denominator in the IOA. Otherwise, use the area of the polygon. Defaults to False.
- Type
-
pick_min_class_id
¶ If True, the class_id for a cell is the minimum class_id of the boxes in that cell. Otherwise, pick the class_id of the box covering the greatest area. Defaults to False.
- Type
-
SemanticSegmentationLabelSourceConfig¶
-
class
rastervision.core.data.label_source.
SemanticSegmentationLabelSourceConfig
¶ Config for a read-only label source for semantic segmentation.
-
raster_source
¶ The labels in the form of rasters.
- Type
Union[None.RasterSourceConfig, None.RasterizedSourceConfig]
-
rgb_class_config
¶ If set, will infer the class_ids for the labels using the colors field. This assumes the labels are stored as RGB rasters. Defaults to None.
- Type
Optional[ClassConfig]
-
ObjectDetectionLabelSourceConfig¶
ChipClassificationGeoJSONStoreConfig¶
-
class
rastervision.core.data.label_store.
ChipClassificationGeoJSONStoreConfig
¶ Config for storage for chip classification predictions.
PolygonVectorOutputConfig¶
BuildingVectorOutputConfig¶
-
class
rastervision.core.data.label_store.
BuildingVectorOutputConfig
¶ Config for vectorized semantic segmentation predictions.
Intended to break up clusters of buildings.
-
uri
¶ URI of vector output. If None, and this Config is part of a SceneConfig and RVPipeline, this field will be auto-generated. Defaults to None.
- Type
Optional[str]
-
denoise
¶ Radius of the structural element used to remove high-frequency signals from the image. Defaults to 0.
- Type
-
min_aspect_ratio
¶ Ratio between length and height (or height and length) of anything that can be considered to be a cluster of buildings. The goal is to distinguish between rows of buildings and (say) a single building. Defaults to 1.618.
- Type
-
min_area
¶ Minimum area of anything that can be considered to be a cluster of buildings. The goal is to distinguish between buildings and artifacts. Defaults to 0.0.
- Type
-
element_width_factor
¶ Width of the structural element used to break building clusters as a fraction of the width of the cluster. Defaults to 0.5.
- Type
-
SemanticSegmentationLabelStoreConfig¶
-
class
rastervision.core.data.label_store.
SemanticSegmentationLabelStoreConfig
¶ Config for storage for semantic segmentation predictions.
Stores class raster as GeoTIFF, and can optionally vectorizes predictions and stores them in GeoJSON files.
-
uri
¶ URI of file with predictions. If None, and this Config is part of a SceneConfig inside an RVPipelineConfig, this fiend will be auto-generated. Defaults to None.
- Type
Optional[str]
-
vector_output
¶ Defaults to [].
- Type
List[VectorOutputConfig]
-
ObjectDetectionGeoJSONStoreConfig¶
-
class
rastervision.core.data.label_store.
ObjectDetectionGeoJSONStoreConfig
¶ Config for storage for object detection predictions.
RasterioSourceConfig¶
-
class
rastervision.core.data.raster_source.
RasterioSourceConfig
¶ -
channel_order
¶ The sequence of channel indices to use when reading imagery. Defaults to None.
- Type
Optional[List[int]]
-
transformers
¶ Defaults to [].
- Type
List[RasterTransformerConfig]
-
RasterizerConfig¶
RasterizedSourceConfig¶
StatsTransformerConfig¶
VectorSourceConfig¶
-
class
rastervision.core.data.vector_source.
VectorSourceConfig
¶ -
default_class_id
¶ The default class_id to use if class cannot be inferred using other mechanisms. If a feature has an inferred class_id of None, then it will be deleted.
- Type
Optional[int]
-
class_id_to_filter
¶ Map from class_id to JSON filter used to infer missing class_ids. Each key should be a class id, and its value should be a boolean expression which is run against the property field for each feature.This allows matching different features to different class ids based on its properties. The expression schema is that described by https://docs.mapbox.com/mapbox-gl-js/style-spec/other/#other-filter. Defaults to None.
- Type
Optional[Dict]
-
line_bufs
¶ This is useful, for example, for buffering lines representing roads so that their width roughly matches the width of roads in the imagery. If None, uses default buffer value of 1. Otherwise, a map from class_id to number of pixels to buffer by. If the buffer value is None, then no buffering will be performed and the LineString or Point won’t get converted to a Polygon. Not converting to Polygon is incompatible with the currently available LabelSources, but may be useful in the future. Defaults to None.
-
GeoJSONVectorSourceConfig¶
-
class
rastervision.core.data.vector_source.
GeoJSONVectorSourceConfig
¶ -
default_class_id
¶ The default class_id to use if class cannot be inferred using other mechanisms. If a feature has an inferred class_id of None, then it will be deleted.
- Type
Optional[int]
-
class_id_to_filter
¶ Map from class_id to JSON filter used to infer missing class_ids. Each key should be a class id, and its value should be a boolean expression which is run against the property field for each feature.This allows matching different features to different class ids based on its properties. The expression schema is that described by https://docs.mapbox.com/mapbox-gl-js/style-spec/other/#other-filter. Defaults to None.
- Type
Optional[Dict]
-
line_bufs
¶ This is useful, for example, for buffering lines representing roads so that their width roughly matches the width of roads in the imagery. If None, uses default buffer value of 1. Otherwise, a map from class_id to number of pixels to buffer by. If the buffer value is None, then no buffering will be performed and the LineString or Point won’t get converted to a Polygon. Not converting to Polygon is incompatible with the currently available LabelSources, but may be useful in the future. Defaults to None.
-
point_bufs
¶ Same as above, but used for buffering Points into Polygons. Defaults to None.
-
ChipClassificationEvaluatorConfig¶
SemanticSegmentationEvaluatorConfig¶
ObjectDetectionEvaluatorConfig¶
ChipClassificationConfig¶
-
class
rastervision.core.rv_pipeline.
ChipClassificationConfig
¶ -
-
rv_config
¶ Used to store serialized RVConfig so pipeline can run in remote environment with the local RVConfig. This should not be set explicitly by users – it is only used by the runner when running a remote pipeline. Defaults to None.
- Type
Optional[dict]
-
plugin_versions
¶ Used to store a mapping of plugin module paths to the latest version number. This should not be set explicitly by users – it is set automatically when serializing and saving the config to disk. Defaults to None.
-
dataset
¶ Dataset containing train, validation, and optional test scenes.
- Type
-
backend
¶ Backend to use for interfacing with ML library.
- Type
BackendConfig
-
evaluators
¶ Evaluators to run during analyzer command. If list is empty the default evaluator is added. Defaults to [].
- Type
List[EvaluatorConfig]
-
analyzers
¶ Analyzers to run during analyzer command. A StatsAnalyzer will be added automatically if any scenes have a RasterTransformer. Defaults to [].
- Type
List[AnalyzerConfig]
-
analyze_uri
¶ URI for output of analyze. If None, will be auto-generated. Defaults to None.
- Type
Optional[str]
-
chip_uri
¶ URI for output of chip. If None, will be auto-generated. Defaults to None.
- Type
Optional[str]
-
train_uri
¶ URI for output of train. If None, will be auto-generated. Defaults to None.
- Type
Optional[str]
-
predict_uri
¶ URI for output of predict. If None, will be auto-generated. Defaults to None.
- Type
Optional[str]
-
SemanticSegmentationWindowMethod¶
SemanticSegmentationChipOptions¶
-
class
rastervision.core.rv_pipeline.
SemanticSegmentationChipOptions
¶ Chipping options for semantic segmentation.
-
window_method
¶ Window method to use for chipping. Defaults to <SemanticSegmentationWindowMethod.sliding: ‘sliding’>.
- Type
enum
-
target_class_ids
¶ List of class ids considered as targets (ie. those to prioritize when creating chips) which is only used in conjunction with the target_count_threshold and negative_survival_probability options. Applies to the random_sample window method. Defaults to None.
- Type
Optional[List[int]]
-
negative_survival_prob
¶ List of class ids considered as targets (ie. those to prioritize when creating chips) which is only used in conjunction with the target_count_threshold and negative_survival_probability options. Applies to the random_sample window method. Defaults to 1.0.
- Type
-
chips_per_scene
¶ Number of chips to generate per scene. Applies to the random_sample window method. Defaults to 1000.
- Type
-
target_count_threshold
¶ Minimum number of pixels covering target_classes that a chip must have. Applies to the random_sample window method. Defaults to 1000.
- Type
-
SemanticSegmentationConfig¶
-
class
rastervision.core.rv_pipeline.
SemanticSegmentationConfig
¶ -
-
rv_config
¶ Used to store serialized RVConfig so pipeline can run in remote environment with the local RVConfig. This should not be set explicitly by users – it is only used by the runner when running a remote pipeline. Defaults to None.
- Type
Optional[dict]
-
plugin_versions
¶ Used to store a mapping of plugin module paths to the latest version number. This should not be set explicitly by users – it is set automatically when serializing and saving the config to disk. Defaults to None.
-
dataset
¶ Dataset containing train, validation, and optional test scenes.
- Type
-
backend
¶ Backend to use for interfacing with ML library.
- Type
BackendConfig
-
evaluators
¶ Evaluators to run during analyzer command. If list is empty the default evaluator is added. Defaults to [].
- Type
List[EvaluatorConfig]
-
analyzers
¶ Analyzers to run during analyzer command. A StatsAnalyzer will be added automatically if any scenes have a RasterTransformer. Defaults to [].
- Type
List[AnalyzerConfig]
-
analyze_uri
¶ URI for output of analyze. If None, will be auto-generated. Defaults to None.
- Type
Optional[str]
-
chip_uri
¶ URI for output of chip. If None, will be auto-generated. Defaults to None.
- Type
Optional[str]
-
train_uri
¶ URI for output of train. If None, will be auto-generated. Defaults to None.
- Type
Optional[str]
-
predict_uri
¶ URI for output of predict. If None, will be auto-generated. Defaults to None.
- Type
Optional[str]
-
eval_uri
¶ URI for output of eval. If None, will be auto-generated. Defaults to None.
- Type
Optional[str]
-
bundle_uri
¶ URI for output of bundle. If None, will be auto-generated. Defaults to None.
- Type
Optional[str]
-
chip_options
¶ Defaults to SemanticSegmentationChipOptions(window_method=<SemanticSegmentationWindowMethod.sliding: ‘sliding’>, target_class_ids=None, negative_survival_prob=1.0, chips_per_scene=1000, target_count_threshold=1000, stride=None, type_hint=’semantic_segmentation_chip_options’).
-
ObjectDetectionWindowMethod¶
ObjectDetectionChipOptions¶
-
class
rastervision.core.rv_pipeline.
ObjectDetectionChipOptions
¶ -
neg_ratio
¶ The ratio of negative chips (those containing no bounding boxes) to positive chips. This can be useful if the statistics of the background is different in positive chips. For example, in car detection, the positive chips will always contain roads, but no examples of rooftops since cars tend to not be near rooftops. Defaults to 1.0.
- Type
-
ioa_thresh
¶ When a box is partially outside of a training chip, it is not clear if (a clipped version) of the box should be included in the chip. If the IOA (intersection over area) of the box with the chip is greater than ioa_thresh, it is included in the chip. Defaults to 0.8.
- Type
-
window_method
¶ Defaults to <ObjectDetectionWindowMethod.chip: ‘chip’>.
- Type
enum
-
ObjectDetectionPredictOptions¶
-
class
rastervision.core.rv_pipeline.
ObjectDetectionPredictOptions
¶ -
merge_thresh
¶ If predicted boxes have an IOA (intersection over area) greater than merge_thresh, then they are merged into a single box during postprocessing. This is needed since the sliding window approach results in some false duplicates. Defaults to 0.5.
- Type
-
ObjectDetectionConfig¶
-
class
rastervision.core.rv_pipeline.
ObjectDetectionConfig
¶ -
-
rv_config
¶ Used to store serialized RVConfig so pipeline can run in remote environment with the local RVConfig. This should not be set explicitly by users – it is only used by the runner when running a remote pipeline. Defaults to None.
- Type
Optional[dict]
-
plugin_versions
¶ Used to store a mapping of plugin module paths to the latest version number. This should not be set explicitly by users – it is set automatically when serializing and saving the config to disk. Defaults to None.
-
dataset
¶ Dataset containing train, validation, and optional test scenes.
- Type
-
backend
¶ Backend to use for interfacing with ML library.
- Type
BackendConfig
-
evaluators
¶ Evaluators to run during analyzer command. If list is empty the default evaluator is added. Defaults to [].
- Type
List[EvaluatorConfig]
-
analyzers
¶ Analyzers to run during analyzer command. A StatsAnalyzer will be added automatically if any scenes have a RasterTransformer. Defaults to [].
- Type
List[AnalyzerConfig]
-
analyze_uri
¶ URI for output of analyze. If None, will be auto-generated. Defaults to None.
- Type
Optional[str]
-
chip_uri
¶ URI for output of chip. If None, will be auto-generated. Defaults to None.
- Type
Optional[str]
-
train_uri
¶ URI for output of train. If None, will be auto-generated. Defaults to None.
- Type
Optional[str]
-
predict_uri
¶ URI for output of predict. If None, will be auto-generated. Defaults to None.
- Type
Optional[str]
-
eval_uri
¶ URI for output of eval. If None, will be auto-generated. Defaults to None.
- Type
Optional[str]
-
bundle_uri
¶ URI for output of bundle. If None, will be auto-generated. Defaults to None.
- Type
Optional[str]
-
chip_options
¶ Defaults to ObjectDetectionChipOptions(neg_ratio=1.0, ioa_thresh=0.8, window_method=<ObjectDetectionWindowMethod.chip: ‘chip’>, label_buffer=None, type_hint=’object_detection_chip_options’).
-
predict_options
¶ Defaults to ObjectDetectionPredictOptions(merge_thresh=0.5, score_thresh=0.5, type_hint=’object_detection_predict_options’).
-
rastervision.pytorch_backend¶
PyTorchChipClassificationConfig¶
-
class
rastervision.pytorch_backend.
PyTorchChipClassificationConfig
¶ -
model
¶
-
solver
¶ - Type
-
run_tensorboard
¶ If True, run Tensorboard server pointing at log files. Defaults to False.
- Type
-
PyTorchSemanticSegmentationConfig¶
-
class
rastervision.pytorch_backend.
PyTorchSemanticSegmentationConfig
¶ -
model
¶
-
solver
¶ - Type
-
run_tensorboard
¶ If True, run Tensorboard server pointing at log files. Defaults to False.
- Type
-
PyTorchObjectDetectionConfig¶
-
class
rastervision.pytorch_backend.
PyTorchObjectDetectionConfig
¶ -
model
¶
-
solver
¶ - Type
-
run_tensorboard
¶ If True, run Tensorboard server pointing at log files. Defaults to False.
- Type
-
rastervision.pytorch_learner¶
Backbone¶
-
class
rastervision.pytorch_learner.
Backbone
¶ An enumeration.
-
alexnet
= 'alexnet'¶
-
densenet121
= 'densenet121'¶
-
densenet161
= 'densenet161'¶
-
densenet169
= 'densenet169'¶
-
densenet201
= 'densenet201'¶
-
googlenet
= 'googlenet'¶
-
inception_v3
= 'inception_v3'¶
-
int_to_str
= <function Backbone.int_to_str>¶
-
mnasnet0_5
= 'mnasnet0_5'¶
-
mnasnet0_75
= 'mnasnet0_75'¶
-
mnasnet1_0
= 'mnasnet1_0'¶
-
mnasnet1_3
= 'mnasnet1_3'¶
-
mobilenet_v2
= 'mobilenet_v2'¶
-
resnet101
= 'resnet101'¶
-
resnet152
= 'resnet152'¶
-
resnet18
= 'resnet18'¶
-
resnet34
= 'resnet34'¶
-
resnet50
= 'resnet50'¶
-
resnext101_32x8d
= 'resnext101_32x8d'¶
-
resnext50_32x4d
= 'resnext50_32x4d'¶
-
shufflenet_v2_x0_5
= 'shufflenet_v2_x0_5'¶
-
shufflenet_v2_x1_0
= 'shufflenet_v2_x1_0'¶
-
shufflenet_v2_x1_5
= 'shufflenet_v2_x1_5'¶
-
shufflenet_v2_x2_0
= 'shufflenet_v2_x2_0'¶
-
squeezenet1_0
= 'squeezenet1_0'¶
-
squeezenet1_1
= 'squeezenet1_1'¶
-
vgg11
= 'vgg11'¶
-
vgg11_bn
= 'vgg11_bn'¶
-
vgg13
= 'vgg13'¶
-
vgg13_bn
= 'vgg13_bn'¶
-
vgg16
= 'vgg16'¶
-
vgg16_bn
= 'vgg16_bn'¶
-
vgg19
= 'vgg19'¶
-
vgg19_bn
= 'vgg19_bn'¶
-
wide_resnet101_2
= 'wide_resnet101_2'¶
-
wide_resnet50_2
= 'wide_resnet50_2'¶
-
SolverConfig¶
-
class
rastervision.pytorch_learner.
SolverConfig
¶ Config related to solver aka optimizer.
-
lr
¶ Learning rate. Defaults to 0.0001.
- Type
PositiveFloat
-
num_epochs
¶ Number of epochs (ie. sweeps through the whole training set). Defaults to 10.
- Type
PositiveInt
-
test_num_epochs
¶ Number of epochs to use in test mode. Defaults to 2.
- Type
PositiveInt
-
test_batch_sz
¶ Batch size to use in test mode. Defaults to 4.
- Type
PositiveInt
-
overfit_num_steps
¶ Number of optimizer steps to use in overfit mode. Defaults to 1.
- Type
PositiveInt
-
sync_interval
¶ The interval in epochs for each sync to the cloud. Defaults to 1.
- Type
PositiveInt
-
batch_sz
¶ Batch size. Defaults to 32.
- Type
PositiveInt
-
one_cycle
¶ If True, use triangular LR scheduler with a single cycle across all epochs with start and end LR being lr/10 and the peak being lr. Defaults to True.
- Type
-
multi_stage
¶ List of epoch indices at which to divide LR by 10. Defaults to [].
- Type
List
-
ClassificationDataFormat¶
ClassificationDataConfig¶
-
class
rastervision.pytorch_learner.
ClassificationDataConfig
¶ -
uri
¶ URI of the dataset. This can be a zip file, a list of zip files, or a directory which contains a set of zip files. Defaults to None.
-
train_sz
¶ If set, the number of training images to use. If fewer images exist, then an exception will be raised. Defaults to None.
- Type
Optional[int]
-
group_uris
¶ This can be set instead of uri in order to specify groups of chips. Each element in the list is expected to be an object of the same form accepted by the uri field. The purpose of separating chips into groups is to be able to use the group_train_sz field. Defaults to None.
-
group_train_sz
¶ If group_uris is set, this can be used to specify the number of chips to use per group. Defaults to None.
- Type
Optional[int]
-
data_format
¶ Defaults to <ClassificationDataFormat.image_folder: ‘image_folder’>.
- Type
enum
-
class_colors
¶ Colors used to display classes. Can be color 3-tuples in list form. Defaults to None.
- Type
Union[NoneType, List[str], List[List]]
-
img_sz
¶ Length of a side of each image in pixels. This is the size to transform it to during training, not the size in the raw dataset. Defaults to 256.
- Type
PositiveInt
-
ClassificationModelConfig¶
ClassificationLearnerConfig¶
-
class
rastervision.pytorch_learner.
ClassificationLearnerConfig
¶ -
model
¶
-
solver
¶ - Type
-
data
¶
-
predict_mode
¶ If True, skips training, loads model, and does final eval. Defaults to False.
- Type
-
test_mode
¶ If True, uses test_num_epochs, test_batch_sz, truncated datasets with only a single batch, image_sz that is cut in half, and num_workers = 0. This is useful for testing that code runs correctly on CPU without multithreading before running full job on GPU. Defaults to False.
- Type
-
overfit_mode
¶ If True, uses half image size, and instead of doing epoch-based training, optimizes the model using a single batch repeatedly for overfit_num_steps number of steps. Defaults to False.
- Type
-
eval_train
¶ If True, runs final evaluation on training set (in addition to test set). Useful for debugging. Defaults to False.
- Type
-
save_model_bundle
¶ If True, saves a model bundle at the end of training which is zip file with model and this LearnerConfig which can be used to make predictions on new images at a later time. Defaults to True.
- Type
-
SemanticSegmentationDataFormat¶
SemanticSegmentationDataConfig¶
-
class
rastervision.pytorch_learner.
SemanticSegmentationDataConfig
¶ -
uri
¶ URI of the dataset. This can be a zip file, a list of zip files, or a directory which contains a set of zip files. Defaults to None.
-
train_sz
¶ If set, the number of training images to use. If fewer images exist, then an exception will be raised. Defaults to None.
- Type
Optional[int]
-
group_uris
¶ This can be set instead of uri in order to specify groups of chips. Each element in the list is expected to be an object of the same form accepted by the uri field. The purpose of separating chips into groups is to be able to use the group_train_sz field. Defaults to None.
-
group_train_sz
¶ If group_uris is set, this can be used to specify the number of chips to use per group. Defaults to None.
- Type
Optional[int]
-
data_format
¶ Defaults to <SemanticSegmentationDataFormat.default: ‘default’>.
- Type
enum
-
class_colors
¶ Colors used to display classes. Can be color 3-tuples in list form. Defaults to None.
- Type
Union[NoneType, List[str], List[List]]
-
img_sz
¶ Length of a side of each image in pixels. This is the size to transform it to during training, not the size in the raw dataset. Defaults to 256.
- Type
PositiveInt
-
SemanticSegmentationModelConfig¶
-
class
rastervision.pytorch_learner.
SemanticSegmentationModelConfig
¶ -
backbone
¶ The torchvision.models backbone to use. At the moment only resnet50 or resnet101 will work. Defaults to <Backbone.resnet50: ‘resnet50’>.
- Type
enum
-
pretrained
¶ If True, use ImageNet weights. If False, use random initialization. Defaults to True.
- Type
-
SemanticSegmentationLearnerConfig¶
-
class
rastervision.pytorch_learner.
SemanticSegmentationLearnerConfig
¶ -
model
¶
-
solver
¶ - Type
-
data
¶
-
predict_mode
¶ If True, skips training, loads model, and does final eval. Defaults to False.
- Type
-
test_mode
¶ If True, uses test_num_epochs, test_batch_sz, truncated datasets with only a single batch, image_sz that is cut in half, and num_workers = 0. This is useful for testing that code runs correctly on CPU without multithreading before running full job on GPU. Defaults to False.
- Type
-
overfit_mode
¶ If True, uses half image size, and instead of doing epoch-based training, optimizes the model using a single batch repeatedly for overfit_num_steps number of steps. Defaults to False.
- Type
-
eval_train
¶ If True, runs final evaluation on training set (in addition to test set). Useful for debugging. Defaults to False.
- Type
-
save_model_bundle
¶ If True, saves a model bundle at the end of training which is zip file with model and this LearnerConfig which can be used to make predictions on new images at a later time. Defaults to True.
- Type
-
ObjectDetectionDataFormat¶
ObjectDetectionDataConfig¶
-
class
rastervision.pytorch_learner.
ObjectDetectionDataConfig
¶ -
uri
¶ URI of the dataset. This can be a zip file, a list of zip files, or a directory which contains a set of zip files. Defaults to None.
-
train_sz
¶ If set, the number of training images to use. If fewer images exist, then an exception will be raised. Defaults to None.
- Type
Optional[int]
-
group_uris
¶ This can be set instead of uri in order to specify groups of chips. Each element in the list is expected to be an object of the same form accepted by the uri field. The purpose of separating chips into groups is to be able to use the group_train_sz field. Defaults to None.
-
group_train_sz
¶ If group_uris is set, this can be used to specify the number of chips to use per group. Defaults to None.
- Type
Optional[int]
-
data_format
¶ Defaults to <ObjectDetectionDataFormat.coco: ‘coco’>.
- Type
enum
-
class_colors
¶ Colors used to display classes. Can be color 3-tuples in list form. Defaults to None.
- Type
Union[NoneType, List[str], List[List]]
-
img_sz
¶ Length of a side of each image in pixels. This is the size to transform it to during training, not the size in the raw dataset. Defaults to 256.
- Type
PositiveInt
-
ObjectDetectionModelConfig¶
-
class
rastervision.pytorch_learner.
ObjectDetectionModelConfig
¶ -
backbone
¶ The torchvision.models backbone to use, which must be in the resnet* family. Defaults to <Backbone.resnet50: ‘resnet50’>.
- Type
enum
-
pretrained
¶ If True, use ImageNet weights. If False, use random initialization. Defaults to True.
- Type
-
ObjectDetectionLearnerConfig¶
-
class
rastervision.pytorch_learner.
ObjectDetectionLearnerConfig
¶ -
model
¶
-
solver
¶ - Type
-
data
¶
-
predict_mode
¶ If True, skips training, loads model, and does final eval. Defaults to False.
- Type
-
test_mode
¶ If True, uses test_num_epochs, test_batch_sz, truncated datasets with only a single batch, image_sz that is cut in half, and num_workers = 0. This is useful for testing that code runs correctly on CPU without multithreading before running full job on GPU. Defaults to False.
- Type
-
overfit_mode
¶ If True, uses half image size, and instead of doing epoch-based training, optimizes the model using a single batch repeatedly for overfit_num_steps number of steps. Defaults to False.
- Type
-
eval_train
¶ If True, runs final evaluation on training set (in addition to test set). Useful for debugging. Defaults to False.
- Type
-
save_model_bundle
¶ If True, saves a model bundle at the end of training which is zip file with model and this LearnerConfig which can be used to make predictions on new images at a later time. Defaults to True.
- Type
-