SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2104.11493 · 2021

Stroke-Based Scene Text Erasing Using Synthetic Data for Training

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 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, 1 violated it and 1 has no contract verdict; 6 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2104.11493.json · badge: /api/ran/2104.11493.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
tzm-tora/Stroke-Based-Scene-Text-Erasing canonical (classifier label)
classifier basis: census
8 ran · 1 no recorded run
FunctionStatusWhere it lives
GetCrossPoint Ran
ran; our contract draft was wrong, not the code
tzm-tora/Stroke-Based-Scene-Text-Erasing/src/evaluate.py
code served (permissive licence) · get_code("7c93bc546593d941")
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 Point. 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.

class Point(object):
    def __init__(self, x=0, y=0):
        self.x = x
        self.y = y

class Line(object):
    def __init__(self, p1, p2):
        self.p1 = p1
        self.p2 = p2
        self.a = None
        self.b = None
        self.c = None

p1_line1 = Point(x=0, y=0)
p2_line1 = Point(x=1, y=1)
l1 = Line(p1_line1, p2_line1)

p1_line2 = Point(x=0, y=1)
p2_line2 = Point(x=1, y=0)
l2 = Line(p1_line2, p2_line2)

ARGS = {
    'l1': l1,
    'l2': l2
}
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 Point — a Point output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Point 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
build_dice_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tzm-tora/Stroke-Based-Scene-Text-Erasing/src/loss.py
code served (permissive licence) · get_code("874f84aba112c536")
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 Tensor, ndim 0, dtype family float, shape () 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create small binary tensors for dice loss computation
# x_t: target tensor (batch_size=2, flattened_size=4)
# x_o: output tensor (batch_size=2, flattened_size=4)
x_t = torch.tensor([[1.0, 0.0, 1.0, 1.0],
                    [0.0, 1.0, 1.0, 0.0]], dtype=torch.float32)

x_o = torch.tensor([[1.0, 0.0, 0.0, 1.0],
                    [0.0, 1.0, 1.0, 1.0]], dtype=torch.float32)

ARGS = {
    "x_t": x_t,
    "x_o": x_o
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () 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
cross_point Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tzm-tora/Stroke-Based-Scene-Text-Erasing/src/evaluate.py
code served (permissive licence) · get_code("63432b111eb2c837")
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, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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.

# Setup code to construct valid arguments for cross_point function

ARGS = {
    "quad": [
        (0, 0),      # Point 1: (x1, y1)
        (4, 2),      # Point 2: (x2, y2)
        (3, 4),      # Point 3: (x3, y3)
        (1, 3)       # Point 4: (x4, y4)
    ]
}
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, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
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
gram_matrix Ran
ran on a synthesized input
tzm-tora/Stroke-Based-Scene-Text-Erasing/src/loss.py
code served (permissive licence) · get_code("1715f300a6a58899")
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 Tensor, ndim 3, dtype family float, shape (2, 4, 4) 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 torch

torch.manual_seed(0)

# Create a small feature tensor with shape (batch=2, channels=4, height=3, width=5)
# Using distinct sizes: batch=2, ch=4, h=3, w=5 to make dimensions unambiguous
feat = torch.randn(2, 4, 3, 5)

ARGS = {
    'feat': feat
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 4, 4) — shape (2, 4, 4) 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
is_image_file Ran
ran, violated the contract we drafted
tzm-tora/Stroke-Based-Scene-Text-Erasing/src/dataset.py
code served (permissive licence) · get_code("0516d5020cce56da")
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 bool, ndim 0, dtype family float, shape () 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 torch
import numpy as np

def is_image_file(filename):
    return any((filename.endswith(extension) for extension in ['.png', '.jpg', '.jpeg']))

ARGS = {
    'filename': 'test_image.jpg'
}
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 bool, ndim 0, dtype family float, shape () — shape () 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
tensor2jpg Ran
ran; our contract draft was wrong, not the code
tzm-tora/Stroke-Based-Scene-Text-Erasing/src/evaluate.py
code served (permissive licence) · get_code("f7714505800d49e0")
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 int, shape (6, 8, 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 torch
from torchvision import transforms
import numpy as np
import cv2
from PIL import Image

torch.manual_seed(0)

# Create a small tensor that represents an image
# The function expects a tensor that will be squeezed and normalized
# Shape: (1, 3, 4, 5) - batch=1, channels=3, height=4, width=5
tensor = torch.randn(1, 3, 4, 5)

# Define width and height for resizing
W = 8
H = 6

ARGS = {
    "tensor": tensor,
    "W": W,
    "H": H
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, cv2, numpy, torch, torchvision — 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 int, shape (6, 8, 3) — shape (6, 8, 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
to_items Ran
ran; our contract draft was wrong, not the code
tzm-tora/Stroke-Based-Scene-Text-Erasing/src/utils.py
code served (permissive licence) · get_code("79d7b29bdb460a4f")
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 dict. 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

torch.manual_seed(0)

# The function `to_items` takes a dict and calls _to_item on each item.
# _to_item expects item[0] (a key) and item[1] (a tensor with .item() method).
# So we need a dict where values are 0-d tensors (scalars).

dic = {
    'loss': torch.tensor(0.5),
    'accuracy': torch.tensor(0.95),
    'metric': torch.tensor(1.2)
}

ARGS = {
    'dic': dic
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
total_variation_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tzm-tora/Stroke-Based-Scene-Text-Erasing/src/loss.py
code served (permissive licence) · get_code("773d08e4e53da7a2")
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 Tensor, ndim 0, dtype family float, shape () 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 torch

torch.manual_seed(0)

# Create a small batch of images: shape (batch=2, channels=3, height=4, width=5)
image = torch.randn(2, 3, 4, 5)

# Create a mask: shape (batch=2, channels=3, height=4, width=5)
# Values should be 0 or 1, representing original pixels (1) and holes (0)
o_mask = torch.randint(0, 2, (2, 3, 4, 5), dtype=torch.float32)

# Method parameter
method = 'mean'

ARGS = {
    'image': image,
    'o_mask': o_mask,
    'method': method
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () 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
reduce_value Not yet run
unverified (harvested, no recorded run)
tzm-tora/Stroke-Based-Scene-Text-Erasing/src/utils.py
code served (permissive licence) · get_code("7ced8bebfd8253b0")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 4 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 2 later) and 5 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
is_image_file 8 other papers
7 dated earlier, 1 same year, order not determinable
1802.08797 (2018-02)
Residual Dense Network for Image Super-Resolution
1803.02735 (2018-03)
Deep Back-Projection Networks For Super-Resolution
1903.10128 (2019-03)
Recurrent Back-Projection Network for Video Super-Resolution
and 5 more not named here
gram_matrix 6 other papers
4 dated earlier, 2 later
1611.07004 (2016-11)
Image-to-Image Translation with Conditional Adversarial Networks
1804.07723 (2018-04)
Image Inpainting for Irregular Holes Using Partial Convolutions
2004.02788 (2020-04)
Self-Supervised Scene De-occlusion
and 3 more not named here
reduce_value 4 other papers
4 later
2210.11298 (2022-10)
Tele-Knowledge Pre-training for Fault Analysis
2212.14454 (2022-12)
MEAformer: Multi-modal Entity Alignment Transformer for Meta Modality Hybrid
2301.11259 (2023-01)
Domain-Agnostic Molecular Generation with Chemical Feedback
and 1 more not named here
to_items 1 other paper
1 dated earlier
1804.07723 (2018-04)
Image Inpainting for Irregular Holes Using Partial Convolutions

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-23.

Repositories linked to this paper

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

Abstract

Scene text erasing, which replaces text regions with reasonable content in natural images, has drawn significant attention in the computer vision community in recent years. There are two potential subtasks in scene text erasing: text detection and image inpainting. Both subtasks require considerable data to achieve better performance; however, the lack of a large-scale real-world scene-text removal dataset does not allow existing methods to realize their potential. To compensate for the lack of pairwise real-world data, we made considerable use of synthetic text after additional enhancement and subsequently trained our model only on the dataset generated by the improved synthetic text engine. Our proposed network contains a stroke mask prediction module and background inpainting module that can extract the text stroke as a relatively small hole from the cropped text image to maintain more background content for better inpainting results. This model can partially erase text instances in a scene image with a bounding box or work with an existing scene-text detector for automatic scene text erasing. The experimental results from the qualitative and quantitative evaluation on the SCUT-Syn, ICDAR2013, and SCUT-EnsText datasets demonstrate that our method significantly outperforms existing state-of-the-art methods even when they are trained on real-world data.

For agents

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

get_harvested_code_for_paper("2104.11493")
get_code_for_paper("2104.11493")
have("2104.11493")

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

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

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

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

Connect an agent — have() is free.