class_docstr: The ``FaceDetector`` is a :class:`~flash.Task` for detecting faces in images.
  
  For more details, see :ref:`face_detection`.
  
  Args:
      model: a string of :attr`_models`. Defaults to 'lffd_slim'.
      pretrained: Whether the model from fastface should be loaded with it's pretrained weights.
      loss_fn: the function(s) to update the model with. Has no effect for fastface models.
      metrics: The provided metrics. All metrics here will be logged to progress bar and the respective logger.
          Changing this argument currently has no effect.
      optimizer: Optimizer to use for training.
      lr_scheduler: The LR scheduler to use during training.
      learning_rate: The learning rate to use for training.
      kwargs: additional kwargs nessesary for initializing face detector backbone
code: def __init__(
      self,
      model: str = "lffd_slim",
      pretrained: bool = True,
      loss_fn: LOSS_FN_TYPE = None,
      metrics: METRICS_TYPE = None,
      optimizer: OPTIMIZER_TYPE = "Adam",
      lr_scheduler: LR_SCHEDULER_TYPE = None,
      learning_rate: Optional[float] = None,
      **kwargs: Any,
  ):
      self.save_hyperparameters()
  
      if model in ff.list_pretrained_models():
          model = FaceDetector.get_model(model, pretrained, **kwargs)
      else:
          ValueError(
              model
              + f" is not supported yet, please select one from {ff.list_pretrained_models()}"
          )
  
      super().__init__(
          model=model,
          loss_fn=loss_fn,
          metrics=metrics
          or {
              "AP": ff.metric.AveragePrecision()
          },  # TODO: replace with torch metrics MAP
          learning_rate=learning_rate,
          optimizer=optimizer,
          lr_scheduler=lr_scheduler,
          output_transform=FaceDetectionOutputTransform(),
      )
  
imports: from typing import Any, Iterable, List, Optional, Union
  from torch import Tensor
  from torch.nn import Module
  from flash.core.data.io.input import DataKeys
  from flash.core.model import Task
  from flash.core.utilities.imports import _FASTFACE_AVAILABLE
  from flash.core.utilities.stability import beta
  from flash.core.utilities.types import LOSS_FN_TYPE, LR_SCHEDULER_TYPE, METRICS_TYPE, OPTIMIZER_TYPE
  from flash.image.face_detection.backbones import FACE_DETECTION_BACKBONES
  from flash.image.face_detection.output_transform import FaceDetectionOutputTransform
label_desc: Use image node_id 1 to create a new FaceDetector object from inherited base classes: Task with example: obj = FaceDetector(model, pretrained, loss_fn, metrics, optimizer, lr_scheduler, learning_rate)