SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · aaai_28245 · AAAI · 2024

ViTEraser: Harnessing the Power of Vision Transformers for Scene Text Removal with SegMIM Pretraining

Yuliang Liu, Dezhi Peng, Chongyu Liu, Lianwen Jin

Open in the Atlas

Code that ran

5 of 13 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 3 have no contract verdict; 2 failures of our instrument; 8 no recorded run), measured 2026-11-22; 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/aaai_28245.json · badge: /api/ran/aaai_28245.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
shannanyinxiang/ViTEraser canonical (classifier label)
classifier basis: census
5 ran · 8 no recorded run
FunctionStatusWhere it lives
build_lateral_connection Ran
ran; our contract draft was wrong, not the code
shannanyinxiang/ViTEraser/models/block.py
pointer only (licence: MIT); the stored copy get_code serves, from SCUT-DLVCLab/AutoHDR, is pointer only (licence: NONE) · get_code("a8a233a4fe10a771")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from SCUT-DLVCLab/AutoHDR, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

build_optimizer Ran
ran on a synthesized input
shannanyinxiang/ViTEraser/optim/optimizer/viteraser.py
code served (permissive licence) · get_code("dd0539f2c2889de0")
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
import torch.nn as nn

torch.manual_seed(0)

# Build a minimal model with encoder and non-encoder parameters
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.encoder = nn.Linear(4, 3)
        self.decoder = nn.Linear(3, 4)
    
    def forward(self, x):
        return self.decoder(self.encoder(x))

# Build a minimal discriminator
class MinimalDiscriminator(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer = nn.Linear(4, 2)
    
    def forward(self, x):
        return self.layer(x)

# Create model and discriminator instances
model = MinimalModel()
discriminator = MinimalDiscriminator()

# Create args object with all required attributes
class Args:
    def __init__(self):
        self.distributed = False
        self.lr = 0.001
        self.lr_encoder_ratio = 0.1
        self.weight_decay = 0.01

args = Args()

# Define ARGS dict with all function parameters
ARGS = {
    'model': model,
    'discriminator': discriminator,
    'args': args
}
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
build_seg_head Ran
ran on a synthesized input
shannanyinxiang/ViTEraser/models/seg_head.py
code served (permissive licence) · get_code("d13aa4b506a14746")
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 SegHead. 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 torch.nn as nn

torch.manual_seed(0)

class ArgsStandIn:
    def __init__(self):
        self.swin_enc_embed_dim = 4

ARGS = {
    'args': ArgsStandIn()
}
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 SegHead — a SegHead output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SegHead 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
get_activation Ran
ran; our contract draft was wrong, not the code
shannanyinxiang/ViTEraser/models/block.py
pointer only (licence: MIT); the stored copy get_code serves, from SCUT-DLVCLab/AutoHDR, is pointer only (licence: NONE) · get_code("4fcaa1927ce5f419")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from SCUT-DLVCLab/AutoHDR, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_pad Ran
ran on a synthesized input
shannanyinxiang/ViTEraser/models/discriminator.py
code served (permissive licence) · get_code("365bff967b0ae6db")
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 int, ndim 0, dtype family int, 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 numpy as np

def get_pad(in_, ksize, stride, atrous=1):
    out_ = np.ceil(float(in_) / stride)
    return int(((out_ - 1) * stride + atrous * (ksize - 1) + 1 - in_) / 2)

ARGS = {
    "in_": 64,
    "ksize": 3,
    "stride": 2,
    "atrous": 1
}
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 int, ndim 0, dtype family int, 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
build Not yet run
unverified (harvested, no recorded run)
shannanyinxiang/ViTEraser/models/viteraser.py
code served (permissive licence) · get_code("997f2a10b5a97651")
How it ran

no invocation recorded.

build Not yet run
unverified (harvested, no recorded run)
shannanyinxiang/ViTEraser/models/segmim.py
code served (permissive licence) · get_code("db550ace28175eaa")
How it ran

no invocation recorded.

build Not yet run
unverified (harvested, no recorded run)
shannanyinxiang/ViTEraser/datasets/segmim.py
code served (permissive licence) · get_code("601365b6fc104e7f")
How it ran

no invocation recorded.

build Not yet run
unverified (harvested, no recorded run)
shannanyinxiang/ViTEraser/datasets/texterase.py
code served (permissive licence) · get_code("0e72d80ae297be4d")
How it ran

no invocation recorded.

build_vgg16 Not yet run
unverified (harvested, no recorded run)
shannanyinxiang/ViTEraser/models/vgg16.py
code served (permissive licence) · get_code("e0705b82134b31c7")
How it ran

no invocation recorded.

load_pretrained_model Not yet run
unverified (harvested, no recorded run)
shannanyinxiang/ViTEraser/models/viteraser.py
code served (permissive licence) · get_code("583f63b3ce4bc9a5")
How it ran

no invocation recorded.

make_erase_transform Not yet run
unverified (harvested, no recorded run)
shannanyinxiang/ViTEraser/datasets/texterase.py
code served (permissive licence) · get_code("d5ac2306918ebb05")
How it ran

no invocation recorded.

make_transform Not yet run
unverified (harvested, no recorded run)
shannanyinxiang/ViTEraser/datasets/segmim.py
code served (permissive licence) · get_code("a179d71c7d59e8ff")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 3 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 2 later) and 10 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
get_pad 3 other papers
3 dated earlier
1908.00463 (2019-08)
DIODE: A Dense Indoor and Outdoor DEpth Dataset
136780474 (2022 (year only))
Hourglass Attention Network for Image Inpainting
2302.09491 (2023-02)
X-Adv: Physical Adversarial Object Attacks against X-ray Prohibited Item Detection
build_lateral_connection 1 other paper
1 later
2507.05108 (2025-07)
Reviving Cultural Heritage: A Novel Approach for Comprehensive Historical Document Restoration
get_activation 1 other paper
1 later
2507.05108 (2025-07)
Reviving Cultural Heritage: A Novel Approach for Comprehensive Historical Document Restoration

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

Scene text removal (STR) aims at replacing text strokes in natural scenes with visually coherent backgrounds. Recent STR approaches rely on iterative refinements or explicit text masks, resulting in high complexity and sensitivity to the accuracy of text localization. Moreover, most existing STR methods adopt convolutional architectures while the potential of vision Transformers (ViTs) remains largely unexplored. In this paper, we propose a simple-yet-effective ViT-based text eraser, dubbed ViTEraser. Following a concise encoderdecoder framework, ViTEraser can easily incorporate various ViTs to enhance long-range modeling. Specifically, the encoder hierarchically maps the input image into the hidden space through ViT blocks and patch embedding layers, while the decoder gradually upsamples the hidden features to the text-erased image with ViT blocks and patch splitting layers. As ViTEraser implicitly integrates text localization and inpainting, we propose a novel end-to-end pretraining method, termed SegMIM, which focuses the encoder and decoder on the text box segmentation and masked image modeling tasks, respectively. Experimental results demonstrate that ViTEraser with SegMIM achieves state-of-the-art performance on STR by a substantial margin and exhibits strong generalization ability when extended to other tasks, e.g., tampered scene text detection. Furthermore, we comprehensively explore the architecture, pretraining, and scalability of the ViT-based encoder-decoder for STR, which provides deep insights into the application of ViT to the STR field. Code is available at https://github.com/shannanyinxiang/ViTEraser.

For agents

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

get_harvested_code_for_paper("aaai_28245")
get_code_for_paper("aaai_28245")
have("aaai_28245")

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

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

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

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

Connect an agent — have() is free.