tensorflow/models

View on GitHub
research/object_detection/meta_architectures/center_net_meta_arch.py

Summary

Maintainability
F
1 mo
Test Coverage

File center_net_meta_arch.py has 3998 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2020 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

    CenterNetMetaArch has 39 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class CenterNetMetaArch(model.DetectionModel):
      """The CenterNet meta architecture [1].
    
      [1]: https://arxiv.org/abs/1904.07850
      """
    Severity: Minor
    Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 5 hrs to fix

      Function __new__ has 38 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def __new__(cls,
      Severity: Major
      Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 4 hrs to fix

        Function postprocess has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
        Open

          def postprocess(self, prediction_dict, true_image_shapes, **params):
            """Produces boxes given a prediction dict returned by predict().
        
            Although predict returns a list of tensors, only the last tensor in
            each list is used for making box predictions.
        Severity: Minor
        Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function _construct_prediction_heads has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

          def _construct_prediction_heads(self, num_classes, num_feature_outputs,
                                          class_prediction_bias_init,
                                          unit_height_conv=False):
            """Constructs the prediction heads based on the specific parameters.
        
        
        Severity: Minor
        Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 2 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function loss has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

          def loss(
              self, prediction_dict, true_image_shapes, scope=None,
              maximum_normalized_coordinate=1.1):
            """Computes scalar loss tensors with respect to provided groundtruth.
        
        
        Severity: Minor
        Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 2 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function __init__ has 17 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def __init__(self,
        Severity: Major
        Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 2 hrs to fix

          Function refine_keypoints has 14 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def refine_keypoints(regressed_keypoints,

            Function _initialize_target_assigners has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

              def _initialize_target_assigners(self, stride, min_box_overlap_iou):
                """Initializes the target assigners and puts them in a dictionary.
            
                Args:
                  stride: An integer indicating the stride of the image.

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function convert_strided_predictions_to_instance_masks has 11 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def convert_strided_predictions_to_instance_masks(

              Function top_k_feature_map_locations has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              def top_k_feature_map_locations(feature_map, max_pool_kernel_size=3, k=100,
                                              per_channel=False):
                """Returns the top k scores and their locations in a feature map.
              
                Given a feature map, the top k values (based on activation) are returned. If

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function __new__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def __new__(cls,

                Function _postprocess_keypoints_for_class_and_image has 10 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  def _postprocess_keypoints_for_class_and_image(

                  Function __new__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    def __new__(cls,

                    Function make_prediction_net has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def make_prediction_net(num_out_channels, kernel_sizes=(3), num_filters=(256),
                                            bias_fill=None, use_depthwise=False, name=None,
                                            unit_height_conv=True):
                      """Creates a network to predict the given number of output channels.
                    
                    

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function crop_and_threshold_masks has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    def crop_and_threshold_masks(elems, input_height, input_width, mask_height=256,
                                                 mask_width=256, score_threshold=0.5,
                                                 densepose_class_index=-1):
                      """Crops and thresholds masks based on detection boxes.
                    
                    

                      Function __new__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        def __new__(cls,

                        Function __new__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          def __new__(cls,

                          Function refine_keypoints has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def refine_keypoints(regressed_keypoints,
                                               keypoint_candidates,
                                               keypoint_scores,
                                               num_keypoint_candidates,
                                               bboxes=None,
                          Severity: Minor
                          Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 55 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function _gaussian_weighted_map_const_multi has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def _gaussian_weighted_map_const_multi(
                          Severity: Major
                          Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 50 mins to fix

                            Function crop_and_threshold_masks has 7 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def crop_and_threshold_masks(elems, input_height, input_width, mask_height=256,
                            Severity: Major
                            Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 50 mins to fix

                              Function make_prediction_net has 7 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def make_prediction_net(num_out_channels, kernel_sizes=(3), num_filters=(256),
                              Severity: Major
                              Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 50 mins to fix

                                Function _make_prediction_net_list has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                  def _make_prediction_net_list(self, num_feature_outputs, num_out_channels,
                                Severity: Major
                                Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 50 mins to fix

                                  Function _score_to_distance_map has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  def _score_to_distance_map(y_grid, x_grid, heatmap, points_y, points_x,
                                  Severity: Minor
                                  Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 45 mins to fix

                                    Function prediction_to_single_instance_keypoints has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    def prediction_to_single_instance_keypoints(
                                    Severity: Minor
                                    Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 45 mins to fix

                                      Function _scatter_keypoints_to_batch has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                        def _scatter_keypoints_to_batch(self, num_ind, kpt_coords_for_example,
                                      Severity: Minor
                                      Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 45 mins to fix

                                        Function prediction_tensors_to_keypoint_candidates has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                        def prediction_tensors_to_keypoint_candidates(keypoint_heatmap_predictions,
                                        Severity: Minor
                                        Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 45 mins to fix

                                          Function _compute_kp_heatmap_loss has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                            def _compute_kp_heatmap_loss(self, input_height, input_width, task_name,
                                          Severity: Minor
                                          Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 45 mins to fix

                                            Function prediction_to_keypoints_argmax has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                            def prediction_to_keypoints_argmax(
                                            Severity: Minor
                                            Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 45 mins to fix

                                              Function _postprocess_keypoints_multi_class has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                              Open

                                                def _postprocess_keypoints_multi_class(self, prediction_dict, classes,
                                              Severity: Minor
                                              Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 45 mins to fix

                                                Function _postprocess_keypoints_single_class has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                Open

                                                  def _postprocess_keypoints_single_class(self, prediction_dict, classes,
                                                Severity: Minor
                                                Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 45 mins to fix

                                                  Function _compute_kp_depth_loss has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                  Open

                                                    def _compute_kp_depth_loss(self, input_height, input_width, task_name,
                                                  Severity: Minor
                                                  Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 35 mins to fix

                                                    Function _compute_object_detection_losses has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                    Open

                                                      def _compute_object_detection_losses(self, input_height, input_width,
                                                    Severity: Minor
                                                    Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 35 mins to fix

                                                      Function _compute_box_scale_and_offset_loss has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                      Open

                                                        def _compute_box_scale_and_offset_loss(self, input_height, input_width,
                                                      Severity: Minor
                                                      Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 35 mins to fix

                                                        Function __new__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                        Open

                                                          def __new__(cls,
                                                        Severity: Minor
                                                        Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 35 mins to fix

                                                          Function convert_strided_predictions_to_normalized_keypoints has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                          Open

                                                          def convert_strided_predictions_to_normalized_keypoints(
                                                          Severity: Minor
                                                          Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 35 mins to fix

                                                            Function _compute_keypoint_estimation_losses has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                            Open

                                                              def _compute_keypoint_estimation_losses(self, task_name, input_height,
                                                            Severity: Minor
                                                            Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 35 mins to fix

                                                              Function _compute_kp_offset_loss has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                              Open

                                                                def _compute_kp_offset_loss(self, input_height, input_width, task_name,
                                                              Severity: Minor
                                                              Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 35 mins to fix

                                                                Function _compute_object_center_loss has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                Open

                                                                  def _compute_object_center_loss(self, input_height, input_width,
                                                                Severity: Minor
                                                                Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 35 mins to fix

                                                                  Function _compute_kp_regression_loss has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                  Open

                                                                    def _compute_kp_regression_loss(self, input_height, input_width, task_name,
                                                                  Severity: Minor
                                                                  Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 35 mins to fix

                                                                    Function _postprocess_keypoints_multi_class has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                      def _postprocess_keypoints_multi_class(self, prediction_dict, classes,
                                                                                                             y_indices, x_indices, boxes,
                                                                                                             num_detections):
                                                                        """Performs postprocessing on keypoint predictions.
                                                                    
                                                                    
                                                                    Severity: Minor
                                                                    Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 35 mins to fix

                                                                    Cognitive Complexity

                                                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                                    A method's cognitive complexity is based on a few simple rules:

                                                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                                    • Code is considered more complex for each "break in the linear flow of the code"
                                                                    • Code is considered more complex when "flow breaking structures are nested"

                                                                    Further reading

                                                                    Function prediction_tensors_to_keypoint_candidates has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                    def prediction_tensors_to_keypoint_candidates(keypoint_heatmap_predictions,
                                                                                                                  keypoint_heatmap_offsets,
                                                                                                                  keypoint_score_threshold=0.1,
                                                                                                                  max_pool_kernel_size=1,
                                                                                                                  max_candidates=20,
                                                                    Severity: Minor
                                                                    Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 25 mins to fix

                                                                    Cognitive Complexity

                                                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                                    A method's cognitive complexity is based on a few simple rules:

                                                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                                    • Code is considered more complex for each "break in the linear flow of the code"
                                                                    • Code is considered more complex when "flow breaking structures are nested"

                                                                    Further reading

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

                                                                    def _pad_to_full_instance_dim(keypoint_coords, keypoint_scores, instance_inds,
                                                                                                  max_instances):
                                                                      """Scatter keypoint elements into tensors with full instance dimension.
                                                                    
                                                                      Args:
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 1496..1532

                                                                    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 162.

                                                                    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 _pad_to_full_keypoint_dim(keypoint_coords, keypoint_scores, keypoint_inds,
                                                                                                  num_total_keypoints):
                                                                      """Scatter keypoint elements into tensors with full keypoints dimension.
                                                                    
                                                                      Args:
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 1535..1571

                                                                    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 162.

                                                                    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

                                                                      keypoint_candidates = tf.stack([
                                                                          tf.cast(y_indices, dtype=tf.float32) + tf.expand_dims(y_offsets, axis=0),
                                                                          tf.cast(x_indices, dtype=tf.float32) + tf.expand_dims(x_offsets, axis=0)
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 973..975

                                                                    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 74.

                                                                    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

                                                                      keypoint_candidates = tf.stack([
                                                                          tf.cast(y_indices, dtype=tf.float32) + tf.expand_dims(y_offsets, axis=0),
                                                                          tf.cast(x_indices, dtype=tf.float32) + tf.expand_dims(x_offsets, axis=0)
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 672..674

                                                                    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 74.

                                                                    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

                                                                        if self._temporal_offset_params is not None:
                                                                          offset_losses = self._compute_temporal_offset_loss(
                                                                              input_height=input_height,
                                                                              input_width=input_width,
                                                                              prediction_dict=prediction_dict)
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 4008..4016
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 4018..4026

                                                                    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 73.

                                                                    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

                                                                        if self._track_params is not None:
                                                                          track_losses = self._compute_track_losses(
                                                                              input_height=input_height,
                                                                              input_width=input_width,
                                                                              prediction_dict=prediction_dict)
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 4008..4016
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 4028..4036

                                                                    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 73.

                                                                    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

                                                                        if self._densepose_params is not None:
                                                                          densepose_losses = self._compute_densepose_losses(
                                                                              input_height=input_height,
                                                                              input_width=input_width,
                                                                              prediction_dict=prediction_dict)
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 4018..4026
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 4028..4036

                                                                    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 73.

                                                                    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

                                                                          tf.math.logical_and(
                                                                              tf.reshape(x_grid, [height, width, 1]) >= tf.reshape(
                                                                                  x_min, [1, 1, num_instances]),
                                                                              tf.reshape(x_grid, [height, width, 1]) < tf.reshape(
                                                                                  x_max, [1, 1, num_instances])))
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 885..889

                                                                    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 66.

                                                                    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

                                                                          tf.math.logical_and(
                                                                              tf.reshape(y_grid, [height, width, 1]) >= tf.reshape(
                                                                                  y_min, [1, 1, num_instances]),
                                                                              tf.reshape(y_grid, [height, width, 1]) < tf.reshape(
                                                                                  y_max, [1, 1, num_instances])),
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 890..894

                                                                    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 66.

                                                                    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

                                                                            if kp_params.per_keypoint_offset:
                                                                              prediction_heads[get_keypoint_name(
                                                                                  task_name, KEYPOINT_OFFSET)] = self._make_prediction_net_list(
                                                                                      num_feature_outputs,
                                                                                      NUM_OFFSET_CHANNELS * num_keypoints,
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 2884..2889

                                                                    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 46.

                                                                    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

                                                                      mask_w = tf.cast(
                                                                          tf.range(data_shape[2]) < true_image_shapes[:, tf.newaxis, 1],
                                                                          tf.float32)
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 2126..2128

                                                                    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 46.

                                                                    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

                                                                            prediction_heads[get_keypoint_name(
                                                                                task_name, KEYPOINT_REGRESSION)] = self._make_prediction_net_list(
                                                                                    num_feature_outputs,
                                                                                    NUM_OFFSET_CHANNELS * num_keypoints,
                                                                                    kernel_sizes=kp_params.regress_head_kernel_sizes,
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 2893..2899

                                                                    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 46.

                                                                    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

                                                                      mask_h = tf.cast(
                                                                          tf.range(data_shape[1]) < true_image_shapes[:, tf.newaxis, 0],
                                                                          tf.float32)
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 2129..2131

                                                                    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 46.

                                                                    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 6 locations. Consider refactoring.
                                                                    Open

                                                                      combined_indices = tf.stack([
                                                                          _multi_range(batch_size, value_repetitions=num_indices),
                                                                          tf.reshape(y_indices, [-1]),
                                                                          tf.reshape(x_indices, [-1])
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 397..400
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 453..456
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 522..525
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 652..655
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 1111..1114

                                                                    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 45.

                                                                    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 6 locations. Consider refactoring.
                                                                    Open

                                                                      combined_indices = tf.stack([
                                                                          _multi_range(batch_size, value_repetitions=num_instances),
                                                                          tf.reshape(y_indices, [-1]),
                                                                          tf.reshape(x_indices, [-1])
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 397..400
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 453..456
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 522..525
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 652..655
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 792..795

                                                                    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 45.

                                                                    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 6 locations. Consider refactoring.
                                                                    Open

                                                                      combined_indices = tf.stack([
                                                                          _multi_range(batch_size, value_repetitions=num_boxes),
                                                                          tf.reshape(y_indices, [-1]),
                                                                          tf.reshape(x_indices, [-1])
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 397..400
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 522..525
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 652..655
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 792..795
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 1111..1114

                                                                    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 45.

                                                                    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 6 locations. Consider refactoring.
                                                                    Open

                                                                      combined_indices = tf.stack([
                                                                          _multi_range(batch_size, value_repetitions=num_keypoints),
                                                                          tf.reshape(y_indices, [-1]),
                                                                          tf.reshape(x_indices, [-1]),
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 397..400
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 453..456
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 522..525
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 792..795
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 1111..1114

                                                                    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 45.

                                                                    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 6 locations. Consider refactoring.
                                                                    Open

                                                                      combined_indices = tf.stack([
                                                                          _multi_range(batch_size, value_repetitions=num_boxes),
                                                                          tf.reshape(y_indices, [-1]),
                                                                          tf.reshape(x_indices, [-1])
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 453..456
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 522..525
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 652..655
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 792..795
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 1111..1114

                                                                    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 45.

                                                                    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 6 locations. Consider refactoring.
                                                                    Open

                                                                      combined_indices = tf.stack([
                                                                          _multi_range(batch_size, value_repetitions=num_indices),
                                                                          tf.reshape(y_indices, [-1]),
                                                                          tf.reshape(x_indices, [-1])
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 397..400
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 453..456
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 652..655
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 792..795
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 1111..1114

                                                                    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 45.

                                                                    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

                                                                        loss = tf.reduce_sum(loss) / (
                                                                            float(len(depth_predictions)) *
                                                                            tf.maximum(tf.reduce_sum(batch_weights), 1.0))
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 3360..3362
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 3413..3415

                                                                    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 3 locations. Consider refactoring.
                                                                    Open

                                                                        loss = tf.reduce_sum(loss) / (
                                                                            float(len(offset_predictions)) *
                                                                            tf.maximum(tf.reduce_sum(batch_weights), 1.0))
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 3413..3415
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 3472..3474

                                                                    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 3 locations. Consider refactoring.
                                                                    Open

                                                                        loss = tf.reduce_sum(loss) / (
                                                                            float(len(regression_predictions)) *
                                                                            tf.maximum(tf.reduce_sum(batch_weights), 1.0))
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 3360..3362
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 3472..3474

                                                                    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

                                                                          combined_indices = tf.stack([
                                                                              _multi_range(batch_size, value_repetitions=num_indices),
                                                                              _multi_range(num_indices, range_repetitions=batch_size),
                                                                              tf.reshape(channel_indices, [-1])
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 547..550

                                                                    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

                                                                        if self._bgr_ordering:
                                                                          red, green, blue = tf.unstack(inputs, axis=3)
                                                                          inputs = tf.stack([blue, green, red], axis=3)
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 127..129

                                                                    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

                                                                        if self._bgr_ordering:
                                                                          blue, green, red = tf.unstack(inputs, axis=3)
                                                                          inputs = tf.stack([red, green, blue], axis=3)
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 96..98

                                                                    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

                                                                        channel_combined_indices = tf.stack([
                                                                            _multi_range(batch_size, value_repetitions=num_indices),
                                                                            _multi_range(num_indices, range_repetitions=batch_size),
                                                                            tf.reshape(channel_indices, [-1])
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 579..582

                                                                    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

                                                                            tf.logical_and(keypoint_coords_normalized[:, :, :, 0] >= 0.0,
                                                                                           keypoint_coords_normalized[:, :, :, 0] <= 1.0),
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 1840..1841

                                                                    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 42.

                                                                    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

                                                                            tf.logical_and(keypoint_coords_normalized[:, :, :, 1] >= 0.0,
                                                                                           keypoint_coords_normalized[:, :, :, 1] <= 1.0))
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 1838..1839

                                                                    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 42.

                                                                    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

                                                                        return super(KeypointEstimationParams, cls).__new__(
                                                                            cls, task_name, class_id, keypoint_indices, classification_loss,
                                                                            localization_loss, keypoint_labels, keypoint_std_dev,
                                                                            keypoint_heatmap_loss_weight, keypoint_offset_loss_weight,
                                                                            keypoint_regression_loss_weight, keypoint_candidate_score_threshold,
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 2223..2261

                                                                    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 40.

                                                                    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 __new__(cls,
                                                                                  task_name,
                                                                                  class_id,
                                                                                  keypoint_indices,
                                                                                  classification_loss,
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 2372..2387

                                                                    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 40.

                                                                    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

                                                                                cn_assigner.CenterNetKeypointTargetAssigner(
                                                                                    stride=stride,
                                                                                    class_id=kp_params.class_id,
                                                                                    keypoint_indices=kp_params.keypoint_indices,
                                                                                    keypoint_std_dev=kp_params.keypoint_std_dev,
                                                                    official/legacy/xlnet/xlnet_config.py on lines 25..33

                                                                    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 2 locations. Consider refactoring.
                                                                    Open

                                                                          prediction_heads[BOX_OFFSET] = self._make_prediction_net_list(
                                                                              num_feature_outputs,
                                                                              NUM_OFFSET_CHANNELS,
                                                                              kernel_sizes=self._od_params.offset_head_kernel_sizes,
                                                                              num_filters=self._od_params.offset_head_num_filters,
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 2857..2861

                                                                    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 2 locations. Consider refactoring.
                                                                    Open

                                                                        collections.namedtuple('KeypointEstimationParams', [
                                                                            'task_name', 'class_id', 'keypoint_indices', 'classification_loss',
                                                                            'localization_loss', 'keypoint_labels', 'keypoint_std_dev',
                                                                            'keypoint_heatmap_loss_weight', 'keypoint_offset_loss_weight',
                                                                            'keypoint_regression_loss_weight', 'keypoint_candidate_score_threshold',
                                                                    research/slim/nets/vgg_test.py on lines 493..531

                                                                    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 2 locations. Consider refactoring.
                                                                    Open

                                                                          prediction_heads[BOX_SCALE] = self._make_prediction_net_list(
                                                                              num_feature_outputs,
                                                                              NUM_SIZE_CHANNELS,
                                                                              kernel_sizes=self._od_params.scale_head_kernel_sizes,
                                                                              num_filters=self._od_params.scale_head_num_filters,
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 2864..2868

                                                                    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 2 locations. Consider refactoring.
                                                                    Open

                                                                      combined_obj_indices = tf.stack([
                                                                          tf.reshape(object_y_indices, [-1]),
                                                                          tf.reshape(object_x_indices, [-1])
                                                                    official/projects/centernet/ops/nms_ops.py on lines 54..54

                                                                    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 36.

                                                                    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

                                                                      x_diff = (
                                                                          tf.reshape(x_grid, [height, width, 1, 1]) -
                                                                          tf.reshape(points_x, [1, 1, num_instances, num_keypoints]))
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 872..874

                                                                    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 35.

                                                                    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

                                                                      y_diff = (
                                                                          tf.reshape(y_grid, [height, width, 1, 1]) -
                                                                          tf.reshape(points_y, [1, 1, num_instances, num_keypoints]))
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 875..877

                                                                    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 35.

                                                                    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

                                                                        if channel_stds is None or len(channel_stds) == 0:  # pylint:disable=g-explicit-length-test
                                                                          channel_stds = [1., 1., 1.]
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 71..72

                                                                    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 2 locations. Consider refactoring.
                                                                    Open

                                                                        if channel_means is None or len(channel_means) == 0:  # pylint:disable=g-explicit-length-test
                                                                          channel_means = [0., 0., 0.]
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 74..75

                                                                    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 3 locations. Consider refactoring.
                                                                    Open

                                                                          depth_loss = self._compute_kp_depth_loss(
                                                                              input_height=input_height,
                                                                              input_width=input_width,
                                                                              task_name=task_name,
                                                                              depth_predictions=prediction_dict[depth_key],
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 3222..3227
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 3228..3233

                                                                    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

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

                                                                      part_heatmap_4d = tf.tile(part_heatmap[tf.newaxis, :, :, :],
                                                                                                multiples=[num_classes, 1, 1, 1])
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 1996..1997
                                                                    research/object_detection/models/keras_models/nonlocal_block.py on lines 87..88

                                                                    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

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

                                                                        offset_loss = self._compute_kp_offset_loss(
                                                                            input_height=input_height,
                                                                            input_width=input_width,
                                                                            task_name=task_name,
                                                                            offset_predictions=prediction_dict[offset_key],
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 3228..3233
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 3243..3248

                                                                    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

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

                                                                        reg_loss = self._compute_kp_regression_loss(
                                                                            input_height=input_height,
                                                                            input_width=input_width,
                                                                            task_name=task_name,
                                                                            regression_predictions=prediction_dict[regression_key],
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 3222..3227
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 3243..3248

                                                                    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

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

                                                                      surf_coords_4d = tf.tile(surf_coords[tf.newaxis, :, :, :],
                                                                                               multiples=[num_classes, 1, 1, 1])
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 1994..1995
                                                                    research/object_detection/models/keras_models/nonlocal_block.py on lines 87..88

                                                                    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

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

                                                                      y_regressed = tf.cast(
                                                                          tf.reshape(object_y_indices, [num_instances, 1]),
                                                                          dtype=tf.float32) + y_reg
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 1060..1062

                                                                    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

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

                                                                      x_regressed = tf.cast(
                                                                          tf.reshape(object_x_indices, [num_instances, 1]),
                                                                          dtype=tf.float32) + x_reg
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 1057..1059

                                                                    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

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

                                                                        (keypoint_heatmap, num_instances_per_kp_type,
                                                                         valid_mask_batch) = assigner.assign_keypoint_heatmap_targets(
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 3390..3391
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 3750..3751

                                                                    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 32.

                                                                    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

                                                                        (batch_indices, batch_offset_targets,
                                                                         batch_weights) = assigner.assign_temporal_offset_targets(
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 3280..3281
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 3390..3391

                                                                    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 32.

                                                                    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

                                                                        (batch_indices, batch_regression_offsets,
                                                                         batch_weights) = assigner.assign_joint_regression_targets(
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 3280..3281
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 3750..3751

                                                                    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 32.

                                                                    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

                                                                      offsets = tf.math.maximum(
                                                                          ymax - ymin, xmax - xmin) * score_distance_multiplier
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 1459..1460

                                                                    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 32.

                                                                    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

                                                                        search_radius = (
                                                                            tf.math.maximum(ymax - ymin, xmax - xmin) * candidate_search_scale)
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 1173..1174

                                                                    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 32.

                                                                    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

                                                                      keypoint_offset = tf.squeeze(prediction_dict[
                                                                          get_keypoint_name(task_name, KEYPOINT_OFFSET)][-1], axis=0)
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 1035..1036

                                                                    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 32.

                                                                    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

                                                                      keypoint_regression = tf.squeeze(prediction_dict[
                                                                          get_keypoint_name(task_name, KEYPOINT_REGRESSION)][-1], axis=0)
                                                                    research/object_detection/meta_architectures/center_net_meta_arch.py on lines 1033..1034

                                                                    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 32.

                                                                    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