Showing 11,634 of 11,634 total issues
Function test_retinanet_task
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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(
Function scrollToTarget
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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
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
Function test_box_prediction
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
def testExpandLabels(self):
label_map_string = """
item {
id:1
name:'cat'
Function test_faster_rcnn_resnet50_eval_input
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function __init__
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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
Function test_returns_correct_metric_values_partial_labels
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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,
Function add_output_tensor_nodes
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 -
Function test_create_tf_example_with_instance_masks
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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)
Function provide_groundtruth
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def provide_groundtruth(
self,
groundtruth_boxes_list,
groundtruth_classes_list,
groundtruth_masks_list=None,
Function train_loop
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def train_loop(
pipeline_config_path,
model_dir,
config_override=None,
train_steps=None,
Function define
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def define():
"""Define common flags."""
# yapf: disable
# common_flags.define() may be called multiple times in unit tests.
global _common_flags_defined
Function test_network_creation
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def test_network_creation(self, return_all_layer_outputs):
hidden_size = 32
sequence_length = 21
num_hidden_instances = 3
embedding_cfg = {
Function __init__
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def __init__(self,
vocab_size,
type_vocab_size,
embedding_width,
hidden_size,
Function test_distribution_strategy
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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(
Function _parse_train_data
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def _parse_train_data(self, data):
"""Parses data for training.
Args:
data: the decoded tensor dictionary from TfExampleDecoder.