model.efficientdet

Description

🔲 Scalable and efficient object detection.

class Node(config=None, **kwargs)[source]

Initializes an EfficientDet model to detect bounding boxes from an image.

The EfficientDet node is capable of detecting objects from 80 categories. The table of categories can be found here.

EfficientDet node has five levels of compound coefficient (0 - 4). A higher compound coefficient will scale up all dimensions of the backbone network width, depth, input resolution, feature network, and box/class prediction at the same time, which results in better performance but slower inference time. The default compound coefficient is 0 and can be changed to other values.

Inputs

img (numpy.ndarray): A NumPy array of shape \((height, width, channels)\) containing the image data in BGR format.

Outputs

bboxes (numpy.ndarray): A NumPy array of shape \((N, 4)\) containing normalized bounding box coordinates of \(N\) detected objects. Each bounding box is represented as \((x_1, y_1, x_2, y_2)\) where \((x_1, y_1)\) is the top-left corner and \((x_2, y_2)\) is the bottom-right corner. The order corresponds to bbox_labels and bbox_scores.

bbox_labels (numpy.ndarray): A NumPy array of shape \((N)\) containing strings representing the labels of detected objects. The order corresponds to bboxes and bbox_scores.

bbox_scores (numpy.ndarray): A NumPy array of shape \((N)\) containing confidence scores \([0, 1]\) of detected objects. The order corresponds to bboxes and bbox_labels.

Configs
  • model_type (int) – {0, 1, 2, 3, 4}, default = 0.
    Defines the compound coefficient for EfficientDet.

  • score_threshold (float) – [0, 1], default = 0.3. Bounding boxes with confidence score below the threshold will be discarded.

  • detect (List[Union[int, str]]) – default = [0].
    List of object class names or IDs to be detected. To detect all classes, refer to the tech note.

  • weights_parent_dir (Optional[str]) – default = null.
    Change the parent directory where weights will be stored by replacing null with an absolute path to the desired directory.

References

EfficientDet: Scalable and Efficient Object Detection: https://arxiv.org/abs/1911.09070

Code adapted from https://github.com/xuannianz/EfficientDet.