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


Python preprocessor.retain_boxes_above_threshold方法代碼示例

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


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

示例1: testRetainBoxesAboveThreshold

# 需要導入模塊: from object_detection.core import preprocessor [as 別名]
# 或者: from object_detection.core.preprocessor import retain_boxes_above_threshold [as 別名]
def testRetainBoxesAboveThreshold(self):
    boxes = self.createTestBoxes()
    labels = self.createTestLabels()
    label_scores = self.createTestLabelScores()
    (retained_boxes, retained_labels,
     retained_label_scores) = preprocessor.retain_boxes_above_threshold(
         boxes, labels, label_scores, threshold=0.6)
    with self.test_session() as sess:
      (retained_boxes_, retained_labels_, retained_label_scores_,
       expected_retained_boxes_, expected_retained_labels_,
       expected_retained_label_scores_) = sess.run([
           retained_boxes, retained_labels, retained_label_scores,
           self.expectedBoxesAfterThresholding(),
           self.expectedLabelsAfterThresholding(),
           self.expectedLabelScoresAfterThresholding()])
      self.assertAllClose(
          retained_boxes_, expected_retained_boxes_)
      self.assertAllClose(
          retained_labels_, expected_retained_labels_)
      self.assertAllClose(
          retained_label_scores_, expected_retained_label_scores_) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:23,代碼來源:preprocessor_test.py

示例2: testRetainBoxesAboveThresholdWithMissingScore

# 需要導入模塊: from object_detection.core import preprocessor [as 別名]
# 或者: from object_detection.core.preprocessor import retain_boxes_above_threshold [as 別名]
def testRetainBoxesAboveThresholdWithMissingScore(self):
    boxes = self.createTestBoxes()
    labels = self.createTestLabels()
    label_scores = self.createTestLabelScoresWithMissingScore()
    (retained_boxes, retained_labels,
     retained_label_scores) = preprocessor.retain_boxes_above_threshold(
         boxes, labels, label_scores, threshold=0.6)
    with self.test_session() as sess:
      (retained_boxes_, retained_labels_, retained_label_scores_,
       expected_retained_boxes_, expected_retained_labels_,
       expected_retained_label_scores_) = sess.run([
           retained_boxes, retained_labels, retained_label_scores,
           self.expectedBoxesAfterThresholdingWithMissingScore(),
           self.expectedLabelsAfterThresholdingWithMissingScore(),
           self.expectedLabelScoresAfterThresholdingWithMissingScore()])
      self.assertAllClose(
          retained_boxes_, expected_retained_boxes_)
      self.assertAllClose(
          retained_labels_, expected_retained_labels_)
      self.assertAllClose(
          retained_label_scores_, expected_retained_label_scores_) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:23,代碼來源:preprocessor_test.py

示例3: testRetainBoxesAboveThreshold

# 需要導入模塊: from object_detection.core import preprocessor [as 別名]
# 或者: from object_detection.core.preprocessor import retain_boxes_above_threshold [as 別名]
def testRetainBoxesAboveThreshold(self):
    boxes = self.createTestBoxes()
    labels = self.createTestLabels()
    weights = self.createTestGroundtruthWeights()
    (retained_boxes, retained_labels,
     retained_weights) = preprocessor.retain_boxes_above_threshold(
         boxes, labels, weights, threshold=0.6)
    with self.test_session() as sess:
      (retained_boxes_, retained_labels_, retained_weights_,
       expected_retained_boxes_, expected_retained_labels_,
       expected_retained_weights_) = sess.run([
           retained_boxes, retained_labels, retained_weights,
           self.expectedBoxesAfterThresholding(),
           self.expectedLabelsAfterThresholding(),
           self.expectedLabelScoresAfterThresholding()])
      self.assertAllClose(
          retained_boxes_, expected_retained_boxes_)
      self.assertAllClose(
          retained_labels_, expected_retained_labels_)
      self.assertAllClose(
          retained_weights_, expected_retained_weights_) 
開發者ID:ahmetozlu,項目名稱:vehicle_counting_tensorflow,代碼行數:23,代碼來源:preprocessor_test.py

示例4: testRetainBoxesAboveThresholdWithMultiClassScores

# 需要導入模塊: from object_detection.core import preprocessor [as 別名]
# 或者: from object_detection.core.preprocessor import retain_boxes_above_threshold [as 別名]
def testRetainBoxesAboveThresholdWithMultiClassScores(self):
    boxes = self.createTestBoxes()
    labels = self.createTestLabels()
    weights = self.createTestGroundtruthWeights()
    multiclass_scores = self.createTestMultiClassScores()
    (_, _, _,
     retained_multiclass_scores) = preprocessor.retain_boxes_above_threshold(
         boxes,
         labels,
         weights,
         multiclass_scores=multiclass_scores,
         threshold=0.6)
    with self.test_session() as sess:
      (retained_multiclass_scores_,
       expected_retained_multiclass_scores_) = sess.run([
           retained_multiclass_scores,
           self.expectedMultiClassScoresAfterThresholding()
       ])

      self.assertAllClose(retained_multiclass_scores_,
                          expected_retained_multiclass_scores_) 
開發者ID:ahmetozlu,項目名稱:vehicle_counting_tensorflow,代碼行數:23,代碼來源:preprocessor_test.py

示例5: testRetainBoxesAboveThresholdWithMultiClassScores

# 需要導入模塊: from object_detection.core import preprocessor [as 別名]
# 或者: from object_detection.core.preprocessor import retain_boxes_above_threshold [as 別名]
def testRetainBoxesAboveThresholdWithMultiClassScores(self):
    boxes = self.createTestBoxes()
    labels = self.createTestLabels()
    label_scores = self.createTestLabelScores()
    multiclass_scores = self.createTestMultiClassScores()
    (_, _, _,
     retained_multiclass_scores) = preprocessor.retain_boxes_above_threshold(
         boxes,
         labels,
         label_scores,
         multiclass_scores=multiclass_scores,
         threshold=0.6)
    with self.test_session() as sess:
      (retained_multiclass_scores_,
       expected_retained_multiclass_scores_) = sess.run([
           retained_multiclass_scores,
           self.expectedMultiClassScoresAfterThresholding()
       ])

      self.assertAllClose(retained_multiclass_scores_,
                          expected_retained_multiclass_scores_) 
開發者ID:ambakick,項目名稱:Person-Detection-and-Tracking,代碼行數:23,代碼來源:preprocessor_test.py

示例6: testRetainBoxesAboveThresholdWithMasks

# 需要導入模塊: from object_detection.core import preprocessor [as 別名]
# 或者: from object_detection.core.preprocessor import retain_boxes_above_threshold [as 別名]
def testRetainBoxesAboveThresholdWithMasks(self):
    boxes = self.createTestBoxes()
    labels = self.createTestLabels()
    label_scores = self.createTestLabelScores()
    masks = self.createTestMasks()
    _, _, _, retained_masks = preprocessor.retain_boxes_above_threshold(
        boxes, labels, label_scores, masks, threshold=0.6)
    with self.test_session() as sess:
      retained_masks_, expected_retained_masks_ = sess.run([
          retained_masks, self.expectedMasksAfterThresholding()])

      self.assertAllClose(
          retained_masks_, expected_retained_masks_) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:15,代碼來源:preprocessor_test.py


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