tensorflow/models

View on GitHub
research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py

Summary

Maintainability
F
2 wks
Test Coverage

File convolutional_keras_box_predictor_tf2_test.py has 857 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      def test_get_boxes_for_one_aspect_ratio_per_location(self):
        conv_box_predictor = (
            box_predictor_builder.build_convolutional_keras_box_predictor(
                is_training=False,
                num_classes=0,
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 52..81

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 204.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      def test_get_boxes_for_five_aspect_ratios_per_location(self):
        conv_box_predictor = (
            box_predictor_builder.build_convolutional_keras_box_predictor(
                is_training=False,
                num_classes=0,
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 83..111

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 204.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

        def graph_fn(image_features1, image_features2):
          box_predictions = conv_box_predictor([image_features1, image_features2])
          variables.extend(list(conv_box_predictor.variables))
          box_encodings = tf.concat(
              box_predictions[box_predictor.BOX_ENCODINGS], axis=1)
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 563..571
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 629..637
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 705..714
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 771..780
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 849..858

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 86.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

        def graph_fn(image_features1, image_features2):
          box_predictions = conv_box_predictor([image_features1, image_features2])
          variables.extend(list(conv_box_predictor.variables))
          box_encodings = tf.concat(
              box_predictions[box_predictor.BOX_ENCODINGS], axis=1)
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 458..466
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 629..637
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 705..714
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 771..780
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 849..858

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 86.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

        def graph_fn(image_features1, image_features2):
          box_predictions = conv_box_predictor(
              [image_features1, image_features2])
          variables.extend(list(conv_box_predictor.variables))
          box_encodings = tf.concat(
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 458..466
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 563..571
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 629..637
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 771..780
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 849..858

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 86.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

        def graph_fn(image_features1, image_features2):
          box_predictions = conv_box_predictor([image_features1, image_features2])
          variables.extend(list(conv_box_predictor.variables))
          box_encodings = tf.concat(
              box_predictions[box_predictor.BOX_ENCODINGS], axis=1)
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 458..466
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 563..571
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 705..714
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 771..780
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 849..858

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 86.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

        def graph_fn(image_features1, image_features2):
          box_predictions = conv_box_predictor(
              [image_features1, image_features2])
          variables.extend(list(conv_box_predictor.variables))
          box_encodings = tf.concat(
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 458..466
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 563..571
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 629..637
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 705..714
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 771..780

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 86.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

        def graph_fn(image_features1, image_features2):
          box_predictions = conv_box_predictor(
              [image_features1, image_features2])
          variables.extend(list(conv_box_predictor.variables))
          box_encodings = tf.concat(
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 458..466
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 563..571
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 629..637
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 705..714
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 849..858

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 86.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        def graph_fn(image_features):
          box_predictions = conv_box_predictor([image_features])
          variables.extend(list(conv_box_predictor.variables))
          box_encodings = tf.concat(
              box_predictions[box_predictor.BOX_ENCODINGS], axis=1)
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 168..176

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 84.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        def graph_fn(image_features):
          box_predictions = conv_box_predictor([image_features])
          variables.extend(list(conv_box_predictor.variables))
          box_encodings = tf.concat(
              box_predictions[box_predictor.BOX_ENCODINGS], axis=1)
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 217..225

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 84.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

      def _build_conv_hyperparams(self, add_batch_norm=True):
        conv_hyperparams = hyperparams_pb2.Hyperparams()
        conv_hyperparams_text_proto = """
          activation: RELU_6
          regularizer {
    research/object_detection/models/ssd_efficientnet_bifpn_feature_extractor_tf2_test.py on lines 80..107
    research/object_detection/models/ssd_feature_extractor_test.py on lines 38..59

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 58.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        conv_box_predictor = (
            box_predictor_builder
            .build_weight_shared_convolutional_keras_box_predictor(
                is_training=False,
                num_classes=num_classes_without_background,
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 833..841

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 54.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        conv_box_predictor = (
            box_predictor_builder
            .build_weight_shared_convolutional_keras_box_predictor(
                is_training=False,
                num_classes=num_classes_without_background,
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 613..621

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 54.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

        self.execute(graph_fn, [
            np.random.rand(4, 32, 32, 3).astype(np.float32),
            np.random.rand(4, 16, 16, 3).astype(np.float32)
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 573..575
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 639..641
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 716..718
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 782..784
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 860..862

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 51.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

        self.execute(graph_fn, [
            np.random.rand(4, 32, 32, 3).astype(np.float32),
            np.random.rand(4, 16, 16, 3).astype(np.float32)
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 468..470
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 573..575
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 639..641
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 716..718
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 860..862

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 51.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

        self.execute(graph_fn, [
            np.random.rand(4, 32, 32, 3).astype(np.float32),
            np.random.rand(4, 16, 16, 3).astype(np.float32)
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 468..470
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 573..575
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 639..641
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 782..784
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 860..862

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 51.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

        self.execute(graph_fn, [
            np.random.rand(4, 32, 32, 3).astype(np.float32),
            np.random.rand(4, 16, 16, 3).astype(np.float32)
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 468..470
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 639..641
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 716..718
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 782..784
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 860..862

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 51.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

        self.execute(graph_fn, [
            np.random.rand(4, 32, 32, 3).astype(np.float32),
            np.random.rand(4, 16, 16, 3).astype(np.float32)
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 468..470
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 573..575
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 639..641
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 716..718
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 782..784

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 51.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 6 locations. Consider refactoring.
    Open

        self.execute(graph_fn, [
            np.random.rand(4, 32, 32, 3).astype(np.float32),
            np.random.rand(4, 16, 16, 3).astype(np.float32)
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 468..470
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 573..575
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 716..718
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 782..784
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 860..862

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 51.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        conv_box_predictor = (
            box_predictor_builder
            .build_weight_shared_convolutional_keras_box_predictor(
                is_training=False,
                num_classes=num_classes_without_background,
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 548..556

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 47.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        conv_box_predictor = (
            box_predictor_builder
            .build_weight_shared_convolutional_keras_box_predictor(
                is_training=False,
                num_classes=num_classes_without_background,
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 756..764

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 47.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        conv_box_predictor = (
            box_predictor_builder
            .build_weight_shared_convolutional_keras_box_predictor(
                is_training=False,
                num_classes=num_classes_without_background,
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 444..452

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 44.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        conv_box_predictor = (
            box_predictor_builder
            .build_weight_shared_convolutional_keras_box_predictor(
                is_training=False,
                num_classes=num_classes_without_background,
    research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 375..383

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 44.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 15 locations. Consider refactoring.
    Open

      def _build_conv_hyperparams(self):
        conv_hyperparams = hyperparams_pb2.Hyperparams()
        conv_hyperparams_text_proto = """
          activation: RELU_6
          regularizer {
    research/object_detection/models/bidirectional_feature_pyramid_generators_tf2_test.py on lines 37..51
    research/object_detection/models/faster_rcnn_resnet_v1_fpn_keras_feature_extractor_tf2_test.py on lines 31..44
    research/object_detection/models/feature_map_generators_test.py on lines 60..73
    research/object_detection/models/feature_map_generators_test.py on lines 390..403
    research/object_detection/models/keras_models/mobilenet_v1_tf2_test.py on lines 70..91
    research/object_detection/models/keras_models/mobilenet_v2_tf2_test.py on lines 59..80
    research/object_detection/models/keras_models/resnet_v1_tf2_test.py on lines 73..95
    research/object_detection/predictors/heads/keras_box_head_tf2_test.py on lines 31..45
    research/object_detection/predictors/heads/keras_box_head_tf2_test.py on lines 127..141
    research/object_detection/predictors/heads/keras_class_head_tf2_test.py on lines 32..46
    research/object_detection/predictors/heads/keras_class_head_tf2_test.py on lines 130..144
    research/object_detection/predictors/heads/keras_mask_head_tf2_test.py on lines 31..45
    research/object_detection/predictors/heads/keras_mask_head_tf2_test.py on lines 202..216
    research/object_detection/predictors/rfcn_keras_box_predictor_tf2_test.py on lines 32..45

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 39.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

          for key, value in box_predictions.items():
            box_predictions[key] = tf.concat(value, axis=1)
    research/object_detection/predictors/convolutional_box_predictor_tf1_test.py on lines 902..903
    research/object_detection/model_lib_v2.py on lines 828..829

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 34.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

        expected_variable_set = set([
            # Box prediction tower
            ('WeightSharedConvolutionalBoxPredictor/'
             'BoxPredictionTower/conv2d_0/kernel'),
            ('WeightSharedConvolutionalBoxPredictor/'
    research/attention_ocr/python/demo_inference_test.py on lines 54..86
    research/deeplab/common.py on lines 175..207
    research/slim/nets/vgg_test.py on lines 298..329

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 33.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status