SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2304.08821 · 2023

TTIDA: Controllable Generative Data Augmentation via Text-to-Text and Text-to-Image Models

arXiv · PDF · Open in the Atlas

Code that ran

9 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, 0 violated it and 7 have no contract verdict; 2 failures of our instrument; 0 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/2304.08821.json · badge: /api/ran/2304.08821.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
yuweiyin/ttida canonical (classifier label)
classifier basis: census
9 ran · 0 no recorded run
FunctionStatusWhere it lives
get_image_files_dict Ran
ran on a synthesized input
yuweiyin/ttida/glide_finetune/loader.py
code served (permissive licence) · get_code("0f1ef58c47413e31")
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 pathlib
from pathlib import Path

# Create a temporary directory structure with image files
temp_dir = tempfile.TemporaryDirectory()
base_path = Path(temp_dir.name)

# Create some subdirectories and image files
subdir1 = base_path / "subdir1"
subdir1.mkdir(exist_ok=True)
subdir2 = base_path / "subdir2"
subdir2.mkdir(exist_ok=True)

# Create dummy image files with different extensions
(subdir1 / "image1.png").touch()
(subdir1 / "image2.jpg").touch()
(subdir2 / "image3.jpeg").touch()
(base_path / "image4.bmp").touch()
(base_path / "notanimage.txt").touch()  # Should not be included

ARGS = {
    "base_path": base_path
}
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
get_param_groups_and_shapes Ran
ran on a synthesized input
yuweiyin/ttida/glide_finetune/fp16_util.py
code served (permissive licence) · get_code("4a01f5607a55ea2f")
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. 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)

# Create a simple model with parameters of different dimensions
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        # Scalar/vector parameters (ndim <= 1)
        self.bias = nn.Parameter(torch.randn(4))
        self.scale = nn.Parameter(torch.tensor(2.0))
        
        # Matrix parameters (ndim > 1)
        self.weight1 = nn.Parameter(torch.randn(3, 4))
        self.weight2 = nn.Parameter(torch.randn(5, 6, 2))
    
    def forward(self, x):
        return x

model = SimpleModel()

# Get named parameters from the model
named_model_params = model.named_parameters()

ARGS = {
    "named_model_params": named_model_params
}
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 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
get_text_files_dict Ran
ran on a synthesized input
yuweiyin/ttida/glide_finetune/loader.py
code served (permissive licence) · get_code("63b930347ee7b06d")
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
from pathlib import Path

# Create a temporary directory with some .txt files
temp_dir = tempfile.TemporaryDirectory()
base_path = Path(temp_dir.name)

# Create a few .txt files
(base_path / "file1.txt").write_text("content1")
(base_path / "file2.txt").write_text("content2")

# Create a subdirectory with another .txt file
subdir = base_path / "subdir"
subdir.mkdir()
(subdir / "file3.txt").write_text("content3")

ARGS = {
    "base_path": base_path
}
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
make_master_params Ran
ran; our contract draft was wrong, not the code
yuweiyin/ttida/glide_finetune/fp16_util.py
pointer only (licence: MIT); the stored copy get_code serves, from ZhendongWang6/DIRE, is pointer only (licence: NONE) · get_code("e20dd5102da3b050")
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 ZhendongWang6/DIRE, 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.

pil_image_to_norm_tensor Ran
ran on a synthesized input
yuweiyin/ttida/glide_finetune/train_util.py
code served (permissive licence) · get_code("373efaac682e04f5")
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 (3, 4, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import torch
from PIL import Image

torch.manual_seed(0)

# Create a small PIL image to use as input
# PIL images have shape (H, W, C) in most cases
# Create a 4x3 RGB image (height=4, width=3, channels=3)
image_array = np.random.randint(0, 256, size=(4, 3, 3), dtype=np.uint8)
pil_image = Image.fromarray(image_array, mode='RGB')

ARGS = {
    'pil_image': pil_image
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, 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 (3, 4, 3) — shape (3, 4, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
pred_to_pil Ran
ran on a synthesized input
yuweiyin/ttida/glide_finetune/train_util.py
code served (permissive licence) · get_code("233d5c80d2043015")
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 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.

import torch
from PIL import Image

torch.manual_seed(0)

# The function expects a tensor with shape that supports:
# - Addition and multiplication operations
# - .round(), .clamp(), .to(torch.uint8), .cpu() methods
# - .permute(2, 0, 3, 1) operation
# - .reshape([pred.shape[2], -1, 3]) operation
# - .numpy() method
# 
# From the permute and reshape operations:
# - Original shape: [batch, channels, height, width] or similar
# - After permute(2, 0, 3, 1): dimensions are rearranged
# - After reshape: [pred.shape[2], -1, 3] suggests final output is HxWx3
# 
# Working backwards from reshape([pred.shape[2], -1, 3]):
# - pred.shape[2] becomes the height
# - The middle dimension(s) flatten to width
# - Last dimension is 3 (RGB channels)
# 
# For permute(2, 0, 3, 1) to work on shape [B, C, H, W]:
# - dim 0 -> position of 2
# - dim 1 -> position of 0
# - dim 2 -> position of 3
# - dim 3 -> position of 1
# This gives: [H, B, W, C] after permute
# Then reshape to [H, -1, 3] means B*W must equal W (or reshape handles it)
# 
# Let's create a valid tensor: [batch=2, channels=3, height=4, width=5]
pred = torch.randn(2, 3, 4, 5)

ARGS = {
    "pred": pred
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, torch — 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
random_resized_crop Ran
ran on a synthesized input
yuweiyin/ttida/glide_finetune/loader.py
code served (permissive licence) · get_code("e9fdb363312ea83e")
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 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.

import torch
from PIL import Image
import numpy as np

# Create a small PIL Image for testing
# Create a numpy array and convert to PIL Image
image_array = np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8)
image = Image.fromarray(image_array, mode='RGB')

# Define shape as a tuple (height, width)
shape = (32, 32)

# Define resize_ratio as a float
resize_ratio = 0.8

ARGS = {
    "image": image,
    "shape": shape,
    "resize_ratio": resize_ratio
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — 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
resize_for_upsample Ran
ran on a synthesized input
yuweiyin/ttida/glide_finetune/train_util.py
code served (permissive licence) · get_code("e8e4d867d3febb69")
How it ran

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

import torch
import numpy as np
from PIL import Image

torch.manual_seed(0)

# Create a small test image (RGB)
# PIL Image with shape (H, W, C) = (12, 16, 3)
img_array = np.random.randint(0, 256, (12, 16, 3), dtype=np.uint8)
pil_img = Image.fromarray(img_array, mode='RGB')

ARGS = {
    'original': pil_img,
    'low_res_x': 4,
    'low_res_y': 3,
    'upscale_factor': 4,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
unflatten_master_params Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
yuweiyin/ttida/glide_finetune/fp16_util.py
pointer only (licence: MIT); the stored copy get_code serves, from ZhendongWang6/DIRE, is pointer only (licence: NONE) · get_code("64fff1e30802b815")
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 ZhendongWang6/DIRE, 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.

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, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 2 the same month, 2 later) and 7 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
unflatten_master_params 72 other papers
20 dated earlier, 1 the same month, 50 later, 1 same year, order not determinable
2111.11672 (2021-11)
Few-shot Image Generation with Mixup-based Distance Learning
2111.14818 (2021-11)
Blended Diffusion for Text-driven Editing of Natural Images
2112.03145 (2021-12)
Diffusion Models for Implicit Image Segmentation Ensembles
and 69 more not named here
make_master_params 70 other papers
19 dated earlier, 1 the same month, 49 later, 1 same year, order not determinable
2111.11672 (2021-11)
Few-shot Image Generation with Mixup-based Distance Learning
2111.14818 (2021-11)
Blended Diffusion for Text-driven Editing of Natural Images
2112.03145 (2021-12)
Diffusion Models for Implicit Image Segmentation Ensembles
and 67 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-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

Data augmentation has been established as an efficacious approach to supplement useful information for low-resource datasets. Traditional augmentation techniques such as noise injection and image transformations have been widely used. In addition, generative data augmentation (GDA) has been shown to produce more diverse and flexible data. While generative adversarial networks (GANs) have been frequently used for GDA, they lack diversity and controllability compared to text-to-image diffusion models. In this paper, we propose TTIDA (Text-to-Text-to-Image Data Augmentation) to leverage the capabilities of large-scale pre-trained Text-to-Text (T2T) and Text-to-Image (T2I) generative models for data augmentation. By conditioning the T2I model on detailed descriptions produced by T2T models, we are able to generate photo-realistic labeled images in a flexible and controllable manner. Experiments on in-domain classification, cross-domain classification, and image captioning tasks show consistent improvements over other data augmentation baselines. Analytical studies in varied settings, including few-shot, long-tail, and adversarial, further reinforce the effectiveness of TTIDA in enhancing performance and increasing robustness.

For agents

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

get_harvested_code_for_paper("2304.08821")
get_code_for_paper("2304.08821")
have("2304.08821")

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

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

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

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

Connect an agent — have() is free.