class_docstr: The ``ObjectDetector`` is a :class:`~flash.Task` for detecting objects in images. For more details, see
  :ref:`object_detection`.
  
  Args:
      num_classes: The number of object classes.
      backbone: String indicating the backbone CNN architecture to use.
      head: String indicating the head module to use ontop of the backbone.
      pretrained: Whether the model should be loaded with it's pretrained weights.
      optimizer: Optimizer to use for training.
      lr_scheduler: The LR scheduler to use during training.
      learning_rate: The learning rate to use for training.
      predict_kwargs: dictionary containing parameters that will be used during the prediction phase.
      kwargs: additional kwargs nessesary for initializing the backbone task
class_docstr_tok: ["The","``","ObjectDetector","``","is","a",":","class",":","`","~flash.Task","`","for","detecting","objects","in","images",".","For","more","details",",","see",":","ref",":","`","object_detection","`",".","Args",":","num_classes",":","The","number","of","object","classes",".","backbone",":","String","indicating","the","backbone","CNN","architecture","to","use",".","head",":","String","indicating","the","head","module","to","use","ontop","of","the","backbone",".","pretrained",":","Whether","the","model","should","be","loaded","with","it","'s","pretrained","weights",".","optimizer",":","Optimizer","to","use","for","training",".","lr_scheduler",":","The","LR","scheduler","to","use","during","training",".","learning_rate",":","The","learning","rate","to","use","for","training",".","predict_kwargs",":","dictionary","containing","parameters","that","will","be","used","during","the","prediction","phase",".","kwargs",":","additional","kwargs","nessesary","for","initializing","the","backbone","task"]
code: def serve(
      self,
      host: str = "127.0.0.1",
      port: int = 8000,
      sanity_check: bool = True,
      input_cls: Optional[Type[ServeInput]] = ImageDeserializer,
      transform: INPUT_TRANSFORM_TYPE = IceVisionInputTransform,
      transform_kwargs: Optional[Dict] = None,
      output: Optional[Union[str, Output]] = None,
  ) -> Composition:
      return super().serve(
          host,
          port,
          sanity_check,
          input_cls,
          transform,
          transform_kwargs,
          output,
      )
  
file_path: lightning-flash/src/flash/image/detection/model.py
imports: from typing import Any, Dict, List, Optional, Type, Union
  from flash.core.adapter import AdapterTask
  from flash.core.data.io.input import ServeInput
  from flash.core.data.io.output import Output
  from flash.core.integrations.icevision.transforms import IceVisionInputTransform
  from flash.core.model import Task
  from flash.core.registry import FlashRegistry
  from flash.core.serve import Composition
  from flash.core.utilities.imports import requires
  from flash.core.utilities.types import INPUT_TRANSFORM_TYPE, LR_SCHEDULER_TYPE, OPTIMIZER_TYPE
  from flash.image.data import ImageDeserializer
  from flash.image.detection.backbones import OBJECT_DETECTION_HEADS
  from flash.image.detection.output import OBJECT_DETECTION_OUTPUTS
label_desc: Use image node_id 5 for calling the ObjectDetector obj's underlying member method code with example usage: obj.serve(host, port, sanity_check, input_cls, transform, transform_kwargs, output) and returns: super