SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2009.09941 · 2020

PP-OCR: A Practical Ultra Lightweight OCR System

arXiv · PDF · Open in the Atlas

Code that ran

9 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 9 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2009.09941.json · badge: /api/ran/2009.09941.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
JasonZK/Soccer_OCR community (classifier label)
classifier basis not recorded on the link
4 ran · 2 no recorded run
Mushroomcat9998/PaddleOCR community (classifier label)
classifier basis not recorded on the link
3 ran · 1 no recorded run
qingyu95/ICDAR2017-DATASET community (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
simplify23/Ultra_light_OCR_No.11 community (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
FunctionStatusWhere it lives
check_line Ran
ran on a synthesized input
JasonZK/Soccer_OCR/OOP_only_clean_big_ggl.py
code served (permissive licence) · get_code("1be3cc75ead87256")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from collections import defaultdict

class MockLine:
    def __init__(self, strr):
        self.strr = strr

# Create test data
result_line = [
    MockLine("45' Goal P"),
    MockLine("90+2' OG"),
    MockLine("22' John Smith 1"),
]

LorR = 1
player_name_dic = defaultdict(int)
big_candidate = defaultdict(set)
score_time_dic = defaultdict(int)
i = 0
Player_Time_list = []
big_flag = False

ARGS = {
    'result_line': result_line,
    'LorR': LorR,
    'player_name_dic': player_name_dic,
    'big_candidate': big_candidate,
    'score_time_dic': score_time_dic,
    'i': i,
    'Player_Time_list': Player_Time_list,
    'big_flag': big_flag,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
check_line Ran
ran on a synthesized input
JasonZK/Soccer_OCR/OOP_only_clean_big_ggl_tail.py
code served (permissive licence) · get_code("c7bd3f9d7fb0b8cd")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from collections import defaultdict

class MockLine:
    """Mock line object with a 'strr' attribute containing score information"""
    def __init__(self, strr):
        self.strr = strr

# Create test data for result_line
result_line = [
    MockLine("45' P John Smith"),
    MockLine("90+2' OG Jane Doe"),
    MockLine("67' Mark Johnson"),
]

# LorR parameter: 1 for left/home, -1 for right/away
LorR = 1

# player_name_dic: defaultdict to count player occurrences
player_name_dic = defaultdict(int)

# big_candidate: defaultdict with sets to track candidates
big_candidate = defaultdict(set)

# score_time_dic: defaultdict to count score times
score_time_dic = defaultdict(int)

# i: index parameter (used in function signature but not in body)
i = 0

# Player_Time_list: list to collect PlayerTime objects
Player_Time_list = []

# big_flag: boolean flag to track if big event occurred
big_flag = False

ARGS = {
    'result_line': result_line,
    'LorR': LorR,
    'player_name_dic': player_name_dic,
    'big_candidate': big_candidate,
    'score_time_dic': score_time_dic,
    'i': i,
    'Player_Time_list': Player_Time_list,
    'big_flag': big_flag,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
cv2_to_base64 Ran
ran on a synthesized input
qingyu95/ICDAR2017-DATASET/deploy/pdserving/clas_web_client.py
code served (permissive licence) · get_code("4f512b08012a4c0f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import base64
import numpy as np

# The function cv2_to_base64 takes an image and base64 encodes it
# The image parameter should be bytes or a bytes-like object
# We'll create a small image as a numpy array, then convert to bytes

# Create a small dummy image (simulating a CV2 image as bytes)
# Images from cv2 are typically numpy arrays, but base64.b64encode expects bytes
# So we need to convert the numpy array to bytes
image_array = np.random.randint(0, 256, (4, 3, 3), dtype=np.uint8)  # Small image: 4x3 with 3 channels
image_bytes = image_array.tobytes()

ARGS = {
    "image": image_bytes
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
evaluate_candidates Ran
ran on a synthesized input
JasonZK/Soccer_OCR/clean_big_ggl.py
code served (permissive licence) · get_code("c530a900adfcaf72")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# Analyze the function to determine what each parameter needs:
# - i: int (used in arithmetic and dict key)
# - init_candidate: dict with string keys like "num-num", values are ints
# - score_dic: dict to store scores
# - score_record: list of tuples (i, key_string)
# - location: bool flag
# - temp_result: nested structure with indexing [0][tempResult_index][2][1]
# - tempResult_index: int for indexing
# - modify_candidate: dict with string keys, int values
# - more: int counter
# - gt_y2: int or None, stores a coordinate
# - big_candidate: dict (appears unused in function body)
# - player_score_dic: dict (appears unused in function body)
# - player_score_record: dict or list (appears unused in function body)
# - big_flag: bool (controls increment size)
# - player_name_dic: dict (appears unused in function body)

# Build temp_result structure to support temp_result[0][tempResult_index][2][1]
# This needs to be: list -> list -> list -> indexable to [2] -> indexable to [1]
temp_result = [
    [
        [
            [0, 0],  # [0]
            [0, 0],  # [1]
            [0, 42]  # [2] - accessing [2][1] gives 42
        ]
    ]
]

ARGS = {
    'i': 0,
    'init_candidate': {'0-1': 3, '1-2': 5},
    'score_dic': {},
    'score_record': [],
    'location': False,
    'temp_result': temp_result,
    'tempResult_index': 0,
    'modify_candidate': {},
    'more': 0,
    'gt_y2': None,
    'big_candidate': {},
    'player_score_dic': {},
    'player_score_record': [],
    'big_flag': False,
    'player_name_dic': {}
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
evaluate_candidates Ran
ran on a synthesized input
JasonZK/Soccer_OCR/clean_ggl.py
code served (permissive licence) · get_code("50217119d0dedf6d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze function usage:
# - i: integer (used in arithmetic i += 500)
# - init_candidate: dict with string keys, numeric values (checks >= 3)
# - score_dic: dict mapping int to string
# - score_record: list of tuples (int, str), can be empty, checks if empty, appends/modifies
# - location: boolean
# - temp_result: list containing nested structure with indexing [0][tempResult_index][2][1]
# - tempResult_index: integer (used as index)
# - modify_candidate: dict with string keys, numeric values (can increment, clear)
# - more: integer (incremented +=1)
# - gt_y2: some value that gets assigned from temp_result access

# Build minimal valid arguments:

i = 0
init_candidate = {
    "1-0": 5,
    "2-1": 3,
    "0-0": 1
}

score_dic = {}

score_record = []

location = False

# temp_result needs structure: [0][tempResult_index][2][1] to be accessible
# Make a simple nested structure
tempResult_index = 0
temp_result = [
    [
        [
            [None, None],
            [None, None],
            [None, 42]  # index [2][1] = 42
        ]
    ]
]

modify_candidate = {
    "1-0": 0,
    "0-1": 0
}

more = 0

gt_y2 = None

ARGS = {
    "i": i,
    "init_candidate": init_candidate,
    "score_dic": score_dic,
    "score_record": score_record,
    "location": location,
    "temp_result": temp_result,
    "tempResult_index": tempResult_index,
    "modify_candidate": modify_candidate,
    "more": more,
    "gt_y2": gt_y2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ohem_single Ran
ran on a synthesized input
Mushroomcat9998/PaddleOCR/ppocr/losses/det_basic_loss.py
code served (permissive licence) · get_code("ea3ff3c86a936513")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 3, dtype family float, shape (1, 4, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create small test arrays for the ohem_single function
# The function expects:
# - score: a 2D array of scores
# - gt_text: a 2D array of ground truth text masks
# - training_mask: a 2D array of training masks
# - ohem_ratio: a float ratio for OHEM selection

height, width = 4, 3

# Create score array with values in reasonable range for hard example mining
score = np.random.rand(height, width).astype('float32')

# Create gt_text with some positive (>0.5) and negative (<=0.5) values
gt_text = np.random.rand(height, width).astype('float32')
gt_text[0:2, 0:2] = 0.7  # Some positive examples
gt_text[2:4, 1:3] = 0.3  # Some negative examples

# Create training_mask with some valid (>0.5) and invalid (<=0.5) regions
training_mask = np.ones((height, width), dtype='float32')
training_mask[0, 0] = 0.2  # One invalid region

# Set ohem_ratio for selecting hard negatives
ohem_ratio = 3.0

ARGS = {
    'score': score,
    'gt_text': gt_text,
    'training_mask': training_mask,
    'ohem_ratio': ohem_ratio
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (1, 4, 3) — shape (1, 4, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_args Ran
ran on a synthesized input
Mushroomcat9998/PaddleOCR/paddleocr.py
code served (permissive licence) · get_code("e7ac5ba2f2c58755")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Namespace. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import argparse
import sys

# Set up minimal arguments for parse_args function
ARGS = {
    'mMain': False,  # Use False to avoid parsing command line args
    'add_help': True
}

# When mMain=False, the function returns a pre-constructed Namespace
# This is the setup code that allows parse_args(mMain=False) to execute
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_args Ran
ran on a synthesized input
simplify23/Ultra_light_OCR_No.11/paddleocr.py
code served (permissive licence) · get_code("006a28646179fcce")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Namespace. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import sys
from io import StringIO

# Since parse_args() calls parser.parse_args() with no arguments,
# we need to mock sys.argv to provide command-line arguments
sys.argv = ['program']

# Define ARGS dict with all parameters for parse_args
ARGS = {
    'mMain': False,  # Use False to avoid parsing actual command line args
    'add_help': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read Ran
ran on a synthesized input
Mushroomcat9998/PaddleOCR/PPOCRLabel/PPOCRLabel.py
code served (permissive licence) · get_code("14b9c019942ef1b5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bytes. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os

# Create a temporary file with some binary content
temp_file = tempfile.NamedTemporaryFile(delete=False, mode='wb')
temp_file.write(b"test binary content")
temp_file.close()
temp_filename = temp_file.name

# Define ARGS with valid arguments for the read function
ARGS = {
    'filename': temp_filename,
    'default': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bytes — a bytes output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a bytes output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
find_goal_location Not yet run
unverified (harvested, no recorded run)
JasonZK/Soccer_OCR/clean_big_ggl.py
code served (permissive licence) · get_code("3b5fd627a82b176e")
How it ran

no invocation recorded.

get_frame_dic Not yet run
unverified (harvested, no recorded run)
JasonZK/Soccer_OCR/big_ggl.py
code served (permissive licence) · get_code("7065c977588feaab")
How it ran

no invocation recorded.

inverted Not yet run
unverified (harvested, no recorded run)
Mushroomcat9998/PaddleOCR/PPOCRLabel/PPOCRLabel.py
code served (permissive licence) · get_code("0769a6bb4dc29a4c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 3 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 3 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
inverted 3 other papers
1 dated earlier, 2 later
2007.07542 (2020-07)
RobustScanner: Dynamically Enhancing Positional Clues for Robust Text Recognition
2104.10442 (2021-04)
Fourier Contour Embedding for Arbitrary-Shaped Text Detection
aaai_26777 (2023 (year only))
HOTCOLD Block: Fooling Thermal Infrared Detectors with a Novel Wearable Design
read 2 other papers
1 dated earlier, 1 later
2007.07542 (2020-07)
RobustScanner: Dynamically Enhancing Positional Clues for Robust Text Recognition
2104.10442 (2021-04)
Fourier Contour Embedding for Arbitrary-Shaped Text Detection
ohem_single 1 other paper
1 later
2104.10442 (2021-04)
Fourier Contour Embedding for Arbitrary-Shaped Text Detection

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

The Optical Character Recognition (OCR) systems have been widely used in various of application scenarios, such as office automation (OA) systems, factory automations, online educations, map productions etc. However, OCR is still a challenging task due to the various of text appearances and the demand of computational efficiency. In this paper, we propose a practical ultra lightweight OCR system, i.e., PP-OCR. The overall model size of the PP-OCR is only 3.5M for recognizing 6622 Chinese characters and 2.8M for recognizing 63 alphanumeric symbols, respectively. We introduce a bag of strategies to either enhance the model ability or reduce the model size. The corresponding ablation experiments with the real data are also provided. Meanwhile, several pre-trained models for the Chinese and English recognition are released, including a text detector (97K images are used), a direction classifier (600K images are used) as well as a text recognizer (17.9M images are used). Besides, the proposed PP-OCR are also verified in several other language recognition tasks, including French, Korean, Japanese and German. All of the above mentioned models are open-sourced and the codes are available in the GitHub repository, i.e., https://github.com/PaddlePaddle/PaddleOCR.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2009.09941")
get_code_for_paper("2009.09941")
have("2009.09941")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2009.09941.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2009.09941.svg)](https://syntology.ai/paper/2009.09941)

Connect an agent — have() is free.