{"id":962725,"date":"2024-12-27T04:11:00","date_gmt":"2024-12-26T20:11:00","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/962725.html"},"modified":"2024-12-27T04:11:02","modified_gmt":"2024-12-26T20:11:02","slug":"python%e5%a6%82%e4%bd%95%e8%af%86%e5%88%ab%e5%9b%be%e7%89%87%e6%95%b0%e5%ad%97","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/962725.html","title":{"rendered":"python\u5982\u4f55\u8bc6\u522b\u56fe\u7247\u6570\u5b57"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25104616\/30d328ff-9170-4aad-8779-6ebde4a9a17b.webp\" alt=\"python\u5982\u4f55\u8bc6\u522b\u56fe\u7247\u6570\u5b57\" \/><\/p>\n<p><p> <strong>Python\u8bc6\u522b\u56fe\u7247\u6570\u5b57\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528OpenCV\u8fdb\u884c\u56fe\u50cf\u9884\u5904\u7406\u3001\u5229\u7528Tesseract OCR\u8fdb\u884c\u6587\u672c\u8bc6\u522b\u3001\u5e94\u7528\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\uff08CNN\uff09\u8fdb\u884c\u6df1\u5ea6\u5b66\u4e60\u5904\u7406<\/strong>\u3002\u5176\u4e2d\uff0c\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\u662f\u76ee\u524d\u6700\u4e3a\u5148\u8fdb\u7684\u65b9\u6cd5\uff0c\u5b83\u901a\u8fc7\u5b66\u4e60\u5927\u91cf\u7684\u8bad\u7ec3\u6570\u636e\uff0c\u80fd\u591f\u975e\u5e38\u7cbe\u51c6\u5730\u8bc6\u522b\u548c\u5206\u7c7b\u56fe\u50cf\u4e2d\u7684\u6570\u5b57\u3002\u8fd9\u79cd\u65b9\u6cd5\u867d\u7136\u5bf9\u8ba1\u7b97\u8d44\u6e90\u7684\u8981\u6c42\u8f83\u9ad8\uff0c\u4f46\u5176\u8bc6\u522b\u7cbe\u5ea6\u5728\u8bb8\u591a\u5e94\u7528\u4e2d\u662f\u65e0\u53ef\u6bd4\u62df\u7684\u3002<\/p>\n<\/p>\n<p><p>\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\uff08CNN\uff09\u662f\u6df1\u5ea6\u5b66\u4e60\u4e2d\u7684\u4e00\u4e2a\u91cd\u8981\u6a21\u578b\uff0c\u7279\u522b\u9002\u7528\u4e8e\u56fe\u50cf\u5904\u7406\u95ee\u9898\u3002CNN\u7684\u57fa\u672c\u539f\u7406\u662f\u901a\u8fc7\u4e00\u7cfb\u5217\u7684\u5377\u79ef\u5c42\u3001\u6c60\u5316\u5c42\u548c\u5168\u8fde\u63a5\u5c42\u6765\u63d0\u53d6\u56fe\u50cf\u7684\u7279\u5f81\u5e76\u8fdb\u884c\u5206\u7c7b\u3002\u5728\u56fe\u50cf\u6570\u5b57\u8bc6\u522b\u4e2d\uff0cCNN\u53ef\u4ee5\u901a\u8fc7\u5927\u91cf\u7684\u8bad\u7ec3\u6837\u672c\u5b66\u4e60\u5230\u6570\u5b57\u7684\u7279\u5f81\uff0c\u4ece\u800c\u5728\u8bc6\u522b\u672a\u77e5\u56fe\u50cf\u65f6\u53d6\u5f97\u9ad8\u7cbe\u5ea6\u3002\u4e3a\u4e86\u4f7f\u7528CNN\u8fdb\u884c\u6570\u5b57\u8bc6\u522b\uff0c\u9996\u5148\u9700\u8981\u51c6\u5907\u4e00\u4e2a\u6570\u636e\u96c6\uff0c\u6bd4\u5982MNIST\u6570\u636e\u96c6\uff0c\u8fd9\u662f\u4e00\u4e2a\u5305\u542b\u624b\u5199\u6570\u5b57\u7684\u6807\u51c6\u6570\u636e\u96c6\u3002\u63a5\u4e0b\u6765\uff0c\u901a\u8fc7Python\u4e2d\u7684\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6\uff08\u5982TensorFlow\u6216PyTorch\uff09\uff0c\u53ef\u4ee5\u6784\u5efa\u5e76\u8bad\u7ec3CNN\u6a21\u578b\u3002\u8bad\u7ec3\u5b8c\u6210\u540e\uff0c\u6a21\u578b\u5c31\u53ef\u4ee5\u7528\u4e8e\u8bc6\u522b\u65b0\u56fe\u50cf\u4e2d\u7684\u6570\u5b57\u3002<\/p>\n<\/p>\n<hr>\n<p><h3>\u4e00\u3001OPENVC\u8fdb\u884c\u56fe\u50cf\u9884\u5904\u7406<\/h3>\n<\/p>\n<p><p>\u5728\u8fdb\u884c\u6570\u5b57\u8bc6\u522b\u4e4b\u524d\uff0c\u5e38\u5e38\u9700\u8981\u5bf9\u56fe\u50cf\u8fdb\u884c\u9884\u5904\u7406\uff0c\u4ee5\u63d0\u9ad8\u8bc6\u522b\u7684\u51c6\u786e\u6027\u3002OpenCV\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u8ba1\u7b97\u673a\u89c6\u89c9\u5e93\uff0c\u5e7f\u6cdb\u7528\u4e8e\u56fe\u50cf\u5904\u7406\u3002\u901a\u8fc7OpenCV\uff0c\u6211\u4eec\u53ef\u4ee5\u5bf9\u56fe\u50cf\u8fdb\u884c\u7070\u5ea6\u5316\u3001\u4e8c\u503c\u5316\u3001\u566a\u58f0\u53bb\u9664\u7b49\u9884\u5904\u7406\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<p><h4>1. \u7070\u5ea6\u5316\u548c\u4e8c\u503c\u5316<\/h4>\n<\/p>\n<p><p>\u7070\u5ea6\u5316\u662f\u5c06\u5f69\u8272\u56fe\u50cf\u8f6c\u6362\u4e3a\u7070\u5ea6\u56fe\u50cf\u7684\u8fc7\u7a0b\uff0c\u8fd9\u6837\u53ef\u4ee5\u51cf\u5c11\u8ba1\u7b97\u590d\u6742\u5ea6\u3002\u4e8c\u503c\u5316\u5219\u662f\u5c06\u7070\u5ea6\u56fe\u50cf\u4e2d\u7684\u50cf\u7d20\u5206\u4e3a\u4e24\u4e2a\u503c\uff08\u901a\u5e38\u662f0\u548c255\uff09\uff0c\u4ece\u800c\u7a81\u51fa\u56fe\u50cf\u4e2d\u7684\u524d\u666f\u4fe1\u606f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import cv2<\/p>\n<h2><strong>\u8bfb\u53d6\u56fe\u50cf<\/strong><\/h2>\n<p>image = cv2.imread(&#39;image.png&#39;)<\/p>\n<h2><strong>\u8f6c\u6362\u4e3a\u7070\u5ea6\u56fe<\/strong><\/h2>\n<p>gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)<\/p>\n<h2><strong>\u4e8c\u503c\u5316\u5904\u7406<\/strong><\/h2>\n<p>_, binary_image = cv2.threshold(gray_image, 128, 255, cv2.THRESH_BINARY)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u566a\u58f0\u53bb\u9664\u548c\u8f6e\u5ed3\u68c0\u6d4b<\/h4>\n<\/p>\n<p><p>\u4e3a\u4e86\u63d0\u9ad8\u8bc6\u522b\u7cbe\u5ea6\uff0c\u53ef\u4ee5\u4f7f\u7528\u9ad8\u65af\u6a21\u7cca\u7b49\u65b9\u6cd5\u53bb\u9664\u56fe\u50cf\u4e2d\u7684\u566a\u58f0\u3002\u540c\u65f6\uff0c\u8f6e\u5ed3\u68c0\u6d4b\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u627e\u5230\u56fe\u50cf\u4e2d\u6570\u5b57\u7684\u8fb9\u754c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u9ad8\u65af\u6a21\u7cca\u53bb\u566a<\/p>\n<p>blurred = cv2.GaussianBlur(binary_image, (5, 5), 0)<\/p>\n<h2><strong>\u8f6e\u5ed3\u68c0\u6d4b<\/strong><\/h2>\n<p>contours, _ = cv2.findContours(blurred, cv2.RETR_EXTERNAL, cv2.CH<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>N_APPROX_SIMPLE)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001TESSERACT OCR\u8fdb\u884c\u6587\u672c\u8bc6\u522b<\/h3>\n<\/p>\n<p><p>Tesseract OCR\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5149\u5b66\u5b57\u7b26\u8bc6\u522b\u5f15\u64ce\uff0c\u53ef\u4ee5\u901a\u8fc7Python\u7684pytesseract\u5e93\u8fdb\u884c\u8c03\u7528\uff0c\u7528\u4e8e\u8bc6\u522b\u56fe\u50cf\u4e2d\u7684\u6587\u672c\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5\u548c\u4f7f\u7528pytesseract<\/h4>\n<\/p>\n<p><p>\u9996\u5148\u9700\u8981\u786e\u4fddTesseract OCR\u5728\u7cfb\u7edf\u4e2d\u5b89\u88c5\uff0c\u5e76\u901a\u8fc7pytesseract\u5e93\u8c03\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\"># \u5b89\u88c5pytesseract<\/p>\n<p>pip install pytesseract<\/p>\n<h2><strong>\u5b89\u88c5Tesseract OCR<\/strong><\/h2>\n<p>sudo apt-get install tesseract-ocr<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u8bc6\u522b\u56fe\u7247\u4e2d\u7684\u6570\u5b57<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528pytesseract\u5e93\u53ef\u4ee5\u65b9\u4fbf\u5730\u8bc6\u522b\u56fe\u50cf\u4e2d\u7684\u6570\u5b57\u6587\u672c\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u56fe\u50cf\u7684\u9884\u5904\u7406\u8d28\u91cf\u4f1a\u76f4\u63a5\u5f71\u54cd\u8bc6\u522b\u7684\u51c6\u786e\u6027\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pytesseract<\/p>\n<h2><strong>\u914d\u7f6eTesseract OCR\u8def\u5f84<\/strong><\/h2>\n<p>pytesseract.pytesseract.tesseract_cmd = r&#39;\/usr\/bin\/tesseract&#39;<\/p>\n<h2><strong>\u8bc6\u522b\u6570\u5b57<\/strong><\/h2>\n<p>text = pytesseract.image_to_string(binary_image, config=&#39;digits&#39;)<\/p>\n<p>print(&quot;\u8bc6\u522b\u7ed3\u679c:&quot;, text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\uff08CNN\uff09\u8fdb\u884c\u6df1\u5ea6\u5b66\u4e60\u5904\u7406<\/h3>\n<\/p>\n<p><p>\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\u662f\u6df1\u5ea6\u5b66\u4e60\u4e2d\u5904\u7406\u56fe\u50cf\u95ee\u9898\u7684\u5229\u5668\uff0c\u7279\u522b\u9002\u7528\u4e8e\u590d\u6742\u7684\u56fe\u50cf\u6570\u5b57\u8bc6\u522b\u4efb\u52a1\u3002<\/p>\n<\/p>\n<p><h4>1. \u51c6\u5907\u6570\u636e\u96c6<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u4f7f\u7528MNIST\u7b49\u6807\u51c6\u6570\u636e\u96c6\u8fdb\u884c\u8bad\u7ec3\uff0c\u8fd9\u4e9b\u6570\u636e\u96c6\u5305\u542b\u4e86\u5927\u91cf\u7684\u624b\u5199\u6570\u5b57\u6837\u672c\uff0c\u9002\u5408\u7528\u4e8e\u8bad\u7ec3\u6a21\u578b\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from tensorflow.keras.datasets import mnist<\/p>\n<h2><strong>\u52a0\u8f7dMNIST\u6570\u636e\u96c6<\/strong><\/h2>\n<p>(x_train, y_train), (x_test, y_test) = mnist.load_data()<\/p>\n<p>x_train, x_test = x_train \/ 255.0, x_test \/ 255.0<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u6784\u5efaCNN\u6a21\u578b<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528TensorFlow\u6216PyTorch\u7b49\u6846\u67b6\u6784\u5efaCNN\u6a21\u578b\u3002\u6a21\u578b\u901a\u5e38\u7531\u591a\u4e2a\u5377\u79ef\u5c42\u3001\u6c60\u5316\u5c42\u548c\u5168\u8fde\u63a5\u5c42\u7ec4\u6210\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from tensorflow.keras.models import Sequential<\/p>\n<p>from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Dense<\/p>\n<p>model = Sequential([<\/p>\n<p>    Conv2D(32, kernel_size=(3, 3), activation=&#39;relu&#39;, input_shape=(28, 28, 1)),<\/p>\n<p>    MaxPooling2D(pool_size=(2, 2)),<\/p>\n<p>    Flatten(),<\/p>\n<p>    Dense(128, activation=&#39;relu&#39;),<\/p>\n<p>    Dense(10, activation=&#39;softmax&#39;)<\/p>\n<p>])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u8bad\u7ec3\u548c\u8bc4\u4f30\u6a21\u578b<\/h4>\n<\/p>\n<p><p>\u8bad\u7ec3\u6a21\u578b\u9700\u8981\u5927\u91cf\u7684\u8ba1\u7b97\u8d44\u6e90\uff0c\u4f46\u53ef\u4ee5\u901a\u8fc7\u4e91\u670d\u52a1\u6216\u8005GPU\u52a0\u901f\u6765\u63d0\u9ad8\u6548\u7387\u3002\u8bad\u7ec3\u5b8c\u6210\u540e\uff0c\u4f7f\u7528\u6d4b\u8bd5\u6570\u636e\u96c6\u8bc4\u4f30\u6a21\u578b\u7684\u51c6\u786e\u6027\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u7f16\u8bd1\u6a21\u578b<\/p>\n<p>model.compile(optimizer=&#39;adam&#39;, loss=&#39;sparse_categorical_crossentropy&#39;, metrics=[&#39;accuracy&#39;])<\/p>\n<h2><strong>\u8bad\u7ec3\u6a21\u578b<\/strong><\/h2>\n<p>model.fit(x_train, y_train, epochs=5, validation_data=(x_test, y_test))<\/p>\n<h2><strong>\u8bc4\u4f30\u6a21\u578b<\/strong><\/h2>\n<p>test_loss, test_acc = model.evaluate(x_test, y_test)<\/p>\n<p>print(&#39;\u6d4b\u8bd5\u51c6\u786e\u7387:&#39;, test_acc)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u7ed3\u5408\u591a\u79cd\u65b9\u6cd5\u63d0\u9ad8\u8bc6\u522b\u7cbe\u5ea6<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u7ed3\u5408\u591a\u79cd\u65b9\u6cd5\u53ef\u4ee5\u8fdb\u4e00\u6b65\u63d0\u9ad8\u56fe\u50cf\u6570\u5b57\u8bc6\u522b\u7684\u51c6\u786e\u6027\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5148\u4f7f\u7528OpenCV\u8fdb\u884c\u56fe\u50cf\u9884\u5904\u7406\uff0c\u518d\u901a\u8fc7CNN\u8fdb\u884c\u6df1\u5ea6\u5b66\u4e60\u8bc6\u522b\uff0c\u6700\u540e\u4f7f\u7528Tesseract OCR\u8fdb\u884c\u6587\u672c\u9a8c\u8bc1\u3002<\/p>\n<\/p>\n<p><h4>1. \u591a\u5c42\u6b21\u56fe\u50cf\u9884\u5904\u7406<\/h4>\n<\/p>\n<p><p>\u7ed3\u5408\u591a\u79cd\u56fe\u50cf\u9884\u5904\u7406\u6280\u672f\uff0c\u5982\u81ea\u9002\u5e94\u9608\u503c\u3001\u5f62\u6001\u5b66\u64cd\u4f5c\u7b49\uff0c\u53ef\u4ee5\u6700\u5927\u9650\u5ea6\u5730\u63d0\u9ad8\u56fe\u50cf\u8d28\u91cf\uff0c\u4e3a\u540e\u7eed\u7684\u8bc6\u522b\u6b65\u9aa4\u63d0\u4f9b\u66f4\u597d\u7684\u8f93\u5165\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u81ea\u9002\u5e94\u9608\u503c<\/p>\n<p>adaptive_thresh = cv2.adaptiveThreshold(gray_image, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 11, 2)<\/p>\n<h2><strong>\u5f62\u6001\u5b66\u64cd\u4f5c<\/strong><\/h2>\n<p>kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (3, 3))<\/p>\n<p>morph = cv2.morphologyEx(adaptive_thresh, cv2.MORPH_CLOSE, kernel)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u96c6\u6210\u6df1\u5ea6\u5b66\u4e60\u548c\u4f20\u7edf\u65b9\u6cd5<\/h4>\n<\/p>\n<p><p>\u901a\u8fc7\u96c6\u6210\u6df1\u5ea6\u5b66\u4e60\u548c\u4f20\u7edf\u7684OCR\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5b9e\u73b0\u66f4\u9ad8\u7684\u8bc6\u522b\u7cbe\u5ea6\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5148\u4f7f\u7528CNN\u6a21\u578b\u8bc6\u522b\u6570\u5b57\uff0c\u7136\u540e\u5229\u7528Tesseract OCR\u8fdb\u884c\u6700\u7ec8\u786e\u8ba4\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528CNN\u6a21\u578b\u9884\u6d4b<\/p>\n<p>predictions = model.predict(x_test)<\/p>\n<h2><strong>\u4f7f\u7528Tesseract OCR\u9a8c\u8bc1<\/strong><\/h2>\n<p>ocr_text = pytesseract.image_to_string(morph, config=&#39;digits&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u79cd\u591a\u5c42\u6b21\u7684\u96c6\u6210\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5728\u590d\u6742\u7684\u73af\u5883\u4e2d\u8fbe\u5230\u66f4\u597d\u7684\u8bc6\u522b\u6548\u679c\uff0c\u6ee1\u8db3\u5b9e\u9645\u5e94\u7528\u7684\u9700\u6c42\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5728Python\u4e2d\u5982\u4f55\u4f7f\u7528\u6df1\u5ea6\u5b66\u4e60\u8bc6\u522b\u56fe\u7247\u4e2d\u7684\u6570\u5b57\uff1f<\/strong><br \/>\u4f7f\u7528\u6df1\u5ea6\u5b66\u4e60\u8bc6\u522b\u56fe\u7247\u4e2d\u7684\u6570\u5b57\u901a\u5e38\u6d89\u53ca\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\uff08CNN\uff09\u3002\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528Keras\u6216TensorFlow\u7b49\u5e93\u6765\u6784\u5efa\u6a21\u578b\u3002\u9996\u5148\u9700\u8981\u51c6\u5907\u4e00\u4e2a\u5305\u542b\u6570\u5b57\u7684\u56fe\u50cf\u6570\u636e\u96c6\uff0c\u4f8b\u5982MNIST\u6570\u636e\u96c6\u3002\u63a5\u7740\uff0c\u521b\u5efa\u4e00\u4e2aCNN\u6a21\u578b\uff0c\u8bad\u7ec3\u6a21\u578b\u5e76\u4f7f\u7528\u8bad\u7ec3\u597d\u7684\u6a21\u578b\u5bf9\u65b0\u56fe\u50cf\u8fdb\u884c\u9884\u6d4b\u3002\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u5e94\u7528\u6570\u636e\u589e\u5f3a\u548c\u6b63\u5219\u5316\u65b9\u6cd5\u6765\u63d0\u9ad8\u6a21\u578b\u7684\u51c6\u786e\u6027\u3002<\/p>\n<p><strong>\u6709\u54ea\u4e9bPython\u5e93\u53ef\u4ee5\u5e2e\u52a9\u6211\u8bc6\u522b\u56fe\u7247\u4e2d\u7684\u6570\u5b57\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u5e38\u7528\u7684\u5e93\u5305\u62ecOpenCV\u3001Pillow\u3001TensorFlow\u548cPyTorch\u3002OpenCV\u63d0\u4f9b\u4e86\u57fa\u672c\u7684\u56fe\u50cf\u5904\u7406\u529f\u80fd\uff0cPillow\u5219\u7528\u4e8e\u56fe\u50cf\u7684\u52a0\u8f7d\u548c\u9884\u5904\u7406\u3002TensorFlow\u548cPyTorch\u5219\u662f\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6\uff0c\u9002\u5408\u6784\u5efa\u548c\u8bad\u7ec3\u590d\u6742\u7684\u795e\u7ecf\u7f51\u7edc\uff0c\u80fd\u591f\u9ad8\u6548\u5730\u8fdb\u884c\u56fe\u50cf\u8bc6\u522b\u4efb\u52a1\u3002<\/p>\n<p><strong>\u5982\u4f55\u63d0\u9ad8Python\u8bc6\u522b\u56fe\u7247\u6570\u5b57\u7684\u51c6\u786e\u6027\uff1f<\/strong><br \/>\u63d0\u9ad8\u6570\u5b57\u8bc6\u522b\u51c6\u786e\u6027\u7684\u65b9\u6cd5\u6709\u5f88\u591a\u3002\u9996\u5148\uff0c\u786e\u4fdd\u4f7f\u7528\u9ad8\u8d28\u91cf\u7684\u8bad\u7ec3\u6570\u636e\u96c6\uff0c\u5e76\u8fdb\u884c\u9002\u5f53\u7684\u9884\u5904\u7406\uff0c\u6bd4\u5982\u7070\u5ea6\u5316\u3001\u5f52\u4e00\u5316\u548c\u53bb\u566a\u3002\u5176\u6b21\uff0c\u9009\u62e9\u5408\u9002\u7684\u6a21\u578b\u67b6\u6784\u548c\u8d85\u53c2\u6570\uff0c\u5982\u5b66\u4e60\u7387\u3001\u6279\u91cf\u5927\u5c0f\u7b49\u3002\u5229\u7528\u6570\u636e\u589e\u5f3a\u6280\u672f\uff0c\u5982\u65cb\u8f6c\u3001\u7f29\u653e\u548c\u7ffb\u8f6c\uff0c\u589e\u52a0\u6570\u636e\u591a\u6837\u6027\u3002\u6b64\u5916\uff0c\u91c7\u7528\u4ea4\u53c9\u9a8c\u8bc1\u548c\u8d85\u53c2\u6570\u8c03\u4f18\u7b56\u7565\uff0c\u80fd\u591f\u627e\u5230\u6700\u4f73\u7684\u6a21\u578b\u8bbe\u7f6e\uff0c\u4ece\u800c\u63d0\u9ad8\u8bc6\u522b\u6027\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u8bc6\u522b\u56fe\u7247\u6570\u5b57\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528OpenCV\u8fdb\u884c\u56fe\u50cf\u9884\u5904\u7406\u3001\u5229\u7528Tesseract OCR\u8fdb\u884c\u6587\u672c\u8bc6\u522b\u3001 [&hellip;]","protected":false},"author":3,"featured_media":962732,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/962725"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=962725"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/962725\/revisions"}],"predecessor-version":[{"id":962738,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/962725\/revisions\/962738"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/962732"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=962725"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=962725"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=962725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}