def __init_ocr(self):
    num_label = 4
    batch_size = 1
    num_hidden = 100
    num_lstm_layer = 2
    init_c = [(('l%d_init_c' % l), (batch_size, num_hidden)) for l in range(num_lstm_layer)]
    init_h = [(('l%d_init_h' % l), (batch_size, num_hidden)) for l in range(num_lstm_layer)]
    init_states = (init_c + init_h)
    all_shapes = (([('data', (batch_size, (80 * 30)))] + init_states) + [('label', (batch_size, num_label))])
    all_shapes_dict = {}
    for _shape in all_shapes:
        all_shapes_dict[_shape[0]] = _shape[1]
    self.predictor = Predictor(open(self.path_of_json).read(), open(self.path_of_params).read(), all_shapes_dict)
def __init_ocr(self):
    num_label = 4
    batch_size = 1
    num_hidden = 100
    num_lstm_layer = 2
    init_c = [(('l%d_init_c' % l), (batch_size, num_hidden)) for l in range(num_lstm_layer)]
    init_h = [(('l%d_init_h' % l), (batch_size, num_hidden)) for l in range(num_lstm_layer)]
    init_states = (init_c + init_h)
    all_shapes = (([('data', (batch_size, (80 * 30)))] + init_states) + [('label', (batch_size, num_label))])
    all_shapes_dict = {}
    for _shape in all_shapes:
        all_shapes_dict[_shape[0]] = _shape[1]
    self.predictor = Predictor(open(self.path_of_json).read(), open(self.path_of_params).read(), all_shapes_dict)