tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

Function test_retinanet_task has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def test_retinanet_task(self, test_config, is_training):
    """RetinaNet task test for training and val using toy configs."""
    input_image_size = [384, 384]
    test_tfrecord_file = os.path.join(self.get_temp_dir(), 'det_test.tfrecord')
    example = tfexample_utils.create_detection_test_example(
Severity: Minor
Found in official/projects/qat/vision/tasks/retinanet_test.py - About 1 hr to fix

    Function scrollToTarget has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              function scrollToTarget() {
                $('a[href^="#"]').on('click.BackToTheTop', function(event) {
                  let targetOffset = $(this).data('backtothetop-scrolltop') !== undefined
                    ? $(this).data('backtothetop-scrolltop')
                    : $(this.hash).offset() !== undefined ? $(this.hash).offset().top : null;

      Function scrollToTarget has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function scrollToTarget() {
            $('a[href^="#"]').on('click.BackToTheTop', function(event) {
              let targetOffset = $(this).data('backtothetop-scrolltop') !== undefined
                ? $(this).data('backtothetop-scrolltop')
                : $(this.hash).offset() !== undefined ? $(this.hash).offset().top : null;

        Function make_tflite_export has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def make_tflite_export(weights_path, export_dir):
          if os.path.exists(export_dir):
            log('TF-Lite export already exists in {}, skipping TF-Lite export'.format(
                export_dir))
            return
        Severity: Minor
        Found in research/audioset/yamnet/export.py - About 1 hr to fix

          Function test_box_prediction has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def test_box_prediction(self):
          
              class_pred = np.zeros((3, 128, 128, 5), dtype=np.float32)
              hw_pred = np.zeros((3, 128, 128, 2), dtype=np.float32)
              offset_pred = np.zeros((3, 128, 128, 2), dtype=np.float32)

            Function testExpandLabels has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def testExpandLabels(self):
                label_map_string = """
                  item {
                    id:1
                    name:'cat'
            Severity: Minor
            Found in research/object_detection/data_decoders/tf_example_decoder_test.py - About 1 hr to fix

              Function test_faster_rcnn_resnet50_eval_input has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def test_faster_rcnn_resnet50_eval_input(self, eval_batch_size=1):
                  """Tests the eval input function for FasterRcnnResnet50."""
                  configs = _get_configs_for_model('faster_rcnn_resnet50_pets')
                  model_config = configs['model']
                  model_config.faster_rcnn.num_classes = 37
              Severity: Minor
              Found in research/object_detection/inputs_test.py - About 1 hr to fix

                Function __init__ has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def __init__(self,
                               is_training,
                               depth_multiplier,
                               min_depth,
                               pad_to_multiple,

                  Function test_ssd_inceptionV2_eval_input has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def test_ssd_inceptionV2_eval_input(self, eval_batch_size=1):
                      """Tests the eval input function for SSDInceptionV2."""
                      configs = _get_configs_for_model('ssd_inception_v2_pets')
                      model_config = configs['model']
                      model_config.ssd.num_classes = 37
                  Severity: Minor
                  Found in research/object_detection/inputs_test.py - About 1 hr to fix

                    Function test_returns_correct_metric_values_partial_labels has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def test_returns_correct_metric_values_partial_labels(self):
                        # Create partial label evaluation object.
                        self.wp_eval_partial = (
                            object_detection_evaluation.PrecisionAtRecallDetectionEvaluator(
                                self.categories,
                    Severity: Minor
                    Found in research/object_detection/utils/object_detection_evaluation_test.py - About 1 hr to fix

                      Function add_output_tensor_nodes has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      def add_output_tensor_nodes(postprocessed_tensors,
                                                  output_collection_name='inference_op'):
                        """Adds output nodes for detection boxes and scores.
                      
                        Adds the following nodes for output tensors -
                      Severity: Minor
                      Found in research/object_detection/exporter.py - About 1 hr to fix

                        Function test_create_tf_example_with_instance_masks has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def test_create_tf_example_with_instance_masks(self):
                            image_file_name = 'tmp_image.jpg'
                            image_data = np.random.rand(8, 8, 3)
                            tmp_dir = self.get_temp_dir()
                            save_path = os.path.join(tmp_dir, image_file_name)

                          Function _get_panoptic_test_data has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          def _get_panoptic_test_data():
                            # image1 contains 3 people in gt, (2 normal annotation and 1 "is_crowd"
                            # annotation), and 3 people in prediction.
                            gt_masks1 = np.zeros((3, 50, 50), dtype=np.uint8)
                            result_masks1 = np.zeros((3, 50, 50), dtype=np.uint8)
                          Severity: Minor
                          Found in research/object_detection/metrics/coco_evaluation_test.py - About 1 hr to fix

                            Function provide_groundtruth has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def provide_groundtruth(
                                  self,
                                  groundtruth_boxes_list,
                                  groundtruth_classes_list,
                                  groundtruth_masks_list=None,
                            Severity: Minor
                            Found in research/object_detection/core/model.py - About 1 hr to fix

                              Function train_loop has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              def train_loop(
                                  pipeline_config_path,
                                  model_dir,
                                  config_override=None,
                                  train_steps=None,
                              Severity: Minor
                              Found in research/object_detection/model_lib_v2.py - About 1 hr to fix

                                Function define has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                def define():
                                  """Define common flags."""
                                  # yapf: disable
                                  # common_flags.define() may be called multiple times in unit tests.
                                  global _common_flags_defined
                                Severity: Minor
                                Found in research/attention_ocr/python/common_flags.py - About 1 hr to fix

                                  Function test_network_creation has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    def test_network_creation(self, return_all_layer_outputs):
                                      hidden_size = 32
                                      sequence_length = 21
                                      num_hidden_instances = 3
                                      embedding_cfg = {
                                  Severity: Minor
                                  Found in official/nlp/modeling/networks/encoder_scaffold_test.py - About 1 hr to fix

                                    Function __init__ has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      def __init__(self,
                                                   vocab_size,
                                                   type_vocab_size,
                                                   embedding_width,
                                                   hidden_size,
                                    Severity: Minor
                                    Found in official/nlp/modeling/networks/packed_sequence_embedding.py - About 1 hr to fix

                                      Function test_distribution_strategy has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        def test_distribution_strategy(self, distribution_strategy):
                                          max_seq_length = 128
                                          batch_size = 8
                                          input_path = os.path.join(self.get_temp_dir(), 'train.tf_record')
                                          _create_fake_dataset(
                                      Severity: Minor
                                      Found in official/nlp/data/pretrain_dynamic_dataloader_test.py - About 1 hr to fix

                                        Function _parse_train_data has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          def _parse_train_data(self, data):
                                            """Parses data for training.
                                        
                                            Args:
                                              data: the decoded tensor dictionary from TfExampleDecoder.
                                        Severity: Minor
                                        Found in official/legacy/detection/dataloader/olnmask_parser.py - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language