tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

def ExportKeypointsToCOCO(image_ids,
Severity: Minor
Found in research/object_detection/metrics/coco_tools.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                if depth > 0 and self._num_layers_before_predictor > 0:
                  for i in range(self._num_layers_before_predictor):
                    net = slim.conv2d(
                        net,
                        depth, [1, 1],
    Severity: Major
    Found in research/object_detection/predictors/convolutional_box_predictor.py - About 45 mins to fix

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

      def ExportSegmentsToCOCO(image_ids,
      Severity: Minor
      Found in research/object_detection/metrics/coco_tools.py - About 45 mins to fix

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

          def _compute_base_tower(self, tower_name_scope, image_feature, feature_index):
            net = image_feature
            for i in range(self._num_layers_before_predictor):
              if self._use_depthwise:
                conv_op = functools.partial(slim.separable_conv2d, depth_multiplier=1)
        Severity: Minor
        Found in research/object_detection/predictors/convolutional_box_predictor.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 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def _predict(self,
                       image_features,
                       num_predictions_per_location,
                       prediction_stage=2):
            """Optionally computes encoded object locations, confidences, and masks.
        Severity: Minor
        Found in research/object_detection/predictors/mask_rcnn_box_predictor.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 _generate_examples has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def _generate_examples(self, annotation_file, excluded_file, label_map,
        Severity: Minor
        Found in research/object_detection/dataset_tools/create_ava_actions_tf_record.py - About 45 mins to fix

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

          def export(pipeline_config_file,
          Severity: Minor
          Found in research/object_detection/tpu_exporters/export_saved_model_tpu_lib.py - About 45 mins to fix

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

            def train_input(train_config, train_input_config,
            Severity: Minor
            Found in research/object_detection/inputs.py - About 45 mins to fix

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

              def main(_):
                tf.logging.set_verbosity(tf.logging.INFO)
              
                required_flags = [
                    'input_box_annotations_csv', 'input_images_directory', 'input_label_map',
              Severity: Minor
              Found in research/object_detection/dataset_tools/create_oid_tf_record.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 run_inference has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def run_inference(inputs,
              Severity: Minor
              Found in research/object_detection/tpu_exporters/export_saved_model_tpu_lib.py - About 45 mins to fix

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

                def dict_to_tf_example(data,
                                       dataset_directory,
                                       label_map_dict,
                                       ignore_difficult_instances=False,
                                       image_subdirectory='JPEGImages'):
                Severity: Minor
                Found in research/object_detection/dataset_tools/create_pascal_tf_record.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 assign_temporal_offset_targets has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  def assign_temporal_offset_targets(self,
                Severity: Minor
                Found in research/object_detection/core/target_assigner.py - About 45 mins to fix

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

                  def create_target_assigner(reference, stage=None,
                                             negative_class_weight=1.0, use_matmul_gather=False):
                    """Factory function for creating standard target assigners.
                  
                    Args:
                  Severity: Minor
                  Found in research/object_detection/core/target_assigner.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 assign has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    def assign(self,
                  Severity: Minor
                  Found in research/object_detection/core/target_assigner.py - About 45 mins to fix

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

                    def eval_input(eval_config, eval_input_config, model_config,
                    Severity: Minor
                    Found in research/object_detection/inputs.py - About 45 mins to fix

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

                        def assign_center_targets_from_boxes(self,
                      Severity: Minor
                      Found in research/object_detection/core/target_assigner.py - About 45 mins to fix

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

                          def __init__(self):
                            """Constructor."""
                        
                            path = os.path.dirname(os.path.abspath(__file__))
                            uv_symmetry_transforms_path = tf.resource_loader.get_path_to_datafile(
                        Severity: Minor
                        Found in research/object_detection/core/densepose_ops.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 create_pipeline has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def create_pipeline(pipeline,

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

                          def construct_pipeline(pipeline, input_tfrecord, output_tfrecord, model_dir,

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

                            def resize_image(image,
                            Severity: Minor
                            Found in research/object_detection/core/preprocessor.py - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language