SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1904.01941 · 2019

Character Region Awareness for Text Detection

arXiv · PDF · Open in the Atlas

Code that ran

25 of 40 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; 1 honoured the contract we drafted, 0 violated it and 19 have no contract verdict; 5 failures of our instrument; 15 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/1904.01941.json · badge: /api/ran/1904.01941.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
nunenuh/craft.pytorch community (classifier label)
classifier basis not recorded on the link
7 ran · 3 no recorded run
clovaai/CRAFT-pytorch community (classifier label)
classifier basis not recorded on the link
7 ran · 1 no recorded run
jakartaresearch/receipt-ocr community (classifier label)
classifier basis not recorded on the link
4 ran · 7 no recorded run
chauthehan/CRAFT reimplementation (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
SakuraRiven/CRAFT reimplementation (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
autonise/CRAFT-Remade community (classifier label)
classifier basis not recorded on the link
1 ran · 4 no recorded run
SpikeKing/CRAFT-Re-reimplementation reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
batch_box_coordinate_to_xyminmax Ran
ran on a synthesized input
nunenuh/craft.pytorch/craft/ops/box_ops.py
code served (permissive licence) · get_code("e4c0369feb21e11b")
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 2, dtype family float, shape (2, 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 numpy as np

# Construct valid arguments for batch_box_coordinate_to_xyminmax
# The function expects:
# - boxes: a collection of boxes, where each box is (tl, tr, br, bl)
#   where each of tl, tr, br, bl is a coordinate pair [x, y]
# - to_int: boolean flag for converting to int

# Create sample boxes in the expected format
# Each box has 4 corners: top-left, top-right, bottom-right, bottom-left
# Each corner is [x, y]
box1 = [
    [10.5, 20.3],  # top-left
    [50.7, 20.1],  # top-right
    [50.2, 80.9],  # bottom-right
    [10.1, 81.2]   # bottom-left
]

box2 = [
    [100.2, 150.5],  # top-left
    [200.8, 149.9],  # top-right
    [199.5, 300.3],  # bottom-right
    [101.1, 301.7]   # bottom-left
]

boxes = [box1, box2]

ARGS = {
    "boxes": boxes,
    "to_int": False
}
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 2, dtype family float, shape (2, 4) — shape (2, 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
box_coordinate_to_xyminmax Ran
ran on a synthesized input
nunenuh/craft.pytorch/craft/ops/box_ops.py
code served (permissive licence) · get_code("cb9cc883042ddaf7")
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 int; 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.

import torch
import numpy as np

torch.manual_seed(0)

# The function expects a box parameter which is a tuple of 4 points (tl, tr, br, bl)
# Each point should have at least x and y coordinates (indices 0 and 1)
# We'll use simple lists or tuples with coordinate pairs

# Define four corner points of a bounding box
# tl = top-left, tr = top-right, br = bottom-right, bl = bottom-left
tl = [10, 20]      # top-left: x=10, y=20
tr = [50, 20]      # top-right: x=50, y=20
br = [50, 80]      # bottom-right: x=50, y=80
bl = [10, 80]      # bottom-left: x=10, y=80

box = (tl, tr, br, bl)

ARGS = {
    "box": box,
    "to_int": False
}
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, ndim 1, dtype family int — 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
clean_annots Ran
ran on a synthesized input
autonise/CRAFT-Remade/src/utils/data_structure_ic17.py
code served (permissive licence) · get_code("89d70e7cf93ed2df")
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 os
import tempfile
import numpy as np

# Create temporary directories for testing
base_path = tempfile.mkdtemp()
base_image_path = tempfile.mkdtemp()

# Create sample image files
image_names = ['img_1.png', 'img_2.jpg']
for img_name in image_names:
    open(os.path.join(base_image_path, img_name), 'w').close()

# Create corresponding ground truth annotation files
for img_name in image_names:
    gt_name = 'gt_' + img_name[:-3] + 'txt'
    gt_path = os.path.join(base_path, gt_name)
    with open(gt_path, 'w') as f:
        # Write sample annotations: 8 bbox coords, language, text
        # Format: x1,y1,x2,y2,x3,y3,x4,y4,language,text
        f.write("10,20,30,40,50,60,70,80,latin,hello\n")
        f.write("15,25,35,45,55,65,75,85,arabic,world\n")

ARGS = {
    'base_path': base_path,
    'base_image_path': base_image_path,
}
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 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
combine_point_single Ran
ran on a synthesized input
nunenuh/craft.pytorch/craft/datasets/utils.py
code served (permissive licence) · get_code("9ec176e145bf2527")
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.

import numpy as np

# Create sample numpy arrays for bx and by
bx = np.array([1.5, 2.7, 3.2, 4.9])
by = np.array([10.1, 20.3, 30.5, 40.8])

# Define arguments dictionary
ARGS = {
    'bx': bx,
    'by': by,
    'idxpos': 1,
    'to_int': False
}
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 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
compute_input Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
chauthehan/CRAFT/detect.py
pointer only (licence: NONE) · get_code("182a7a8c7e4855e0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, chauthehan/CRAFT 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.

copyStateDict Ran
ran; our contract draft was wrong, not the code
SpikeKing/CRAFT-Re-reimplementation/trainSyndata.py
pointer only (licence: NONE) · get_code("cec16dc1a4349b41")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, SpikeKing/CRAFT-Re-reimplementation 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.

copy_state_dict Ran
ran on a synthesized input
jakartaresearch/receipt-ocr/src/text_detector/load_model.py
code served (permissive licence) · get_code("57a0fb73bcfe67fa")
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 OrderedDict. 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
from collections import OrderedDict

torch.manual_seed(0)

# Create a state dict with 'module' prefix (simulating a DataParallel model)
state_dict_with_module = OrderedDict()
state_dict_with_module['module.layer1.weight'] = torch.randn(4, 3)
state_dict_with_module['module.layer1.bias'] = torch.randn(4)
state_dict_with_module['module.layer2.weight'] = torch.randn(5, 4)

ARGS = {
    'state_dict': state_dict_with_module
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
getDetBoxes_core Ran
ran on a synthesized input
clovaai/CRAFT-pytorch/craft_utils.py
code served (permissive licence) · get_code("c13a54a77b4f00e8")
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 numpy as np
import cv2

# Create small test maps for textmap and linkmap
# These should be 2D arrays (img_h, img_w)
img_h, img_w = 32, 48

# Create textmap with some high-value regions (text regions)
textmap = np.random.rand(img_h, img_w).astype(np.float32)
textmap[5:15, 10:20] = 0.8  # High value region
textmap[20:25, 30:40] = 0.7  # Another high value region

# Create linkmap with some link regions
linkmap = np.random.rand(img_h, img_w).astype(np.float32)
linkmap[14:16, 10:20] = 0.6  # Link region connecting text regions

# Set thresholds
text_threshold = 0.5
link_threshold = 0.4
low_text = 0.3

ARGS = {
    'textmap': textmap,
    'linkmap': linkmap,
    'text_threshold': text_threshold,
    'link_threshold': link_threshold,
    'low_text': low_text,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — 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
getPoly_core Ran
ran on a synthesized input
clovaai/CRAFT-pytorch/craft_utils.py
code served (permissive licence) · get_code("45f5918657dff3ff")
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 list, 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.

import numpy as np
import cv2

# Create a simple test case for getPoly_core
# The function expects:
# - boxes: list of 4x2 arrays representing quadrilaterals
# - labels: 2D array of labels
# - mapper: dict mapping box indices to label values
# - linkmap: appears unused in the function body

# Create synthetic boxes (quadrilaterals)
# Each box is a 4x2 array of corner points
box1 = np.array([
    [10.0, 10.0],
    [50.0, 15.0],
    [48.0, 45.0],
    [8.0, 40.0]
], dtype=np.float32)

box2 = np.array([
    [60.0, 20.0],
    [100.0, 22.0],
    [98.0, 50.0],
    [58.0, 48.0]
], dtype=np.float32)

boxes = [box1, box2]

# Create a synthetic labels image (2D array of label IDs)
# Make it large enough to contain both boxes
labels = np.zeros((100, 150), dtype=np.uint8)

# Fill regions corresponding to box locations with label values
labels[10:50, 10:60] = 1  # Label 1 for first box region
labels[20:55, 60:110] = 2  # Label 2 for second box region

# Create mapper: maps box index to label value
mapper = {0: 1, 1: 2}

# linkmap: appears to be unused in the function, so we can pass any placeholder
linkmap = np.zeros((100, 150), dtype=np.uint8)

ARGS = {
    'boxes': boxes,
    'labels': labels,
    'mapper': mapper,
    'linkmap': linkmap
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list 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
get_files Ran
ran on a synthesized input
clovaai/CRAFT-pytorch/file_utils.py
code served (permissive licence) · get_code("5eb8f5306638605a")
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 os
import tempfile
import shutil

# Create a temporary directory structure with test files
temp_dir = tempfile.mkdtemp()

# Create subdirectories
img_subdir = os.path.join(temp_dir, "images")
mask_subdir = os.path.join(temp_dir, "masks")
gt_subdir = os.path.join(temp_dir, "annotations")

os.makedirs(img_subdir, exist_ok=True)
os.makedirs(mask_subdir, exist_ok=True)
os.makedirs(gt_subdir, exist_ok=True)

# Create test image files with various supported extensions
open(os.path.join(img_subdir, "test1.jpg"), "w").close()
open(os.path.join(img_subdir, "test2.jpeg"), "w").close()
open(os.path.join(img_subdir, "test3.png"), "w").close()
open(os.path.join(img_subdir, "test4.gif"), "w").close()
open(os.path.join(img_subdir, "test5.pgm"), "w").close()

# Create test mask files
open(os.path.join(mask_subdir, "mask1.bmp"), "w").close()
open(os.path.join(mask_subdir, "mask2.bmp"), "w").close()

# Create test ground truth files
open(os.path.join(gt_subdir, "annotation1.xml"), "w").close()
open(os.path.join(gt_subdir, "annotation2.gt"), "w").close()
open(os.path.join(gt_subdir, "annotation3.txt"), "w").close()

# Create a zip file that should be ignored
open(os.path.join(temp_dir, "archive.zip"), "w").close()

ARGS = {
    "img_dir": temp_dir
}
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
get_rotated_width_height Ran
ran, honoured the contract we drafted
chauthehan/CRAFT/tools.py
pointer only (licence: NONE) · get_code("50ba87e95515668b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, chauthehan/CRAFT 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.

invert_input Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
chauthehan/CRAFT/detect.py
pointer only (licence: NONE) · get_code("477af6fc28a1f011")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, chauthehan/CRAFT 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.

list_files Ran
ran on a synthesized input
clovaai/CRAFT-pytorch/file_utils.py
code served (permissive licence) · get_code("3a2cb8ecd06449a7")
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 os
import tempfile
import shutil

# Create a temporary directory structure with test files
temp_dir = tempfile.mkdtemp()

# Create subdirectories
os.makedirs(os.path.join(temp_dir, "subdir1"), exist_ok=True)
os.makedirs(os.path.join(temp_dir, "subdir2"), exist_ok=True)

# Create test image files
open(os.path.join(temp_dir, "image1.jpg"), 'w').close()
open(os.path.join(temp_dir, "image2.PNG"), 'w').close()
open(os.path.join(temp_dir, "image3.jpeg"), 'w').close()
open(os.path.join(temp_dir, "image4.gif"), 'w').close()
open(os.path.join(temp_dir, "image5.pgm"), 'w').close()
open(os.path.join(temp_dir, "subdir1", "image6.jpg"), 'w').close()

# Create test mask files
open(os.path.join(temp_dir, "mask1.bmp"), 'w').close()
open(os.path.join(temp_dir, "subdir2", "mask2.bmp"), 'w').close()

# Create test ground truth files
open(os.path.join(temp_dir, "gt1.xml"), 'w').close()
open(os.path.join(temp_dir, "gt2.gt"), 'w').close()
open(os.path.join(temp_dir, "gt3.txt"), 'w').close()
open(os.path.join(temp_dir, "subdir1", "gt4.xml"), 'w').close()

# Create a file that should be ignored
open(os.path.join(temp_dir, "archive.zip"), 'w').close()

ARGS = {
    "in_path": temp_dir
}
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
loadImage Ran
ran on a synthesized input
clovaai/CRAFT-pytorch/imgproc.py
code served (permissive licence) · get_code("fcfd3b787bf16ec2")
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 (8, 10, 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
import tempfile
import os
from PIL import Image

# Create a temporary directory for test images
temp_dir = tempfile.mkdtemp()

# Create a simple RGB image and save it
rgb_img = Image.new('RGB', (10, 8), color=(255, 0, 0))
rgb_path = os.path.join(temp_dir, 'test_rgb.png')
rgb_img.save(rgb_path)

ARGS = {
    'img_file': rgb_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, cv2, numpy, skimage — 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 (8, 10, 3) — shape (8, 10, 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
load_json2dict Ran
ran on a synthesized input
nunenuh/craft.pytorch/craft/datasets/utils.py
code served (permissive licence) · get_code("1018b4cd7ad82c3d")
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 json
import tempfile
import os

# Create a temporary JSON file with test data
test_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "data"},
    "key4": 42
}

# Write to a temporary file
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.json")
with open(temp_file, 'w') as f:
    json.dump(test_data, f)

ARGS = {
    "pathfile": temp_file
}
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 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
negative_mask Ran
ran on a synthesized input
nunenuh/craft.pytorch/craft/nn/functional.py
code served (permissive licence) · get_code("4ee9e2489b6b87dc")
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 2, dtype family float, shape (2, 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 tensor with distinct dimensions for testing
score = torch.randn(2, 4)

# Create arguments dictionary
ARGS = {
    "score": score,
    "thresh": 0.0
}
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 2, dtype family float, shape (2, 4) — shape (2, 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
normalizeMeanVariance Ran
ran on a synthesized input
clovaai/CRAFT-pytorch/imgproc.py
code served (permissive licence) · get_code("bbb59da91782eb4d")
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 (4, 3, 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 a sample image as a numpy array
# Standard image shape would be (height, width, channels)
# Using small dimensions: 4x3 image with 3 color channels
in_img = np.random.randint(0, 256, size=(4, 3, 3), dtype=np.uint8)

# Define the arguments dictionary
ARGS = {
    "in_img": in_img,
    "mean": (0.485, 0.456, 0.406),
    "variance": (0.229, 0.224, 0.225)
}
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 (4, 3, 3) — shape (4, 3, 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
order_points Ran
ran on a synthesized input
nunenuh/craft.pytorch/craft/ops/box_ops.py
code served (permissive licence) · get_code("aa2cc8d50d099d54")
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 2, dtype family float, shape (4, 2) 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 a small set of 4 points with 2 coordinates each
# The function expects to order these 4 corner points of a rectangle
pts = np.array([
    [10.0, 20.0],
    [30.0, 10.0],
    [50.0, 40.0],
    [20.0, 50.0]
], dtype='float32')

ARGS = {
    'pts': pts
}
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 2, dtype family float, shape (4, 2) — shape (4, 2) 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
plot_boxes Ran
ran; our contract draft was wrong, not the code
SakuraRiven/CRAFT/detect.py
code served (permissive licence) · get_code("d52500f5b8ec969d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Image. 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 PIL import Image, ImageDraw
import numpy as np

# Create a small PIL Image
img = Image.new('RGB', (100, 80), color=(255, 255, 255))

# Create boxes - each box is defined by 8 coordinates (4 points, each with x,y)
# Format: [x1, y1, x2, y2, x3, y3, x4, y4]
boxes = [
    [10, 10, 40, 10, 40, 30, 10, 30],  # First box (rectangle)
    [50, 50, 70, 50, 70, 70, 50, 70],  # Second box (rectangle)
]

ARGS = {
    'img': img,
    'boxes': boxes
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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
positive_mask Ran
ran on a synthesized input
nunenuh/craft.pytorch/craft/nn/functional.py
code served (permissive licence) · get_code("1e3766c4386e7660")
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 2, dtype family float, shape (2, 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 score tensor (batch=2, features=4)
score = torch.randn(2, 4)

# Define threshold parameter
thresh = 0.0

# Construct the arguments dictionary
ARGS = {
    "score": score,
    "thresh": thresh
}
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 2, dtype family float, shape (2, 4) — shape (2, 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
resize_aspect_ratio Ran
ran on a synthesized input
jakartaresearch/receipt-ocr/src/text_detector/modules/imgproc.py
code served (permissive licence) · get_code("dfefccf0cadf1742")
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 numpy as np
import cv2

# Create a small test image with shape (height, width, channels)
test_img = np.random.randint(0, 256, (480, 640, 3), dtype=np.uint8)

ARGS = {
    "img": test_img,
    "square_size": 1024,
    "interpolation": cv2.INTER_LINEAR,
    "mag_ratio": 1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — 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
resize_img Ran
ran; our contract draft was wrong, not the code
SakuraRiven/CRAFT/detect.py
code served (permissive licence) · get_code("193feca2a79684d9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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 PIL import Image
import numpy as np

# Create a small test image
# Make it 64x48 (width x height) so we have distinct dimensions
width, height = 64, 48
img_array = np.random.randint(0, 255, (height, width, 3), dtype=np.uint8)
img = Image.fromarray(img_array, mode='RGB')

# Test with a long_side value
long_side = 128

ARGS = {
    'img': img,
    'long_side': long_side
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
PIL, numpy — 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
timeit Ran
ran on a synthesized input
jakartaresearch/receipt-ocr/src/engine.py
code served (permissive licence) · get_code("d54faa5a93381208")
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 function. 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 time
import torch
import torch.nn as nn

torch.manual_seed(0)

# The timeit function is a decorator that takes a method as its parameter
# It returns a timed wrapper function

# To test this decorator, we need to create a simple function to decorate
@lambda method: (lambda *args, **kw: (
    (ts := time.time()),
    (result := method(*args, **kw)),
    (te := time.time()),
    kw.get('log_time', {}).update({kw.get('log_name', method.__name__.upper()): int(te - ts)}) if 'log_time' in kw else print('%r  %2.2f s' % (method.__name__, te - ts)),
    result
)[-1])
def sample_method(x, y):
    """A simple method to be timed"""
    time.sleep(0.01)
    return x + y

# Alternative approach - define a simpler test function
def test_function(x, y):
    """Simple function to time"""
    time.sleep(0.001)
    return x + y

# Now create the ARGS dict
# The timeit function takes 'method' as its parameter
ARGS = {
    'method': test_function
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
warpCoord Ran
ran on a synthesized input
clovaai/CRAFT-pytorch/craft_utils.py
code served (permissive licence) · get_code("c2c03abebea398e0")
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 1, dtype family float, shape (2,) 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

# warpCoord applies a matrix transformation to a 2D point using homogeneous coordinates
# It takes:
# - Minv: a 3x3 matrix (inverse transformation matrix)
# - pt: a point with [x, y] coordinates

# Create a 3x3 inverse transformation matrix
# Using a simple perspective transformation matrix
Minv = np.array([
    [1.0, 0.2, 10.0],
    [0.1, 1.5, 5.0],
    [0.01, 0.02, 1.0]
], dtype=np.float32)

# Create a 2D point [x, y]
pt = np.array([100.0, 150.0], dtype=np.float32)

ARGS = {
    "Minv": Minv,
    "pt": pt
}
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 1, dtype family float, shape (2,) — shape (2,) 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
yaml_loader Ran
ran on a synthesized input
jakartaresearch/receipt-ocr/src/text_detector/modules/utils.py
code served (permissive licence) · get_code("ed031c09bde0c116")
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 tempfile
import os
import yaml

# Create a temporary YAML file with valid content
temp_dir = tempfile.mkdtemp()
yaml_file = os.path.join(temp_dir, "test_config.yaml")

# Write some valid YAML data to the file
yaml_data = {
    "model": "test_model",
    "learning_rate": 0.001,
    "batch_size": 32,
    "layers": [1, 2, 3]
}

with open(yaml_file, 'w') as f:
    yaml.dump(yaml_data, f)

# Define ARGS dict with the filename parameter
ARGS = {
    "filename": yaml_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — 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
data_preparation Not yet run
unverified (harvested, no recorded run)
jakartaresearch/receipt-ocr/src/text_recognizer/infer.py
code served (permissive licence) · get_code("884d81c7e8570b00")
How it ran

no invocation recorded.

denormalizeMeanVariance Not yet run
unverified (harvested, no recorded run)
clovaai/CRAFT-pytorch/imgproc.py
code served (permissive licence) · get_code("b9439a9c0e20cc6f")
How it ran

no invocation recorded.

denormalize_mean_variance Not yet run
unverified (harvested, no recorded run)
autonise/CRAFT-Remade/src/utils/data_manipulation.py
code served (permissive licence) · get_code("0967b66c489945c3")
How it ran

no invocation recorded.

inference Not yet run
unverified (harvested, no recorded run)
jakartaresearch/receipt-ocr/src/text_detector/infer.py
code served (permissive licence) · get_code("0080f90ce4243bd0")
How it ran

no invocation recorded.

inference Not yet run
unverified (harvested, no recorded run)
jakartaresearch/receipt-ocr/src/text_recognizer/infer.py
code served (permissive licence) · get_code("4966ec7a56eb141d")
How it ran

no invocation recorded.

load_craft Not yet run
unverified (harvested, no recorded run)
jakartaresearch/receipt-ocr/src/text_detector/load_model.py
code served (permissive licence) · get_code("4de3d5024b3166bc")
How it ran

no invocation recorded.

load_craft_onnx Not yet run
unverified (harvested, no recorded run)
jakartaresearch/receipt-ocr/src/text_detector/load_model.py
code served (permissive licence) · get_code("5fa3b7d854c65f78")
How it ran

no invocation recorded.

load_image Not yet run
unverified (harvested, no recorded run)
nunenuh/craft.pytorch/craft/datasets/utils.py
code served (permissive licence) · get_code("c6c3b5dabfc3b506")
How it ran

no invocation recorded.

load_star Not yet run
unverified (harvested, no recorded run)
jakartaresearch/receipt-ocr/src/text_recognizer/load_model.py
code served (permissive licence) · get_code("495ff57c5a36a262")
How it ran

no invocation recorded.

normalize_mean_variance Not yet run
unverified (harvested, no recorded run)
autonise/CRAFT-Remade/src/utils/data_manipulation.py
code served (permissive licence) · get_code("57aac6f1caa06b6f")
How it ran

no invocation recorded.

patch_replication_callback Not yet run
unverified (harvested, no recorded run)
autonise/CRAFT-Remade/src/utils/parallel.py
code served (permissive licence) · get_code("e50200dbeffa0133")
How it ran

no invocation recorded.

return_height_width Not yet run
unverified (harvested, no recorded run)
autonise/CRAFT-Remade/src/utils/check_dataset.py
code served (permissive licence) · get_code("14efc945c083eae4")
How it ran

no invocation recorded.

test_net Not yet run
unverified (harvested, no recorded run)
jakartaresearch/receipt-ocr/src/text_detector/infer.py
code served (permissive licence) · get_code("6642e901efdd1c29")
How it ran

no invocation recorded.

trainset_transform Not yet run
unverified (harvested, no recorded run)
nunenuh/craft.pytorch/craft/datasets/loader.py
code served (permissive licence) · get_code("d465866867a306de")
How it ran

no invocation recorded.

validset_transform Not yet run
unverified (harvested, no recorded run)
nunenuh/craft.pytorch/craft/datasets/loader.py
code served (permissive licence) · get_code("372dcf0bd38d6552")
How it ran

no invocation recorded.

Also present in other papers' code

Of 40 samples lifted from this paper's linked repositories, 40 carry a function identity and 0 do not. Of the 40 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 39 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
patch_replication_callback 16 other papers
2 dated earlier, 14 later
1612.01105 (2016-12)
Pyramid Scene Parsing Network
1807.10221 (2018-07)
Unified Perceptual Parsing for Scene Understanding
1909.02151 (2019-09)
KagNet: Knowledge-Aware Graph Networks for Commonsense Reasoning
and 13 more not named here

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 detection methods based on neural networks have emerged recently and have shown promising results. Previous methods trained with rigid word-level bounding boxes exhibit limitations in representing the text region in an arbitrary shape. In this paper, we propose a new scene text detection method to effectively detect text area by exploring each character and affinity between characters. To overcome the lack of individual character level annotations, our proposed framework exploits both the given character-level annotations for synthetic images and the estimated character-level ground-truths for real images acquired by the learned interim model. In order to estimate affinity between characters, the network is trained with the newly proposed representation for affinity. Extensive experiments on six benchmarks, including the TotalText and CTW-1500 datasets which contain highly curved texts in natural images, demonstrate that our character-level text detection significantly outperforms the state-of-the-art detectors. According to the results, our proposed method guarantees high flexibility in detecting complicated scene text images, such as arbitrarily-oriented, curved, or deformed texts.

For agents

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

get_harvested_code_for_paper("1904.01941")
get_code_for_paper("1904.01941")
have("1904.01941")

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

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

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

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

Connect an agent — have() is free.