babysister.yolov3_wrapper module

class babysister.yolov3_wrapper.YOLOv3(input_size=[416, 416], max_boxes=30, score_thresh=0.5, iou_thresh=0.5, anchor_path='babysister/YOLOv3_TensorFlow/data/yolo_anchors.txt', class_name_path='babysister/YOLOv3_TensorFlow/data/coco.names', restore_path='babysister/YOLOv3_TensorFlow/data/darknet_weights/yolov3.ckpt', session_config=None)

Bases: object

Wrapper for YOLOv3_TensorFlow.

Parameters:
  • input_size (list of 2 integers, optional) – input image size [width, height].
  • max_boxes (int, optional) – maximum detected bounding boxes.
  • score_thresh (float (from 0 to 1), optional) – confidence score threshold.
  • iou_thresh (float (from 0 to 1), optional) – IOU threshold use for detected boxes Non-Maximum Suppression.
  • anchor_path (str) – anchor file path.
  • class_name_path (str) – class names file path.
  • restore_path (str) – path to folder that contains checkpoints.
  • session_config (tensorflow.ConfigProto, optional) – Detector session config.
detect(input_data)

Returns detections of input_data image.

Parameters:input_data (ndarray) – image (RGB) in format [width, height, channel].
Returns:boxes (Tensor) is boxes coordinate in format [[x0, y0, x1, y1], …]. scores (Tensor) is confidence scores. labels (Tensor) is label indexes.
Return type:[boxes, scores, labels]