def TBPP384(input_shape=(384, 384, 3), softmax=True): """ TextBoxes++384 architecture. # Arguments input_shape: Shape of the input image. # References - [TextBoxes++: A Single-Shot Oriented Scene Text Detector](https://arxiv.org/abs/1801.02765) """ # SSD body x = input_tensor = Input(shape=input_shape) source_layers = ssd384_body(x) num_maps = len(source_layers) # Add multibox head for classification and regression num_priors = [14] * num_maps normalizations = [1] * num_maps output_tensor = multibox_head(source_layers, num_priors, normalizations, softmax) model = Model(input_tensor, output_tensor) # parameters for prior boxes model.image_size = input_shape[:2] model.source_layers = source_layers model.aspect_ratios = [[1, 2, 3, 5, 1 / 2, 1 / 3, 1 / 5] * 2] * num_maps model.shifts = [[(0.0, -0.25)] * 7 + [(0.0, 0.25)] * 7] * num_maps model.special_ssd_boxes = False model.scale = 0.5 return model