babysister.runner module

Example usage

babysister.runner.run(framesReader, do_try_reading=False, rois_file='rois.csv', input_size=[416, 416], valid_classes=None, max_boxes=100, score_thresh=0.5, iou_thresh=0.5, max_bb_size_ratio=[1, 1], save_to=None, im_fmt='{:06d}.jpg', log_file=None, delimiter=',', quotechar='"', time_fmt='%Y/%m/%d %H:%M:%S', log_dist=-1, log_save_dist=10, do_show=True, do_show_class=True, winname='Babysister', session_config=None, max_uptime=-1, do_prompt=True)

Objects detecting, online tracking.

Get frames by framesReader, for every gotten frame do detecting, online tracking, save result images, logs.

Parameters:
  • framesReader – (ImagesReader or VideoReader): Get frames as ndarray from a source.
  • do_try_reading (bool, optional) – Whether to continue trying when framesReader raises FrameReadError.
  • rois_file (str, optional) – Path to ROIs data csv file.
  • input_size (list of 2 int, optional) – Input size (width, height) use for OBJ detector initial. Should has same aspect ratio as frame size. None implies frame size.
  • valid_classes (list of str or None, optional) – Only detect these classes, omit others. None implies all possible classes. All possible classes are in “babysister/YOLOv3_TensorFlow/data/coco.names”.
  • 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.
  • max_bb_size_ratio (list of 2 floats (from 0 to 1), optional) – Maximum bounding box size ratio wrt frame size.
  • save_to (str or None, optional) – Path to folder that result images will be saved to. None implies no saving.
  • im_fmt (str, optional) – Frame name format.
  • log_file (str or None, optional) – Path to csv log file. None implies no logging.
  • delimiter (str, optional) – Delimiter of log file and ROIs data file.
  • quotechar (str, optional) – Quote character of log file and ROIs data file.
  • time_fmt (str, optional) – Time format of log file and ROIs data file.
  • log_dist (float, optional) – Time interval (seconds) between logs buffering, result images saving. Negative implies buffering all logs, saving all iamges.
  • log_save_dist (float, optional) – Time interval (seconds) between logs saving.
  • do_show (bool, optional) – Whether to show result window.
  • do_show_class (bool, optional) – Whether to show classes, confidence scores.
  • winname (str, optional) – Result window name.
  • session_config (tensorflow.ConfigProto, optional) – Detector session config.
  • max_uptime (float, optional) – Maximum uptime (seconds). Negative implies infinite.
  • do_prompt (bool, optional) – Whether to prompt when save_to or log_file existed.