SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2112.09220 · NeurIPS · 2021

Sim2Real Docs: Domain Randomization for Documents in Natural Scenes using Ray-traced Rendering

Nikhil Maddikunta, Huijun Zhao, Sumit Keswani, Alfy Samuel, Fu-Ming Guo, Nishan Srishankar, Vishwa Pardeshi, Austin Huang

arXiv · PDF · Open in the Atlas

Code that ran

3 of 4 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 0 have no contract verdict; 2 failures of our instrument; 1 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/2112.09220.json · badge: /api/ran/2112.09220.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
fidelity/sim2real-docs canonical (classifier label)
classifier basis: classifier_2025
3 ran · 1 no recorded run
FunctionStatusWhere it lives
get_image_parameters Ran
ran; our contract draft was wrong, not the code
fidelity/sim2real-docs/sim2real_docs/create_random_values.py
code served (permissive licence) · get_code("b05a7b2a3245470b")
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) and returned list. 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 random
from collections import namedtuple
import numpy as np

image_options = ['image_x_scale', 'image_y_scale', 'image_z_scale', 'image_x_rotation', 'image_y_rotation', 'image_z_rotation', 'image_bbs', 'background_image_name', 'image_name']

# Set seed for reproducibility
np.random.seed(0)
random.seed(0)

# Define image_configs with required keys and ranges
image_configs = {
    'image_x_scale': {'range': [0.5, 2.0]},
    'image_y_scale': {'range': [0.5, 2.0]},
    'image_z_scale': {'range': [0.5, 2.0]},
    'image_x_rotation': {'range': [0.0, 360.0]},
    'image_y_rotation': {'range': [0.0, 360.0]},
    'image_z_rotation': {'range': [0.0, 360.0]},
}

# Define image files list
image_files = ['image_1.jpg', 'image_2.jpg', 'image_3.jpg']

# Define background images list
bg_list = ['bg_1.jpg', 'bg_2.jpg', 'bg_3.jpg']

# Number of variations
n_variations = 3

ARGS = {
    'n_variations': n_variations,
    'image_configs': image_configs,
    'image_files': image_files,
    'bg_list': bg_list,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list 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
load_config Ran
ran; our contract draft was wrong, not the code
fidelity/sim2real-docs/sim2real_docs/render_docs.py
code served (permissive licence) · get_code("1f58647f2964aa97")
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) 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 os
import json
from pathlib import Path
from unittest.mock import Mock, MagicMock, patch

# Mock the required functions that are called in load_config
def get_sample_variations(image_path, image_name=None, bg_path=None, config_file=None):
    # Returns: scene_params, light_params, camera_params, other_params, image_params
    scene_params = [Mock(spec=['some_attr'])]
    light_params = [Mock(spec=['some_attr'])]
    camera_params = [Mock(spec=['some_attr'])]
    other_params = Mock(render_device_type='CPU')
    image_params = [Mock(background_image_name='')]
    return scene_params, light_params, camera_params, other_params, image_params

def install_addons():
    pass

def set_render_device(device_type):
    pass

def set_render_viewport():
    pass

def get_collection_name():
    return 'Collection'

def run_scene_settings(scene_variation=None):
    return Mock()

def run_camera_settings(camera_variation=None, collection_name=None):
    camera_obj = Mock()
    return Mock(camera_object=camera_obj)

def run_light_settings(light_variation=None):
    light_obj = Mock()
    return Mock(light_object=light_obj)

def run_image_settings(image_variation=None, path=None, scene_variations=None):
    image_obj = Mock()
    return Mock(), Mock(image_object=image_obj)

def add_n_scale_background_image(image_params, bg_path):
    pass

# Patch all the functions in the module namespace
import sys
current_module = sys.modules[__name__]
current_module.get_sample_variations = get_sample_variations
current_module.install_addons = install_addons
current_module.set_render_device = set_render_device
current_module.set_render_viewport = set_render_viewport
current_module.get_collection_name = get_collection_name
current_module.run_scene_settings = run_scene_settings
current_module.run_camera_settings = run_camera_settings
current_module.run_light_settings = run_light_settings
current_module.run_image_settings = run_image_settings
current_module.add_n_scale_background_image = add_n_scale_background_image

ARGS = {
    'image_path': '/tmp/test_image.png',
    'image_name': 'test_image',
    'bg_path': '/tmp/background.png',
    'config_file': '/tmp/config.json'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
random_range Ran
ran, honoured the contract we drafted
fidelity/sim2real-docs/sim2real_docs/create_random_values.py
code served (permissive licence) · get_code("9fd83ceb1d574de7")
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 (5,) 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 a minimal configs dictionary that satisfies the function's requirements
configs = {
    'learning_rate': {
        'range': [0.001, 0.1]
    },
    'dropout': {
        'range': [0.0, 0.5]
    },
    'batch_size': {
        'range': [16, 128]
    }
}

# Define the variable to generate random values for
variable = 'learning_rate'

# Define the number of variations to generate
variations = 5

ARGS = {
    'configs': configs,
    'variable': variable,
    'variations': variations
}
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 (5,) — shape (5,) 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
get_configuration_file Not yet run
unverified (harvested, no recorded run)
fidelity/sim2real-docs/sim2real_docs/render_docs.py
code served (permissive licence) · get_code("1bc0de41907c7da9")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 4 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.

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

In the past, computer vision systems for digitized documents could rely on systematically captured, high-quality scans. Today, transactions involving digital documents are more likely to start as mobile phone photo uploads taken by non-professionals. As such, computer vision for document automation must now account for documents captured in natural scene contexts. An additional challenge is that task objectives for document processing can be highly use-case specific, which makes publiclyavailable datasets limited in their utility, while manual data labeling is also costly and poorly translates between use cases. To address these issues we created Sim2Real Docs 2 -a framework for synthesizing datasets and performing domain randomization of documents in natural scenes. Sim2Real Docs enables programmatic 3D rendering of documents using Blender, an open source tool for 3D modeling and ray-traced rendering. By using rendering that simulates physical interactions of light, geometry, camera, and background, we synthesize datasets of documents in a natural scene context. Each render is paired with use-case specific ground truth data specifying latent characteristics of interest, producing unlimited fit-for-task training data. The role of machine learning models is then to solve the inverse problem posed by the rendering pipeline. Such models can be further iterated upon with real-world data by either fine tuning or making adjustments to domain randomization parameters.

For agents

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

get_harvested_code_for_paper("2112.09220")
get_code_for_paper("2112.09220")
have("2112.09220")

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

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

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

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

Connect an agent — have() is free.