當前位置: 首頁>>代碼示例>>Python>>正文


Python model.DetectionModel方法代碼示例

本文整理匯總了Python中object_detection.core.model.DetectionModel方法的典型用法代碼示例。如果您正苦於以下問題:Python model.DetectionModel方法的具體用法?Python model.DetectionModel怎麽用?Python model.DetectionModel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在object_detection.core.model的用法示例。


在下文中一共展示了model.DetectionModel方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: postprocess

# 需要導入模塊: from object_detection.core import model [as 別名]
# 或者: from object_detection.core.model import DetectionModel [as 別名]
def postprocess(self, prediction_dict, **params):
    """Convert predicted output tensors to final detections. Unused.

    Args:
      prediction_dict: a dictionary holding prediction tensors.
      **params: Additional keyword arguments for specific implementations of
        DetectionModel.

    Returns:
      detections: a dictionary with empty fields.
    """
    return {
        'detection_boxes': None,
        'detection_scores': None,
        'detection_classes': None,
        'num_detections': None
    } 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:19,代碼來源:trainer_test.py

示例2: postprocess

# 需要導入模塊: from object_detection.core import model [as 別名]
# 或者: from object_detection.core.model import DetectionModel [as 別名]
def postprocess(self, prediction_dict, true_image_shapes, **params):
    """Convert predicted output tensors to final detections. Unused.

    Args:
      prediction_dict: a dictionary holding prediction tensors.
      true_image_shapes: int32 tensor of shape [batch, 3] where each row is
        of the form [height, width, channels] indicating the shapes
        of true images in the resized images, as resized images can be padded
        with zeros.
      **params: Additional keyword arguments for specific implementations of
        DetectionModel.

    Returns:
      detections: a dictionary with empty fields.
    """
    return {
        'detection_boxes': None,
        'detection_scores': None,
        'detection_classes': None,
        'num_detections': None
    } 
開發者ID:ahmetozlu,項目名稱:vehicle_counting_tensorflow,代碼行數:23,代碼來源:trainer_test.py

示例3: postprocess

# 需要導入模塊: from object_detection.core import model [as 別名]
# 或者: from object_detection.core.model import DetectionModel [as 別名]
def postprocess(self, prediction_dict, true_image_shapes, **params):
        """Convert predicted output tensors to final detections. Unused.

        Args:
          prediction_dict: a dictionary holding prediction tensors.
          true_image_shapes: int32 tensor of shape [batch, 3] where each row is
            of the form [height, width, channels] indicating the shapes
            of true images in the resized images, as resized images can be padded
            with zeros.
          **params: Additional keyword arguments for specific implementations of
            DetectionModel.

        Returns:
          detections: a dictionary with empty fields.
        """
        return {
            'detection_boxes': None,
            'detection_scores': None,
            'detection_classes': None,
            'num_detections': None
        } 
開發者ID:scorelab,項目名稱:Elphas,代碼行數:23,代碼來源:trainer_test.py

示例4: _format_groundtruth_data

# 需要導入模塊: from object_detection.core import model [as 別名]
# 或者: from object_detection.core.model import DetectionModel [as 別名]
def _format_groundtruth_data(self, image_shape):
    """Helper function for preparing groundtruth data for target assignment.

    In order to be consistent with the model.DetectionModel interface,
    groundtruth boxes are specified in normalized coordinates and classes are
    specified as label indices with no assumed background category.  To prepare
    for target assignment, we:
    1) convert boxes to absolute coordinates,
    2) add a background class at class index 0

    Args:
      image_shape: A 1-D int32 tensor of shape [4] representing the shape of the
        input image batch.

    Returns:
      groundtruth_boxlists: A list of BoxLists containing (absolute) coordinates
        of the groundtruth boxes.
      groundtruth_classes_with_background_list: A list of 2-D one-hot
        (or k-hot) tensors of shape [num_boxes, num_classes+1] containing the
        class targets with the 0th index assumed to map to the background class.
    """
    groundtruth_boxlists = [
        box_list_ops.to_absolute_coordinates(
            box_list.BoxList(boxes), image_shape[1], image_shape[2])
        for boxes in self.groundtruth_lists(fields.BoxListFields.boxes)]
    groundtruth_classes_with_background_list = [
        tf.to_float(
            tf.pad(one_hot_encoding, [[0, 0], [1, 0]], mode='CONSTANT'))
        for one_hot_encoding in self.groundtruth_lists(
            fields.BoxListFields.classes)]
    return groundtruth_boxlists, groundtruth_classes_with_background_list 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:33,代碼來源:faster_rcnn_meta_arch.py


注:本文中的object_detection.core.model.DetectionModel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。