{"id":107,"date":"2022-02-03T22:33:59","date_gmt":"2022-02-03T14:33:59","guid":{"rendered":"https:\/\/lmceric.top\/?p=107"},"modified":"2022-02-03T22:34:00","modified_gmt":"2022-02-03T14:34:00","slug":"%e5%9f%ba%e4%ba%8ekeare%e7%9a%84%e4%ba%a4%e9%80%9a%e6%a0%87%e5%bf%97%e8%af%86%e5%88%ab","status":"publish","type":"post","link":"https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/","title":{"rendered":"\u57fa\u4e8eKeare\u7684\u4ea4\u901a\u6807\u5fd7\u8bc6\u522b"},"content":{"rendered":"\n<p>\u524d\u4e24\u5929\u4f53\u9a8c\u4e86\u4e00\u4e0b\u817e\u8baf\u4e91\u7684\u5728\u7ebf\u5b9e\u9a8c\uff0c\u5185\u5bb9\u5982\u9898\uff0c\u5728\u8fd9\u91cc\u8bb0\u5f55\u4e00\u4e0b\u4e00\u4e9b\u5fc5\u8981\u77e5\u8bc6\uff08 \u6c34<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u5b9e\u9a8c\u6b65\u9aa4\">\u5b9e\u9a8c\u6b65\u9aa4<\/h2>\n\n\n\n<p>\u8fd9\u4e2a\u5b9e\u9a8c\u5206\u4e3a\u8bad\u7ec3\u8fc7\u7a0b\u548c\u6d4b\u8bd5\u8fc7\u7a0b\u4e24\u90e8\u5206\u3002<\/p>\n\n\n\n<p>\u8bad\u7ec3\u8fc7\u7a0b\u6d41\u7a0b\u53ca\u5b9e\u73b0\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u89e3\u6790\u811a\u672c\u8f93\u5165\u53c2\u6570\uff1a\u4f7f\u7528argparse\u89e3\u6790\uff0c\u7531args\u53d8\u91cf\u6301\u6709<\/li><li>\u521b\u5efa\u6a21\u578b\uff1a\u81ea\u5b9a\u4e49\u51fd\u6570create_model()\uff0c\u8fd4\u56de\u4f7f\u7528keras.models.Model\u7c7b\u521b\u5efa\u7684\u5b9e\u4f8b<\/li><li>\u6a21\u578b\u7f16\u8bd1\uff1a\u6267\u884cModel\u5b9e\u4f8b\u7684compile()<\/li><li>\u6570\u636e\u589e\u5f3a\uff1a\u81ea\u5b9a\u4e49\u51fd\u6570create_image_generator()<\/li><li>\u6a21\u578b\u8bad\u7ec3\u4e0e\u4fdd\u5b58\uff1a\u81ea\u5b9a\u4e49\u51fd\u6570train()\u5b8c\u6210\u6a21\u578b\u8bad\u7ec3\uff0c\u4f7f\u7528keras.callbacks.ModelCheckpoint\u7c7b\u7684\u5b9e\u4f8b\u5b8c\u6210\u6a21\u578b\u4fdd\u5b58<\/li><\/ul>\n\n\n\n<p>\u6d4b\u8bd5\u8fc7\u7a0b\u6d41\u7a0b\u53ca\u5b9e\u73b0\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u89e3\u6790\u811a\u672c\u8f93\u5165\u53c2\u6570\uff1a\u4f7f\u7528argparse\u89e3\u6790\uff0c\u7531args\u53d8\u91cf\u6301\u6709<\/li><li>\u521b\u5efa\u6a21\u578b\uff1a\u81ea\u5b9a\u4e49\u51fd\u6570create_model()<\/li><li>\u6a21\u578b\u52a0\u8f7d\uff1a\u4f7f\u7528keras.models.load_model()<\/li><li>\u6570\u636e\u8bfb\u53d6\uff1a\u81ea\u5b9a\u4e49\u51fd\u6570create_image_generator()<\/li><li>\u9884\u6d4b\u4e0e\u8bc4\u4f30\uff1a\u81ea\u5b9a\u4e49\u51fd\u6570test()<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u73af\u5883\u642d\u5efa\">\u73af\u5883\u642d\u5efa<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"\u5b89\u88c5tensorflow\">\u5b89\u88c5TensorFlow<\/h4>\n\n\n\n<p>\u8f93\u5165\u4e0b\u8ff0\u547d\u4ee4\u5347\u7ea7pip\u5e76\u5b89\u88c5TensorFlow<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">python -m pip install --upgrade pip &amp;&amp; pip install tensorflow==1.14<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"\u5b89\u88c5keras\">\u5b89\u88c5Keras<\/h4>\n\n\n\n<p>\u8f93\u5165\u4e0b\u8ff0\u547d\u4ee4\u5b89\u88c5Keras<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pip install keras==2.3.1<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"\u5b89\u88c5opencv-python\">\u5b89\u88c5opencv-python<\/h4>\n\n\n\n<p>\u8f93\u5165\u4e0b\u8ff0\u547d\u4ee4\u5b89\u88c5opencv-python<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pip install opencv-python<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"\u5b89\u88c5numpy\">\u5b89\u88c5numpy<\/h4>\n\n\n\n<p>\u8f93\u5165\u4e0b\u8ff0\u547d\u4ee4\u5b89\u88c5numpy<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pip install numpy==1.19<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u7f16\u5199\u8bad\u7ec3\u4ee3\u7801\">\u7f16\u5199\u8bad\u7ec3\u4ee3\u7801<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"\u521b\u5efa\u6587\u4ef6\">\u521b\u5efa\u6587\u4ef6<\/h4>\n\n\n\n<p>\u8fdb\u5165\u5de5\u7a0b\u76ee\u5f55<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/traffic_symbol<\/pre>\n\n\n\n<p>\u521b\u5efatrain.py\u6587\u4ef6\uff0c\u672c\u5b9e\u9a8c\u7684\u540e\u7eed\u4ee3\u7801\u90fd\u5c06\u5728\u6b64\u6587\u4ef6\u4e2d\u5b8c\u6210<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">touch train.py<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"\u5f15\u7528\u6587\u4ef6\">\u5f15\u7528\u6587\u4ef6<\/h4>\n\n\n\n<p>\u70b9\u51fb\u6253\u5f00 <a href=\"javascript:void(0);\">train.py<\/a> \u6587\u4ef6\uff0c\u8f93\u5165\u4e0b\u8ff0\u5185\u5bb9\uff1a<\/p>\n\n\n\n<p>\u5728\u6587\u4ef6\u9876\u90e8\u8f93\u5165\u4e0b\u8ff0\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import os<br>import argparse<br>import shutil<br>import cv2<br>import random<br>import numpy as np<br>import keras<br>from keras.applications.mobilenet import preprocess_input, MobileNet<br>from keras.preprocessing.image import ImageDataGenerator<br>from keras.models import Model, load_model<br>from keras.layers import *<br>from keras.callbacks import ModelCheckpoint<\/pre>\n\n\n\n<p><strong>\u8bb0\u5f97\u4fdd\u5b58\uff01<\/strong><\/p>\n\n\n\n<p>\u4fdd\u5b58\u65b9\u6cd5\uff1a<strong>Windows<\/strong> \u7cfb\u7edf\u70b9\u51fb <strong>ctrl+s<\/strong>\uff0c<strong>Mac OS<\/strong> \u70b9\u51fb <strong>command+s<\/strong> \u4fdd\u5b58<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"\u5b8c\u6210\u6a21\u578b\u6784\u5efa\u4ee3\u7801\">\u5b8c\u6210\u6a21\u578b\u6784\u5efa\u4ee3\u7801<\/h4>\n\n\n\n<p>\u7ee7\u7eed\u5728 train.py \u4e2d\u7ee7\u7eed\u8f93\u5165\u4e0b\u9762\u7684\u5185\u5bb9\uff0c\u7136\u540e\u4fdd\u5b58<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># \u521b\u5efa\u6a21\u578b<br>def create_model(height, width, channel, num_class):<br> &nbsp; &nbsp;# \u52a0\u8f7d\u9884\u8bad\u7ec3\u6a21\u578b<br> &nbsp; &nbsp;base_model = MobileNet(input_shape=(height, width, channel), weights='imagenet', include_top=False)<br>\u200b<br> &nbsp; &nbsp;# \u628a\u57fa\u7840\u6a21\u578b\u540e\u90e8\u66ff\u6362\u6210GAP + FC<br> &nbsp; &nbsp;x = base_model.output<br> &nbsp; &nbsp;x = GlobalAveragePooling2D()(x)<br> &nbsp; &nbsp;x = Dropout(0.5)(x)<br> &nbsp; &nbsp;x = Dense(256, activation='relu')(x)<br> &nbsp; &nbsp;predictions = Dense(num_class, activation='softmax')(x)<br>\u200b<br> &nbsp; &nbsp;# \u521b\u5efa\u6a21\u578b<br> &nbsp; &nbsp;return Model(inputs=base_model.input, outputs=predictions)<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"\u5b8c\u6210\u6570\u636e\u5904\u7406\u4ee3\u7801\">\u5b8c\u6210\u6570\u636e\u5904\u7406\u4ee3\u7801<\/h4>\n\n\n\n<p>\u7ee7\u7eed\u6dfb\u52a0\u4e0b\u5217\u4ee3\u7801\uff0c\u5e76\u4fdd\u5b58\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># \u56fe\u7247\u589e\u5f3a<br>def preprocess(image):<br> &nbsp; &nbsp;# \u56fe\u7247\u683c\u5f0f\u8f6c\u6362\u4e3aHSV<br> &nbsp; &nbsp;image = cv2.cvtColor(image, cv2.COLOR_RGB2HSV)<br>\u200b<br> &nbsp; &nbsp;# \u65e0\u5173\u4fe1\u606f\u589e\u5f3a\uff1a\u968f\u673a\u6539\u53d8\u8272\u8c03\u3001\u9971\u548c\u5ea6\u3001\u660e\u5ea6<br> &nbsp; &nbsp;h, s, v = cv2.split(image)<br> &nbsp; &nbsp;shift_h = cv2.addWeighted(h, 1, h, 0, random.randint(-10, 10))<br> &nbsp; &nbsp;shift_hsv = cv2.merge([shift_h, s, v])<br> &nbsp; &nbsp;image = cv2.cvtColor(shift_hsv, cv2.COLOR_HSV2RGB)<br> &nbsp; &nbsp;brightness = random.randint(-50, 50)<br> &nbsp; &nbsp;contrast = random.uniform(0.8, 1.2)<br> &nbsp; &nbsp;image = cv2.addWeighted(image, contrast, image, 0, brightness)<br>\u200b<br> &nbsp; &nbsp;# mobilenet\u7684\u56fe\u7247\u52a0\u901f\u5904\u7406\u65b9\u5f0f<br> &nbsp; &nbsp;image = preprocess_input(image)<br> &nbsp; &nbsp;return image<br>\u200b<br>\u200b<br># \u521b\u5efaImageDataGenerator<br>def create_image_generator(args, type):<br> &nbsp; &nbsp;classes = [str(i) for i in range(args.n_classes)]<br> &nbsp; &nbsp;if type == 0:<br> &nbsp; &nbsp; &nbsp; &nbsp;# \u8bad\u7ec3\u96c6\u6570\u636e\u5904\u7406<br> &nbsp; &nbsp; &nbsp; &nbsp;generator = ImageDataGenerator(<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;preprocessing_function=preprocess,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;shear_range=0.2, &nbsp; &nbsp;# \u88c1\u526a<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;zoom_range=0.2, &nbsp; &nbsp; # \u7f29\u653e<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rotation_range=20, &nbsp;# \u65cb\u8f6c<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;vertical_flip=False,# \u7eb5\u5411\u5bf9\u79f0\u53d8\u6362<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;horizontal_flip=True# \u6a2a\u5411\u5bf9\u79f0\u53d8\u6362<br> &nbsp; &nbsp; &nbsp;  ).flow_from_directory(<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;args.dataset + '\/train',<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;target_size=(model.inputs[0].shape[1], model.inputs[0].shape[2]),<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;batch_size=args.batch_size,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;classes=classes,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;class_mode='categorical'<br> &nbsp; &nbsp; &nbsp;  )<br> &nbsp; &nbsp;elif type == 1:<br> &nbsp; &nbsp; &nbsp; &nbsp;# \u9a8c\u8bc1\u96c6\u96c6\u6570\u636e\u5904\u7406<br> &nbsp; &nbsp; &nbsp; &nbsp;generator = ImageDataGenerator(<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;preprocessing_function=preprocess_input &nbsp;# \u6570\u636e\u4e0d\u505a\u4efb\u4f55\u589e\u5f3a<br> &nbsp; &nbsp; &nbsp;  ).flow_from_directory(<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;args.dataset + '\/validation',<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;target_size=(model.inputs[0].shape[1], model.inputs[0].shape[2]),<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;batch_size=args.batch_size,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;classes=classes,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;class_mode='categorical',<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;shuffle=False,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;seed=0<br> &nbsp; &nbsp; &nbsp;  )<br> &nbsp; &nbsp;return generator<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"\u5b8c\u6210\u8bad\u7ec3\u6d41\u7a0b\u4ee3\u7801\">\u5b8c\u6210\u8bad\u7ec3\u6d41\u7a0b\u4ee3\u7801<\/h4>\n\n\n\n<p>\u7ee7\u7eed\u6dfb\u52a0\u4e0b\u5217\u4ee3\u7801\uff0c\u5e76\u4fdd\u5b58\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># \u8bad\u7ec3\u6a21\u578b<br>def train(args, model):<br> &nbsp; &nbsp;# \u8bad\u7ec3\u6570\u636e\u5904\u7406<br> &nbsp; &nbsp;train_generator = create_image_generator(args, 0)<br>\u200b<br> &nbsp; &nbsp;# \u9a8c\u8bc1\u96c6\u6570\u636e\u5904\u7406<br> &nbsp; &nbsp;validation_generator = create_image_generator(args, 1)<br>\u200b<br> &nbsp; &nbsp;# \u7f16\u8bd1\u6a21\u578b<br> &nbsp; &nbsp;model.compile(optimizer=keras.optimizers.Adam(),<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;metrics=['accuracy'],<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;loss='categorical_crossentropy')<br>\u200b<br> &nbsp; &nbsp;# \u6a21\u578b\u4fdd\u5b58<br> &nbsp; &nbsp;model_save_path = os.path.join(args.output, 'model.h5')<br> &nbsp; &nbsp;saver = ModelCheckpoint(model_save_path, monitor='val_loss', verbose=1, save_best_only=True)<br>\u200b<br> &nbsp; &nbsp;# \u5f00\u59cb\u8bad\u7ec3<br> &nbsp; &nbsp;model.fit_generator(<br> &nbsp; &nbsp; &nbsp; &nbsp;generator=train_generator,<br> &nbsp; &nbsp; &nbsp; &nbsp;epochs=args.epochs,<br> &nbsp; &nbsp; &nbsp; &nbsp;validation_data=validation_generator,<br> &nbsp; &nbsp; &nbsp; &nbsp;callbacks=[saver])<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"\u5b8c\u6210\u53c2\u6570\u5904\u7406\u4ee3\u7801\">\u5b8c\u6210\u53c2\u6570\u5904\u7406\u4ee3\u7801<\/h4>\n\n\n\n<p>\u7ee7\u7eed\u6dfb\u52a0\u4e0b\u5217\u4ee3\u7801\uff0c\u5e76\u4fdd\u5b58\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">if __name__ == \"__main__\":\n \u00a0 \u00a0# \u53c2\u6570\u89e3\u6790\n \u00a0 \u00a0parser = argparse.ArgumentParser()\n \u00a0 \u00a0# \u5b9a\u4e49\u8def\u5f84\n \u00a0 \u00a0parser.add_argument(\"--dataset\", type=str, default=\".\/data\")\n \u00a0 \u00a0parser.add_argument(\"--output\", type=str, default=\".\/results\")\n \u00a0 \u00a0parser.add_argument(\"--resume_model_path\", type=str, default=\"\")\n \u00a0 \u00a0# \u5b9a\u4e49\u6a21\u578b\u53c2\u6570\n \u00a0 \u00a0parser.add_argument(\"--n_classes\", type=int, default=2)\n \u00a0 \u00a0parser.add_argument(\"--input_width\", type=int, default=128)\n \u00a0 \u00a0parser.add_argument(\"--input_height\", type=int, default=128)\n \u00a0 \u00a0parser.add_argument(\"--input_channel\", type=int, default=3)\n \u00a0 \u00a0# \u5b9a\u4e49\u8d85\u53c2\u6570\n \u00a0 \u00a0parser.add_argument(\"--epochs\", type=int, default=5)\n \u00a0 \u00a0parser.add_argument(\"--batch_size\", type=int, default=4)\n \u00a0 \u00a0# \u8fc7\u7a0b\u63a7\u5236\u3002test\u4e3a0\u8868\u793a\u8bad\u7ec3\uff0ctest\u4e3a1\u8868\u793a\u6d4b\u8bd5\n \u00a0 \u00a0parser.add_argument(\"--test\", type=int, default=0)\n \u00a0 \u00a0args = parser.parse_args()\n \u00a0 \u00a0print(\"args: \", args)\n\u200b\n \u00a0 \u00a0# \u521b\u5efa\u8f93\u51fa\u8def\u5f84\u6240\u6307\u6587\u4ef6\u5939\n \u00a0 \u00a0os.makedirs(args.output, exist_ok=True)\n\u200b\n \u00a0 \u00a0# \u521b\u5efa\u6a21\u578b\n \u00a0 \u00a0model = create_model(args.input_height, args.input_width, args.input_channel, args.n_classes)\n\u200b\n \u00a0 \u00a0# \u6253\u5370\u6a21\u578b\u7ed3\u6784\n \u00a0 \u00a0model.summary()\n\u200b\n \u00a0 \u00a0# \u52a0\u8f7d\u6a21\u578b\n \u00a0 \u00a0if args.resume_model_path != \"\":\n \u00a0 \u00a0 \u00a0 \u00a0try:\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0model = load_model(args.resume_model_path)\n \u00a0 \u00a0 \u00a0 \u00a0except Exception as e:\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0print('No saved model, using init weights!')\n\u200b\n \u00a0 \u00a0if args.test:\n \u00a0 \u00a0 \u00a0 \u00a0# \u9884\u6d4b\u6d4b\u8bd5\u56fe\u7247\n \u00a0 \u00a0 \u00a0 \u00a0test(args, model)\n \u00a0 \u00a0else:\n \u00a0 \u00a0 \u00a0 \u00a0# \u5f00\u59cb\u8bad\u7ec3\n \u00a0 \u00a0 \u00a0 \u00a0train(args, model)<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u5f00\u59cb\u8bad\u7ec3\">\u5f00\u59cb\u8bad\u7ec3<\/h2>\n\n\n\n<p>\u4f7f\u7528\u811a\u672c\u8fdb\u884c\u8bad\u7ec3<\/p>\n\n\n\n<p>\u8f93\u5165\u4e0b\u8ff0\u547d\u4ee4\u6267\u884c\u811a\u672c\u8bad\u7ec3\u8fc7\u7a0b<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">python train.py<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u6d4b\u8bd5\u6a21\u578b\">\u6d4b\u8bd5\u6a21\u578b<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"\u8f93\u5165\u6d4b\u8bd5\u6570\u636e\u5904\u7406\u51fd\u6570\">\u8f93\u5165\u6d4b\u8bd5\u6570\u636e\u5904\u7406\u51fd\u6570<\/h4>\n\n\n\n<p>\u5728 <a href=\"javascript:void(0);\">\/traffic_symbol\/train.py<\/a> \u6587\u4ef6\u4e2d\uff0c\u627e\u5230 <strong>create_image_generator<\/strong> \u65b9\u6cd5\uff0c\u5728 <strong>return generator<\/strong> \u524d\u9762\u8f93\u5165\u4e0b\u8ff0\u4ee3\u7801\uff0c\u7136\u540e\u4fdd\u5b58\u3002 \u8bf7 <strong>\u6ce8\u610f\u7f29\u8fdb\uff01<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> &nbsp; &nbsp;else:<br> &nbsp; &nbsp; &nbsp;  # \u6d4b\u8bd5\u96c6\u6570\u636e\u5904\u7406<br> &nbsp; &nbsp; &nbsp; &nbsp;generator = ImageDataGenerator(<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;preprocessing_function=preprocess_input  # \u6570\u636e\u4e0d\u505a\u4efb\u4f55\u589e\u5f3a<br> &nbsp; &nbsp; &nbsp;  ).flow_from_directory(<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;args.dataset + '\/test',<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;target_size=(model.inputs[0].shape[1], model.inputs[0].shape[2]),<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;batch_size=args.batch_size,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;classes=classes,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;class_mode='categorical',<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;shuffle=False,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;seed=0<br> &nbsp; &nbsp; &nbsp;  )<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"\u8f93\u5165\u6d4b\u8bd5\u6d41\u7a0b\u51fd\u6570\">\u8f93\u5165\u6d4b\u8bd5\u6d41\u7a0b\u51fd\u6570<\/h4>\n\n\n\n<p>\u5728<code>if __name__ == \"__main__\":<\/code>\u524d\uff0c\u7ee7\u7eed\u8f93\u5165\u4e0b\u9762\u7684\u4ee3\u7801\uff0c\u7136\u540e\u4fdd\u5b58<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># \u6a21\u578b\u6d4b\u8bd5<br>def test(args, model):<br> &nbsp;  # \u751f\u6210\u7ed3\u679c\u89e3\u6790\u8def\u5f84<br> &nbsp; &nbsp;result_folder = args.output + '\/test'<br> &nbsp; &nbsp;if os.path.exists(result_folder):<br> &nbsp; &nbsp; &nbsp; &nbsp;shutil.rmtree(result_folder)<br> &nbsp; &nbsp;os.makedirs(result_folder)<br>\u200b<br> &nbsp;  # \u751f\u6210\u6d4b\u8bd5\u6570\u636e\u96c6<br> &nbsp; &nbsp;test_generator = create_image_generator(args, 2)<br>\u200b<br> &nbsp;  # \u521d\u59cb\u5316\u53d8\u91cf<br> &nbsp; &nbsp;total_images = 0<br> &nbsp; &nbsp;right_images = 0<br> &nbsp; &nbsp;n_val_batch = len(test_generator)<br>\u200b<br> &nbsp;  # \u6279\u91cf\u9884\u6d4b\u56fe\u7247<br> &nbsp; &nbsp;for b in range(n_val_batch):<br> &nbsp; &nbsp; &nbsp; &nbsp;vx, vy = test_generator.next()<br> &nbsp; &nbsp; &nbsp; &nbsp;pred = model.predict(vx)<br> &nbsp; &nbsp; &nbsp; &nbsp;vy = np.argmax(vy, -1)<br> &nbsp; &nbsp; &nbsp; &nbsp;pred = np.argmax(pred, -1)<br> &nbsp; &nbsp; &nbsp; &nbsp;if test_generator.batch_index &gt; 0:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;idx = (test_generator.batch_index - 1) * test_generator.batch_size<br> &nbsp; &nbsp; &nbsp; &nbsp;else:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;idx = (n_val_batch - 1) * test_generator.batch_size<br> &nbsp; &nbsp; &nbsp; &nbsp;files = test_generator.filepaths[idx: idx + test_generator.batch_size]<br>\u200b<br> &nbsp; &nbsp; &nbsp; &nbsp;indices = [i for i, v in enumerate(pred) if pred[i] != vy[i]]<br> &nbsp; &nbsp; &nbsp; &nbsp;total_images += len(files)<br> &nbsp; &nbsp; &nbsp; &nbsp;right_images += len(files) - len(indices)<br>\u200b<br> &nbsp; &nbsp; &nbsp; &nbsp;for i in range(len(files)):<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;img = cv2.imread(files[i], cv2.IMREAD_UNCHANGED)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;text = \"label\" + str(vy[i]) + \"_pred\" + str(pred[i]) + \"_\"<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;save_path = os.path.join(result_folder, text + os.path.basename(files[i]))<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cv2.imwrite(save_path, img)<br>\u200b<br> &nbsp; &nbsp;print('accuracy', right_images \/ total_images)<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u6a21\u578b\u6d4b\u8bd5\">\u6a21\u578b\u6d4b\u8bd5<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"\u4f7f\u7528\u811a\u672c\u8fdb\u884c\u6d4b\u8bd5\">\u4f7f\u7528\u811a\u672c\u8fdb\u884c\u6d4b\u8bd5<\/h4>\n\n\n\n<p>\u8f93\u5165\u4e0b\u8ff0\u547d\u4ee4<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">python train.py --test 1 --resume_model_path \/traffic_symbol\/results\/model.h5<\/pre>\n\n\n\n<p>\u7b49\u5f85\u6d4b\u8bd5\u5b8c\u6210\uff0c\u53ef\u4ee5\u770b\u5230\u7c7b\u4f3c\u8fd9\u6837\u7684\u8f93\u51fa<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Found 16 images belonging to 2 classes.<br>accuracy 1.0<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"\u67e5\u770b\u6d4b\u8bd5\u56fe\u7247\u6570\u636e\u7ed3\u679c\">\u67e5\u770b\u6d4b\u8bd5\u56fe\u7247\u6570\u636e\u7ed3\u679c<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">ls \/traffic_symbol\/results\/test<\/pre>\n\n\n\n<p>\u8fd0\u884c\u4e0a\u8ff0\u547d\u4ee4\uff0c\u53ef\u4ee5\u770b\u5230\u8f93\u51fa\u56fe\u7247\u7684\u7c7b\u4f3c\u6548\u679c<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/academy-lab-prd-pub-1258344699.cos.ap-guangzhou.myqcloud.com\/lab-prd\/contribution-attachment\/100021000061\/1635424577166-%E5%9B%BE%E7%89%87%201.jpg\" alt=\"image\"\/><\/figure>\n\n\n\n<p>\u53ef\u4ee5\u5728\u8fd9\u91cc\u770b\u5230\u6240\u6709\u56fe\u7247\u7684\u6807\u6ce8\u548c\u9884\u6d4b\u7ed3\u679c\u3002 \u5982label0_pred0_43-0-0.jpg\uff0c\u610f\u5473\u7740\u6807\u6ce8\u7c7b\u522b\u662f0\uff0c\u9884\u6d4b\u7ed3\u679c0\uff0c\u539f\u56fe\u540d\u79f0\u662f43-0-0.jpg<\/p>\n\n\n\n<p>\u6253\u5f00 <a href=\"javascript:void(0);\">results\/test<\/a> \u6587\u4ef6\u5939\uff0c\u5728 <strong>\u53f3\u4fa7\u76ee\u5f55\u6811<\/strong> \u70b9\u51fb\u67e5\u770b\u6d4b\u8bd5\u8f93\u51fa\u56fe\u7247\u6548\u679c<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u4e24\u5929\u4f53\u9a8c\u4e86\u4e00\u4e0b\u817e\u8baf\u4e91\u7684\u5728\u7ebf\u5b9e\u9a8c\uff0c\u5185\u5bb9\u5982\u9898\uff0c\u5728\u8fd9\u91cc&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/\">Continue reading<span class=\"screen-reader-text\">\u57fa\u4e8eKeare\u7684\u4ea4\u901a\u6807\u5fd7\u8bc6\u522b<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":112,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[11],"tags":[27,25],"class_list":["post-107","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tec","tag-python","tag-25","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u57fa\u4e8eKeare\u7684\u4ea4\u901a\u6807\u5fd7\u8bc6\u522b - LMC\u7684\u4e2a\u4eba\u7ad9<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u57fa\u4e8eKeare\u7684\u4ea4\u901a\u6807\u5fd7\u8bc6\u522b - LMC\u7684\u4e2a\u4eba\u7ad9\" \/>\n<meta property=\"og:description\" content=\"\u524d\u4e24\u5929\u4f53\u9a8c\u4e86\u4e00\u4e0b\u817e\u8baf\u4e91\u7684\u5728\u7ebf\u5b9e\u9a8c\uff0c\u5185\u5bb9\u5982\u9898\uff0c\u5728\u8fd9\u91cc&#8230;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/\" \/>\n<meta property=\"og:site_name\" content=\"LMC\u7684\u4e2a\u4eba\u7ad9\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-03T14:33:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-03T14:34:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/lmceric.top\/wp-content\/uploads\/2022\/02\/ec4c-iyhvyuz4791207.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1080\" \/>\n\t<meta property=\"og:image:height\" content=\"645\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"SimpleAstronaut\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"SimpleAstronaut\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2022\\\/02\\\/03\\\/107\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2022\\\/02\\\/03\\\/107\\\/\"},\"author\":{\"name\":\"SimpleAstronaut\",\"@id\":\"https:\\\/\\\/lmceric.top\\\/#\\\/schema\\\/person\\\/1edca9cfe5ff17dbe947c332a66ee539\"},\"headline\":\"\u57fa\u4e8eKeare\u7684\u4ea4\u901a\u6807\u5fd7\u8bc6\u522b\",\"datePublished\":\"2022-02-03T14:33:59+00:00\",\"dateModified\":\"2022-02-03T14:34:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2022\\\/02\\\/03\\\/107\\\/\"},\"wordCount\":70,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2022\\\/02\\\/03\\\/107\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/lmceric.top\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/ec4c-iyhvyuz4791207.png\",\"keywords\":[\"python\",\"\u4eba\u5de5\u667a\u80fd\"],\"articleSection\":[\"\u6280\u672f\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2022\\\/02\\\/03\\\/107\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2022\\\/02\\\/03\\\/107\\\/\",\"url\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2022\\\/02\\\/03\\\/107\\\/\",\"name\":\"\u57fa\u4e8eKeare\u7684\u4ea4\u901a\u6807\u5fd7\u8bc6\u522b - LMC\u7684\u4e2a\u4eba\u7ad9\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/lmceric.top\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2022\\\/02\\\/03\\\/107\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2022\\\/02\\\/03\\\/107\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/lmceric.top\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/ec4c-iyhvyuz4791207.png\",\"datePublished\":\"2022-02-03T14:33:59+00:00\",\"dateModified\":\"2022-02-03T14:34:00+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/lmceric.top\\\/#\\\/schema\\\/person\\\/1edca9cfe5ff17dbe947c332a66ee539\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2022\\\/02\\\/03\\\/107\\\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2022\\\/02\\\/03\\\/107\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2022\\\/02\\\/03\\\/107\\\/#primaryimage\",\"url\":\"https:\\\/\\\/lmceric.top\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/ec4c-iyhvyuz4791207.png\",\"contentUrl\":\"https:\\\/\\\/lmceric.top\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/ec4c-iyhvyuz4791207.png\",\"width\":1080,\"height\":645},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2022\\\/02\\\/03\\\/107\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\\\/\\\/lmceric.top\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u57fa\u4e8eKeare\u7684\u4ea4\u901a\u6807\u5fd7\u8bc6\u522b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/lmceric.top\\\/#website\",\"url\":\"https:\\\/\\\/lmceric.top\\\/\",\"name\":\"LMC\u7684\u4e2a\u4eba\u7ad9\",\"description\":\"\u5b64\u5e06\u8fdc\u5f71\u78a7\u7a7a\u5c3d\uff0c\u552f\u89c1\u957f\u6c5f\u5929\u9645\u6d41\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/lmceric.top\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/lmceric.top\\\/#\\\/schema\\\/person\\\/1edca9cfe5ff17dbe947c332a66ee539\",\"name\":\"SimpleAstronaut\",\"sameAs\":[\"http:\\\/\\\/lmceric.top\"],\"url\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/author\\\/simpleastronaut\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u57fa\u4e8eKeare\u7684\u4ea4\u901a\u6807\u5fd7\u8bc6\u522b - LMC\u7684\u4e2a\u4eba\u7ad9","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/","og_locale":"zh_CN","og_type":"article","og_title":"\u57fa\u4e8eKeare\u7684\u4ea4\u901a\u6807\u5fd7\u8bc6\u522b - LMC\u7684\u4e2a\u4eba\u7ad9","og_description":"\u524d\u4e24\u5929\u4f53\u9a8c\u4e86\u4e00\u4e0b\u817e\u8baf\u4e91\u7684\u5728\u7ebf\u5b9e\u9a8c\uff0c\u5185\u5bb9\u5982\u9898\uff0c\u5728\u8fd9\u91cc&#8230;","og_url":"https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/","og_site_name":"LMC\u7684\u4e2a\u4eba\u7ad9","article_published_time":"2022-02-03T14:33:59+00:00","article_modified_time":"2022-02-03T14:34:00+00:00","og_image":[{"width":1080,"height":645,"url":"https:\/\/lmceric.top\/wp-content\/uploads\/2022\/02\/ec4c-iyhvyuz4791207.png","type":"image\/png"}],"author":"SimpleAstronaut","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"SimpleAstronaut","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/#article","isPartOf":{"@id":"https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/"},"author":{"name":"SimpleAstronaut","@id":"https:\/\/lmceric.top\/#\/schema\/person\/1edca9cfe5ff17dbe947c332a66ee539"},"headline":"\u57fa\u4e8eKeare\u7684\u4ea4\u901a\u6807\u5fd7\u8bc6\u522b","datePublished":"2022-02-03T14:33:59+00:00","dateModified":"2022-02-03T14:34:00+00:00","mainEntityOfPage":{"@id":"https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/"},"wordCount":70,"commentCount":0,"image":{"@id":"https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/#primaryimage"},"thumbnailUrl":"https:\/\/lmceric.top\/wp-content\/uploads\/2022\/02\/ec4c-iyhvyuz4791207.png","keywords":["python","\u4eba\u5de5\u667a\u80fd"],"articleSection":["\u6280\u672f"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/","url":"https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/","name":"\u57fa\u4e8eKeare\u7684\u4ea4\u901a\u6807\u5fd7\u8bc6\u522b - LMC\u7684\u4e2a\u4eba\u7ad9","isPartOf":{"@id":"https:\/\/lmceric.top\/#website"},"primaryImageOfPage":{"@id":"https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/#primaryimage"},"image":{"@id":"https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/#primaryimage"},"thumbnailUrl":"https:\/\/lmceric.top\/wp-content\/uploads\/2022\/02\/ec4c-iyhvyuz4791207.png","datePublished":"2022-02-03T14:33:59+00:00","dateModified":"2022-02-03T14:34:00+00:00","author":{"@id":"https:\/\/lmceric.top\/#\/schema\/person\/1edca9cfe5ff17dbe947c332a66ee539"},"breadcrumb":{"@id":"https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/#primaryimage","url":"https:\/\/lmceric.top\/wp-content\/uploads\/2022\/02\/ec4c-iyhvyuz4791207.png","contentUrl":"https:\/\/lmceric.top\/wp-content\/uploads\/2022\/02\/ec4c-iyhvyuz4791207.png","width":1080,"height":645},{"@type":"BreadcrumbList","@id":"https:\/\/lmceric.top\/index.php\/2022\/02\/03\/107\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/lmceric.top\/"},{"@type":"ListItem","position":2,"name":"\u57fa\u4e8eKeare\u7684\u4ea4\u901a\u6807\u5fd7\u8bc6\u522b"}]},{"@type":"WebSite","@id":"https:\/\/lmceric.top\/#website","url":"https:\/\/lmceric.top\/","name":"LMC\u7684\u4e2a\u4eba\u7ad9","description":"\u5b64\u5e06\u8fdc\u5f71\u78a7\u7a7a\u5c3d\uff0c\u552f\u89c1\u957f\u6c5f\u5929\u9645\u6d41","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/lmceric.top\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/lmceric.top\/#\/schema\/person\/1edca9cfe5ff17dbe947c332a66ee539","name":"SimpleAstronaut","sameAs":["http:\/\/lmceric.top"],"url":"https:\/\/lmceric.top\/index.php\/author\/simpleastronaut\/"}]}},"jetpack_featured_media_url":"https:\/\/lmceric.top\/wp-content\/uploads\/2022\/02\/ec4c-iyhvyuz4791207.png","_links":{"self":[{"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/posts\/107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/comments?post=107"}],"version-history":[{"count":3,"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/posts\/107\/revisions"}],"predecessor-version":[{"id":111,"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/posts\/107\/revisions\/111"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/media\/112"}],"wp:attachment":[{"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/media?parent=107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/categories?post=107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/tags?post=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}