dacapo.gp.dacapo_create_target
Classes
A Gunpowder node for generating the target from the ground truth |
Module Contents
- class dacapo.gp.dacapo_create_target.DaCapoTargetFilter(predictor: dacapo.experiments.tasks.predictors.Predictor, gt_key: gunpowder.ArrayKey, target_key: gunpowder.ArrayKey | None = None, weights_key: gunpowder.ArrayKey | None = None, mask_key: gunpowder.ArrayKey | None = None)
A Gunpowder node for generating the target from the ground truth
- gt
The dataset to use for generating the target.
- Type:
Array
- target_key
The key with which to provide the target.
- Type:
gp.ArrayKey
- weights_key
The key with which to provide the weights.
- Type:
gp.ArrayKey
- mask_key
The key with which to provide the mask.
- Type:
gp.ArrayKey
- setup()
Set up the provider.
- prepare(request)
Prepare the request.
- process(batch, request)
Process the batch.
Note
This class is a subclass of gunpowder.BatchFilter and is used to generate the target from the ground truth.
- predictor
- gt_key
- target_key
- weights_key
- mask_key
- moving_counts = None
- setup()
Set up the provider. This function sets the provider to provide the target with the given key.
- Raises:
RuntimeError – If the key is already provided.
Examples
>>> target_filter.setup()
- prepare(request)
Prepare the request.
- Parameters:
request (gp.BatchRequest) – The request to prepare.
- Returns:
The dependencies.
- Return type:
deps (gp.BatchRequest)
- Raises:
NotImplementedError – If the target_key is not provided.
Examples
>>> request = gp.BatchRequest() >>> request[gp.ArrayKey("GT")] = gp.ArraySpec(roi=gp.Roi((0, 0, 0), (1, 1, 1))) >>> target_filter.prepare(request)
- process(batch, request)
Process the batch.
- Parameters:
batch (gp.Batch) – The batch to process.
request (gp.BatchRequest) – The request to process.
- Returns:
The output batch.
- Return type:
output (gp.Batch)
Examples
>>> request = gp.BatchRequest() >>> request[gp.ArrayKey("GT")] = gp.ArraySpec(roi=gp.Roi((0, 0, 0), (1, 1, 1))) >>> target_filter.process(batch, request)