ObjectDetector¶
- class flash.image.detection.model.ObjectDetector(num_classes=None, labels=None, backbone='resnet18_fpn', head='retinanet', pretrained=True, optimizer='Adam', lr_scheduler=None, learning_rate=None, predict_kwargs=None, **kwargs)[source]¶
The
ObjectDetector
is aTask
for detecting objects in images. For more details, see Object Detection.- Parameters
num_classes¶ (
Optional
[int
]) – The number of object classes.backbone¶ (
Optional
[str
]) – String indicating the backbone CNN architecture to use.head¶ (
Optional
[str
]) – String indicating the head module to use ontop of the backbone.pretrained¶ (
bool
) – Whether the model should be loaded with it’s pretrained weights.optimizer¶ (
TypeVar
(OPTIMIZER_TYPE
,str
,Callable
,Tuple
[str
,Dict
[str
,Any
]],None
)) – Optimizer to use for training.lr_scheduler¶ (
Optional
[TypeVar
(LR_SCHEDULER_TYPE
,str
,Callable
,Tuple
[str
,Dict
[str
,Any
]],Tuple
[str
,Dict
[str
,Any
],Dict
[str
,Any
]],None
)]) – The LR scheduler to use during training.learning_rate¶ (
Optional
[float
]) – The learning rate to use for training.output¶ – The
Output
to use when formatting prediction outputs.predict_kwargs¶ (
Optional
[Dict
]) – dictionary containing parameters that will be used during the prediction phase.kwargs¶ (
Any
) – additional kwargs nessesary for initializing the backbone task
- classmethod available_finetuning_strategies(cls)¶
Returns a list containing the keys of the available Finetuning Strategies.
- classmethod available_lr_schedulers(cls)¶
Returns a list containing the keys of the available LR schedulers.
- classmethod available_optimizers(cls)¶
Returns a list containing the keys of the available Optimizers.
- classmethod available_outputs(cls)¶
Returns the list of available outputs (that can be used during prediction or serving) for this
Task
.Examples
..testsetup:
>>> from flash import Task
>>> print(Task.available_outputs()) ['preds', 'raw']