代码拉取完成,页面将自动刷新
class Config:
EPOCHS = 50
BATCH_SIZE = 2
IMAGE_HEIGHT = 32
IMAGE_WIDTH = 100
IAMGE_CHANNELS = 3
save_model_dir = "saved_model/"
save_frequency = 10
test_picture_path = ""
# dataset
dataset_images = ""
dataset_label = ""
train_ratio = 0.6
valid_ratio = 0.2
train_label = ""
valid_label = ""
test_label = ""
charset_file = ""
@classmethod
def get_idx2char(cls):
with open(file=cls.charset_file, mode="r", encoding="utf-8") as f:
char_list = f.readlines()
idx2char = dict((i, c.strip("\n")) for i, c in enumerate(char_list))
idx2char[len(char_list)] = "BLANK"
return idx2char
@classmethod
def get_char2idx(cls):
idx2char = cls.get_idx2char()
char2idx = dict((v, k) for k, v in idx2char.items())
return char2idx
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。