tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

Function merge_external_params_with_configs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def merge_external_params_with_configs(configs, hparams=None, kwargs_dict=None):
  """Updates `configs` dictionary based on supplied parameters.

  This utility is for modifying specific fields in the object detection configs.
  Say that one would like to experiment with different learning rates, momentum
Severity: Minor
Found in research/object_detection/utils/config_util.py - About 45 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

Avoid deeply nested control flow statements.
Open

          if not display_str:
            display_str = 'ID {}'.format(track_ids[i])
          else:
            display_str = '{}: ID {}'.format(display_str, track_ids[i])
        box_to_display_str_map[box].append(display_str)
Severity: Major
Found in research/object_detection/utils/visualization_utils.py - About 45 mins to fix

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

      def _get_overlaps_and_scores_mask_mode(self, detected_boxes, detected_scores,
    Severity: Minor
    Found in research/object_detection/utils/per_image_evaluation.py - About 45 mins to fix

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

      def multilevel_matmul_crop_and_resize(images, boxes, box_levels, crop_size,
      Severity: Minor
      Found in research/object_detection/utils/spatial_transform_ops.py - About 45 mins to fix

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

        def draw_side_by_side_evaluation_image(eval_dict,
        Severity: Minor
        Found in research/object_detection/utils/visualization_utils.py - About 45 mins to fix

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

            def __init__(self,
          Severity: Minor
          Found in research/object_detection/utils/object_detection_evaluation.py - About 45 mins to fix

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

            def create_visualization_fn(category_index,
            Severity: Minor
            Found in research/object_detection/utils/visualization_utils.py - About 45 mins to fix

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

              def batch_position_sensitive_crop_regions(images,
              Severity: Minor
              Found in research/object_detection/utils/ops.py - About 45 mins to fix

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

                def get_configs_from_multiple_files(model_config_path="",
                Severity: Minor
                Found in research/object_detection/utils/config_util.py - About 45 mins to fix

                  Function create_visualization_fn has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def create_visualization_fn(category_index,
                                              include_masks=False,
                                              include_keypoints=False,
                                              include_keypoint_scores=False,
                                              include_track_ids=False,
                  Severity: Minor
                  Found in research/object_detection/utils/visualization_utils.py - About 45 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

                  Avoid deeply nested control flow statements.
                  Open

                            if not display_str:
                              display_str = '{}%'.format(round(100*scores[i]))
                            else:
                              display_str = '{}: {}%'.format(display_str, round(100*scores[i]))
                          if not skip_track_ids and track_ids is not None:
                  Severity: Major
                  Found in research/object_detection/utils/visualization_utils.py - About 45 mins to fix

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

                    def ravel_indices(feature_grid_y, feature_grid_x, num_levels, height, width,
                    Severity: Minor
                    Found in research/object_detection/utils/spatial_transform_ops.py - About 45 mins to fix

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

                      def _apply_multi_bbox_augmentation(image, bboxes, prob, aug_func,
                      Severity: Minor
                      Found in research/object_detection/utils/autoaugment_utils.py - About 45 mins to fix

                        Function filter_variables has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def filter_variables(variables, filter_regex_list, invert=False):
                          """Filters out the variables matching the filter_regex.
                        
                          Filter out the variables whose name matches the any of the regular
                          expressions in filter_regex_list and returns the remaining variables.
                        Severity: Minor
                        Found in research/object_detection/utils/variables_helper.py - About 45 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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          def __init__(self, min_level, max_level, anchor_scale, aspect_ratios,

                          Function build has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def build(hyperparams_config, is_training):
                            """Builds tf-slim arg_scope for convolution ops based on the config.
                          
                            Returns an arg_scope to use for convolution ops containing weights
                            initializer, weights regularizer, activation function, batch norm function
                          Severity: Minor
                          Found in research/object_detection/builders/hyperparams_builder.py - About 45 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 _predict_head has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            def _predict_head(self, head_name, head_obj, image_feature, box_tower_feature,
                          Severity: Minor
                          Found in research/object_detection/predictors/convolutional_box_predictor.py - About 45 mins to fix

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

                            def create_input_queue(batch_size_per_clone, create_tensor_dict_fn,
                            Severity: Minor
                            Found in research/object_detection/legacy/trainer.py - About 45 mins to fix

                              Function get_evaluators has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def get_evaluators(eval_config, categories):
                                """Returns the evaluator class according to eval_config, valid for categories.
                              
                                Args:
                                  eval_config: evaluation configurations.
                              Severity: Minor
                              Found in research/object_detection/legacy/evaluator.py - About 45 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

                              Avoid deeply nested control flow statements.
                              Open

                                        if kv.id in list_of_keypoint_ids:
                                          raise ValueError('Duplicate keypoint ids are not allowed. '
                                                           'Found {} more than once'.format(kv.id))
                                        keypoints[kv.label] = kv.id
                              Severity: Major
                              Found in research/object_detection/utils/label_map_util.py - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language