{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# OCR text detection practice\n", "\n", "This section will introduce how to use PaddleOCR to complete the training and operation of the text detection DB algorithm, including:\n", "1. Quickly call PaddleOCR package to experience text detection\n", "2. Understand the principle of text detection DB algorithm\n", "3. Master the text detection model construction process\n", "4. Master the text detection model training process\n", "\n", "Note: `paddleocr` refers to `PaddleOCR whl package`.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 1. Quick start\n", "\n", "This section takes [paddleocr](https://pypi.org/project/paddleocr/) as an example to introduce how to quickly implement text detection in three steps.\n", "1. Install [PaddleOCR whl package](https://github.com/PaddlePaddle/PaddleOCR/blob/release%2F2.4/doc/doc_ch/whl.md)\n", "2. One line of command to run the DB algorithm to get the test result\n", "3. Visualize text detection results\n", "\n", "\n", "**Install PaddleOCR whl package**" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [], "source": [ "!pip install --upgrade pip\n", "!pip install paddleocr" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**One line of command to achieve text detection**\n", "\n", "When running for the first time, `paddleocr` will automatically download and use [PP-OCRv2 lightweight model](https://github.com/PaddlePaddle/PaddleOCR/blob/release%2F2.4/README.md#pp-ocr-series-model-listupdate-on-september-8th) in PaddleOCR's github repository.\n", "\n", "Using the installed `paddleocr` to predict the input image `./12.jpg`, the following results will be obtained:\n", "\n", "