Python object_detection.utils.object_detection_evaluation.PascalDetectionEvaluator() Examples

The following are 18 code examples of object_detection.utils.object_detection_evaluation.PascalDetectionEvaluator(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module object_detection.utils.object_detection_evaluation , or try the search function .
Example #1
Source File: object_detection_evaluation_test.py    From Elphas with Apache License 2.0 6 votes vote down vote up
def test_value_error_on_duplicate_images(self):
    categories = [{'id': 1, 'name': 'cat'},
                  {'id': 2, 'name': 'dog'},
                  {'id': 3, 'name': 'elephant'}]
    #  Add groundtruth
    pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
        categories)
    image_key1 = 'img1'
    groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
                                  dtype=float)
    groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
    pascal_evaluator.add_single_ground_truth_image_info(
        image_key1,
        {standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
         standard_fields.InputDataFields.groundtruth_classes:
         groundtruth_class_labels1})
    with self.assertRaises(ValueError):
      pascal_evaluator.add_single_ground_truth_image_info(
          image_key1,
          {standard_fields.InputDataFields.groundtruth_boxes:
           groundtruth_boxes1,
           standard_fields.InputDataFields.groundtruth_classes:
           groundtruth_class_labels1}) 
Example #2
Source File: object_detection_evaluation_test.py    From multilabel-image-classification-tensorflow with MIT License 6 votes vote down vote up
def test_value_error_on_duplicate_images(self):
    categories = [{'id': 1, 'name': 'cat'},
                  {'id': 2, 'name': 'dog'},
                  {'id': 3, 'name': 'elephant'}]
    #  Add groundtruth
    pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
        categories)
    image_key1 = 'img1'
    groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
                                  dtype=float)
    groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
    pascal_evaluator.add_single_ground_truth_image_info(
        image_key1,
        {standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
         standard_fields.InputDataFields.groundtruth_classes:
         groundtruth_class_labels1})
    with self.assertRaises(ValueError):
      pascal_evaluator.add_single_ground_truth_image_info(
          image_key1,
          {standard_fields.InputDataFields.groundtruth_boxes:
           groundtruth_boxes1,
           standard_fields.InputDataFields.groundtruth_classes:
           groundtruth_class_labels1}) 
Example #3
Source File: object_detection_evaluation_test.py    From models with Apache License 2.0 6 votes vote down vote up
def test_value_error_on_duplicate_images(self):
    categories = [{'id': 1, 'name': 'cat'},
                  {'id': 2, 'name': 'dog'},
                  {'id': 3, 'name': 'elephant'}]
    #  Add groundtruth
    pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
        categories)
    image_key1 = 'img1'
    groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
                                  dtype=float)
    groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
    pascal_evaluator.add_single_ground_truth_image_info(
        image_key1,
        {standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
         standard_fields.InputDataFields.groundtruth_classes:
         groundtruth_class_labels1})
    with self.assertRaises(ValueError):
      pascal_evaluator.add_single_ground_truth_image_info(
          image_key1,
          {standard_fields.InputDataFields.groundtruth_boxes:
           groundtruth_boxes1,
           standard_fields.InputDataFields.groundtruth_classes:
           groundtruth_class_labels1}) 
Example #4
Source File: object_detection_evaluation_test.py    From g-tensorflow-models with Apache License 2.0 6 votes vote down vote up
def test_value_error_on_duplicate_images(self):
    categories = [{'id': 1, 'name': 'cat'},
                  {'id': 2, 'name': 'dog'},
                  {'id': 3, 'name': 'elephant'}]
    #  Add groundtruth
    pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
        categories)
    image_key1 = 'img1'
    groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
                                  dtype=float)
    groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
    pascal_evaluator.add_single_ground_truth_image_info(
        image_key1,
        {standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
         standard_fields.InputDataFields.groundtruth_classes:
         groundtruth_class_labels1})
    with self.assertRaises(ValueError):
      pascal_evaluator.add_single_ground_truth_image_info(
          image_key1,
          {standard_fields.InputDataFields.groundtruth_boxes:
           groundtruth_boxes1,
           standard_fields.InputDataFields.groundtruth_classes:
           groundtruth_class_labels1}) 
Example #5
Source File: object_detection_evaluation_test.py    From open-solution-googleai-object-detection with MIT License 6 votes vote down vote up
def test_value_error_on_duplicate_images(self):
    categories = [{'id': 1, 'name': 'cat'},
                  {'id': 2, 'name': 'dog'},
                  {'id': 3, 'name': 'elephant'}]
    #  Add groundtruth
    pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
        categories)
    image_key1 = 'img1'
    groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
                                  dtype=float)
    groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
    pascal_evaluator.add_single_ground_truth_image_info(
        image_key1,
        {standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
         standard_fields.InputDataFields.groundtruth_classes:
         groundtruth_class_labels1})
    with self.assertRaises(ValueError):
      pascal_evaluator.add_single_ground_truth_image_info(
          image_key1,
          {standard_fields.InputDataFields.groundtruth_boxes:
           groundtruth_boxes1,
           standard_fields.InputDataFields.groundtruth_classes:
           groundtruth_class_labels1}) 
Example #6
Source File: object_detection_evaluation_test.py    From MAX-Object-Detector with Apache License 2.0 6 votes vote down vote up
def test_value_error_on_duplicate_images(self):
    categories = [{'id': 1, 'name': 'cat'},
                  {'id': 2, 'name': 'dog'},
                  {'id': 3, 'name': 'elephant'}]
    #  Add groundtruth
    pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
        categories)
    image_key1 = 'img1'
    groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
                                  dtype=float)
    groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
    pascal_evaluator.add_single_ground_truth_image_info(
        image_key1,
        {standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
         standard_fields.InputDataFields.groundtruth_classes:
         groundtruth_class_labels1})
    with self.assertRaises(ValueError):
      pascal_evaluator.add_single_ground_truth_image_info(
          image_key1,
          {standard_fields.InputDataFields.groundtruth_boxes:
           groundtruth_boxes1,
           standard_fields.InputDataFields.groundtruth_classes:
           groundtruth_class_labels1}) 
Example #7
Source File: object_detection_evaluation_test.py    From AniSeg with Apache License 2.0 6 votes vote down vote up
def test_value_error_on_duplicate_images(self):
    categories = [{'id': 1, 'name': 'cat'},
                  {'id': 2, 'name': 'dog'},
                  {'id': 3, 'name': 'elephant'}]
    #  Add groundtruth
    pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
        categories)
    image_key1 = 'img1'
    groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
                                  dtype=float)
    groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
    pascal_evaluator.add_single_ground_truth_image_info(
        image_key1,
        {standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
         standard_fields.InputDataFields.groundtruth_classes:
         groundtruth_class_labels1})
    with self.assertRaises(ValueError):
      pascal_evaluator.add_single_ground_truth_image_info(
          image_key1,
          {standard_fields.InputDataFields.groundtruth_boxes:
           groundtruth_boxes1,
           standard_fields.InputDataFields.groundtruth_classes:
           groundtruth_class_labels1}) 
Example #8
Source File: object_detection_evaluation_test.py    From object_detection_with_tensorflow with MIT License 6 votes vote down vote up
def test_value_error_on_duplicate_images(self):
    categories = [{'id': 1, 'name': 'cat'},
                  {'id': 2, 'name': 'dog'},
                  {'id': 3, 'name': 'elephant'}]
    #  Add groundtruth
    pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
        categories)
    image_key1 = 'img1'
    groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
                                  dtype=float)
    groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
    pascal_evaluator.add_single_ground_truth_image_info(
        image_key1,
        {standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
         standard_fields.InputDataFields.groundtruth_classes:
         groundtruth_class_labels1})
    with self.assertRaises(ValueError):
      pascal_evaluator.add_single_ground_truth_image_info(
          image_key1,
          {standard_fields.InputDataFields.groundtruth_boxes:
           groundtruth_boxes1,
           standard_fields.InputDataFields.groundtruth_classes:
           groundtruth_class_labels1}) 
Example #9
Source File: object_detection_evaluation_test.py    From object_detection_with_tensorflow with MIT License 6 votes vote down vote up
def test_value_error_on_duplicate_images(self):
    categories = [{'id': 1, 'name': 'cat'},
                  {'id': 2, 'name': 'dog'},
                  {'id': 3, 'name': 'elephant'}]
    #  Add groundtruth
    pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
        categories)
    image_key1 = 'img1'
    groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
                                  dtype=float)
    groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
    pascal_evaluator.add_single_ground_truth_image_info(
        image_key1,
        {standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
         standard_fields.InputDataFields.groundtruth_classes:
         groundtruth_class_labels1})
    with self.assertRaises(ValueError):
      pascal_evaluator.add_single_ground_truth_image_info(
          image_key1,
          {standard_fields.InputDataFields.groundtruth_boxes:
           groundtruth_boxes1,
           standard_fields.InputDataFields.groundtruth_classes:
           groundtruth_class_labels1}) 
Example #10
Source File: object_detection_evaluation_test.py    From vehicle_counting_tensorflow with MIT License 6 votes vote down vote up
def test_value_error_on_duplicate_images(self):
    categories = [{'id': 1, 'name': 'cat'},
                  {'id': 2, 'name': 'dog'},
                  {'id': 3, 'name': 'elephant'}]
    #  Add groundtruth
    pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
        categories)
    image_key1 = 'img1'
    groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
                                  dtype=float)
    groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
    pascal_evaluator.add_single_ground_truth_image_info(
        image_key1,
        {standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
         standard_fields.InputDataFields.groundtruth_classes:
         groundtruth_class_labels1})
    with self.assertRaises(ValueError):
      pascal_evaluator.add_single_ground_truth_image_info(
          image_key1,
          {standard_fields.InputDataFields.groundtruth_boxes:
           groundtruth_boxes1,
           standard_fields.InputDataFields.groundtruth_classes:
           groundtruth_class_labels1}) 
Example #11
Source File: object_detection_evaluation_test.py    From Live-feed-object-device-identification-using-Tensorflow-and-OpenCV with Apache License 2.0 6 votes vote down vote up
def test_value_error_on_duplicate_images(self):
    categories = [{'id': 1, 'name': 'cat'},
                  {'id': 2, 'name': 'dog'},
                  {'id': 3, 'name': 'elephant'}]
    #  Add groundtruth
    pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
        categories)
    image_key1 = 'img1'
    groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
                                  dtype=float)
    groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
    pascal_evaluator.add_single_ground_truth_image_info(
        image_key1,
        {standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
         standard_fields.InputDataFields.groundtruth_classes:
         groundtruth_class_labels1})
    with self.assertRaises(ValueError):
      pascal_evaluator.add_single_ground_truth_image_info(
          image_key1,
          {standard_fields.InputDataFields.groundtruth_boxes:
           groundtruth_boxes1,
           standard_fields.InputDataFields.groundtruth_classes:
           groundtruth_class_labels1}) 
Example #12
Source File: object_detection_evaluation_test.py    From BMW-TensorFlow-Training-GUI with Apache License 2.0 6 votes vote down vote up
def test_value_error_on_duplicate_images(self):
    categories = [{'id': 1, 'name': 'cat'},
                  {'id': 2, 'name': 'dog'},
                  {'id': 3, 'name': 'elephant'}]
    #  Add groundtruth
    pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
        categories)
    image_key1 = 'img1'
    groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
                                  dtype=float)
    groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
    pascal_evaluator.add_single_ground_truth_image_info(
        image_key1,
        {standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
         standard_fields.InputDataFields.groundtruth_classes:
         groundtruth_class_labels1})
    with self.assertRaises(ValueError):
      pascal_evaluator.add_single_ground_truth_image_info(
          image_key1,
          {standard_fields.InputDataFields.groundtruth_boxes:
           groundtruth_boxes1,
           standard_fields.InputDataFields.groundtruth_classes:
           groundtruth_class_labels1}) 
Example #13
Source File: object_detection_evaluation_test.py    From ros_tensorflow with Apache License 2.0 6 votes vote down vote up
def test_value_error_on_duplicate_images(self):
    categories = [{'id': 1, 'name': 'cat'},
                  {'id': 2, 'name': 'dog'},
                  {'id': 3, 'name': 'elephant'}]
    #  Add groundtruth
    pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
        categories)
    image_key1 = 'img1'
    groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
                                  dtype=float)
    groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
    pascal_evaluator.add_single_ground_truth_image_info(
        image_key1,
        {standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
         standard_fields.InputDataFields.groundtruth_classes:
         groundtruth_class_labels1})
    with self.assertRaises(ValueError):
      pascal_evaluator.add_single_ground_truth_image_info(
          image_key1,
          {standard_fields.InputDataFields.groundtruth_boxes:
           groundtruth_boxes1,
           standard_fields.InputDataFields.groundtruth_classes:
           groundtruth_class_labels1}) 
Example #14
Source File: object_detection_evaluation_test.py    From Gun-Detector with Apache License 2.0 6 votes vote down vote up
def test_value_error_on_duplicate_images(self):
    categories = [{'id': 1, 'name': 'cat'},
                  {'id': 2, 'name': 'dog'},
                  {'id': 3, 'name': 'elephant'}]
    #  Add groundtruth
    pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
        categories)
    image_key1 = 'img1'
    groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
                                  dtype=float)
    groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
    pascal_evaluator.add_single_ground_truth_image_info(
        image_key1,
        {standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
         standard_fields.InputDataFields.groundtruth_classes:
         groundtruth_class_labels1})
    with self.assertRaises(ValueError):
      pascal_evaluator.add_single_ground_truth_image_info(
          image_key1,
          {standard_fields.InputDataFields.groundtruth_boxes:
           groundtruth_boxes1,
           standard_fields.InputDataFields.groundtruth_classes:
           groundtruth_class_labels1}) 
Example #15
Source File: object_detection_evaluation_test.py    From Traffic-Rule-Violation-Detection-System with MIT License 6 votes vote down vote up
def test_value_error_on_duplicate_images(self):
    categories = [{'id': 1, 'name': 'cat'},
                  {'id': 2, 'name': 'dog'},
                  {'id': 3, 'name': 'elephant'}]
    #  Add groundtruth
    pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
        categories)
    image_key1 = 'img1'
    groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
                                  dtype=float)
    groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
    pascal_evaluator.add_single_ground_truth_image_info(
        image_key1,
        {standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
         standard_fields.InputDataFields.groundtruth_classes:
         groundtruth_class_labels1})
    with self.assertRaises(ValueError):
      pascal_evaluator.add_single_ground_truth_image_info(
          image_key1,
          {standard_fields.InputDataFields.groundtruth_boxes:
           groundtruth_boxes1,
           standard_fields.InputDataFields.groundtruth_classes:
           groundtruth_class_labels1}) 
Example #16
Source File: object_detection_evaluation_test.py    From yolo_v2 with Apache License 2.0 6 votes vote down vote up
def test_value_error_on_duplicate_images(self):
    categories = [{'id': 1, 'name': 'cat'},
                  {'id': 2, 'name': 'dog'},
                  {'id': 3, 'name': 'elephant'}]
    #  Add groundtruth
    pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
        categories)
    image_key1 = 'img1'
    groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
                                  dtype=float)
    groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
    pascal_evaluator.add_single_ground_truth_image_info(
        image_key1,
        {standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
         standard_fields.InputDataFields.groundtruth_classes:
         groundtruth_class_labels1})
    with self.assertRaises(ValueError):
      pascal_evaluator.add_single_ground_truth_image_info(
          image_key1,
          {standard_fields.InputDataFields.groundtruth_boxes:
           groundtruth_boxes1,
           standard_fields.InputDataFields.groundtruth_classes:
           groundtruth_class_labels1}) 
Example #17
Source File: object_detection_evaluation_test.py    From Person-Detection-and-Tracking with MIT License 6 votes vote down vote up
def test_value_error_on_duplicate_images(self):
    categories = [{'id': 1, 'name': 'cat'},
                  {'id': 2, 'name': 'dog'},
                  {'id': 3, 'name': 'elephant'}]
    #  Add groundtruth
    pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
        categories)
    image_key1 = 'img1'
    groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
                                  dtype=float)
    groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
    pascal_evaluator.add_single_ground_truth_image_info(
        image_key1,
        {standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
         standard_fields.InputDataFields.groundtruth_classes:
         groundtruth_class_labels1})
    with self.assertRaises(ValueError):
      pascal_evaluator.add_single_ground_truth_image_info(
          image_key1,
          {standard_fields.InputDataFields.groundtruth_boxes:
           groundtruth_boxes1,
           standard_fields.InputDataFields.groundtruth_classes:
           groundtruth_class_labels1}) 
Example #18
Source File: object_detection_evaluation_test.py    From ros_people_object_detection_tensorflow with Apache License 2.0 6 votes vote down vote up
def test_value_error_on_duplicate_images(self):
    categories = [{'id': 1, 'name': 'cat'},
                  {'id': 2, 'name': 'dog'},
                  {'id': 3, 'name': 'elephant'}]
    #  Add groundtruth
    pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
        categories)
    image_key1 = 'img1'
    groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
                                  dtype=float)
    groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
    pascal_evaluator.add_single_ground_truth_image_info(
        image_key1,
        {standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
         standard_fields.InputDataFields.groundtruth_classes:
         groundtruth_class_labels1})
    with self.assertRaises(ValueError):
      pascal_evaluator.add_single_ground_truth_image_info(
          image_key1,
          {standard_fields.InputDataFields.groundtruth_boxes:
           groundtruth_boxes1,
           standard_fields.InputDataFields.groundtruth_classes:
           groundtruth_class_labels1})