SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2304.08490 · CVPR · 2023

Conditional Generation of Audio from Video via Foley Analogies

Andrew Owens, Bryan Russell, Justin Salamon, Ziyang Chen, Yuexi Du

arXiv · PDF · Open in the Atlas

Code that ran

7 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 6 have no contract verdict; 1 failure of our instrument; 6 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/2304.08490.json · badge: /api/ran/2304.08490.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
XYPB/CondFoleyGen canonical (classifier label)
classifier basis: census
7 ran · 6 no recorded run
FunctionStatusWhere it lives
check_match Ran
ran on a synthesized input
XYPB/CondFoleyGen/audio_type_analysis.py
code served (permissive licence) · get_code("e2037f0f6ae0a1bc")
How it ran

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

import torch

torch.manual_seed(0)

# The function check_match takes two dictionaries (cnt1 and cnt2)
# and checks if they have the same keys (ignoring 'None' if present)
# It returns True if the non-'None' keys match, False otherwise

# Create two dictionaries with matching keys (excluding 'None')
cnt1 = {
    'type_a': 5,
    'type_b': 10,
    'type_c': 3,
    'None': 0
}

cnt2 = {
    'type_a': 7,
    'type_b': 2,
    'type_c': 8
}

ARGS = {
    'cnt1': cnt1,
    'cnt2': cnt2
}
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 bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_gen_key2orig_key Ran
ran on a synthesized input
XYPB/CondFoleyGen/create_test_folder.py
code served (permissive licence) · get_code("707cb66d1f960dda")
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

# The function expects two parameters: sorted_videos and sorted_orig
# These should be lists of video name strings that follow a specific naming pattern
# The pattern appears to be: path/prefix_..._..._..._..._..._..._suffix
# where index [0] is the prefix and index [6] is the suffix

# Creating mock video names that follow the expected pattern
# Format: "path/ID_x_x_x_x_x_x_SUFFIX"
sorted_videos = [
    "videos/video_a_1_2_3_4_5_6_001",
    "videos/video_b_1_2_3_4_5_6_002",
]

sorted_orig = [
    "originals/video_a_1_2_3_4_5_6_001_extra_data",
    "originals/video_b_1_2_3_4_5_6_002_extra_data",
]

ARGS = {
    "sorted_videos": sorted_videos,
    "sorted_orig": sorted_orig,
}
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
get_style_model_and_losses Ran
ran on a synthesized input
XYPB/CondFoleyGen/audio_generation.py
code served (permissive licence) · get_code("8c86f518bf3ee01a")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 CNN with Conv2d, ReLU, MaxPool2d, BatchNorm2d layers
cnn = nn.Sequential(
    nn.Conv2d(3, 8, kernel_size=3, padding=1),
    nn.ReLU(inplace=True),
    nn.MaxPool2d(kernel_size=2, stride=2),
    nn.Conv2d(8, 16, kernel_size=3, padding=1),
    nn.ReLU(inplace=True),
    nn.MaxPool2d(kernel_size=2, stride=2),
    nn.Conv2d(16, 32, kernel_size=3, padding=1),
    nn.ReLU(inplace=True),
    nn.MaxPool2d(kernel_size=2, stride=2),
    nn.Conv2d(32, 32, kernel_size=3, padding=1),
    nn.ReLU(inplace=True),
    nn.MaxPool2d(kernel_size=2, stride=2),
    nn.Conv2d(32, 64, kernel_size=3, padding=1),
    nn.ReLU(inplace=True),
)

# Create small image tensors (batch_size=2, channels=3, height=16, width=16)
style_img = torch.randn(2, 3, 16, 16)
content_img = torch.randn(2, 3, 16, 16)

# Normalization parameters (ImageNet-like)
normalization_mean = [0.485, 0.456, 0.406]
normalization_std = [0.229, 0.224, 0.225]

# Layer specifications
content_layers = ['conv_4']
style_layers = ['conv_1', 'conv_2', 'conv_3', 'conv_4', 'conv_5']

ARGS = {
    'cnn': cnn,
    'normalization_mean': normalization_mean,
    'normalization_std': normalization_std,
    'style_img': style_img,
    'content_img': content_img,
    'content_layers': content_layers,
    'style_layers': style_layers,
}
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 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
gram_matrix Ran
ran; our contract draft was wrong, not the code
XYPB/CondFoleyGen/audio_generation.py
pointer only (licence: MIT); the stored copy get_code serves, from Oldpan/Deep-Painterly-Harmonization-Pytorch, is pointer only (licence: NONE) · get_code("1090950b58e9358b")
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 Oldpan/Deep-Painterly-Harmonization-Pytorch, 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.

load_specs_as_img Ran
ran on a synthesized input
XYPB/CondFoleyGen/audio_generation.py
code served (permissive licence) · get_code("295b08649ff00eba")
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 4, dtype family float, shape (1, 3, 80, 192) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create a small spectrogram array
# spec should be a 2D numpy array that can be sliced and converted to image
spec = np.random.rand(80, 256).astype(np.float32)

ARGS = {
    'spec': spec,
    'spec_take_first': 192
}
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 Tensor, ndim 4, dtype family float, shape (1, 3, 80, 192) — shape (1, 3, 80, 192) 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
make_folder_for_samples Ran
ran on a synthesized input
XYPB/CondFoleyGen/evaluation/generate_samples.py
code served (permissive licence) · get_code("3f45383acb251f26")
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
from pathlib import Path
import tempfile

# Create a temporary directory for the model_logdir
temp_dir = tempfile.mkdtemp()
model_logdir = Path(temp_dir) / "model_logs"
model_logdir.mkdir(parents=True, exist_ok=True)

# Create a stand-in config object with all required attributes
class StandInConfig:
    def __init__(self):
        self.sampler = SamplerConfig()
        self.data = DataConfig()

class SamplerConfig:
    def __init__(self):
        self.model_logdir = str(model_logdir)
        self.splits = ['train', 'val', 'test']
        self.now = 'run_001'

class DataConfig:
    def __init__(self):
        self.params = ParamsConfig()

class ParamsConfig:
    def __init__(self):
        self.train = TrainConfig()

class TrainConfig:
    def __init__(self):
        self.target = 'some.module.VGGSound'

cfg = StandInConfig()

ARGS = {
    'cfg': cfg
}
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
onset_nms Ran
ran on a synthesized input
XYPB/CondFoleyGen/predict_onset.py
code served (permissive licence) · get_code("6609e7e473de823b")
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

# Construct valid arguments for onset_nms
onset = np.array([0.1, 0.3, 0.5, 0.7, 0.9])
confidence = np.array([0.95, 0.80, 0.75, 0.85, 0.70])
window = 0.05

ARGS = {
    "onset": onset,
    "confidence": confidence,
    "window": window
}
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
pipeline_extract_audio Not yet run
unverified (harvested, no recorded run)
XYPB/CondFoleyGen/video_preprocess.py
code served (permissive licence) · get_code("14890f5890893ac8")
How it ran

no invocation recorded.

pipeline_reencode_mov Not yet run
unverified (harvested, no recorded run)
XYPB/CondFoleyGen/video_preprocess.py
code served (permissive licence) · get_code("4473929782c8d1c1")
How it ran

no invocation recorded.

pipeline_resize Not yet run
unverified (harvested, no recorded run)
XYPB/CondFoleyGen/video_preprocess.py
code served (permissive licence) · get_code("ca2c953686f5cb93")
How it ran

no invocation recorded.

process_action Not yet run
unverified (harvested, no recorded run)
XYPB/CondFoleyGen/audio_type_analysis.py
code served (permissive licence) · get_code("3f48d259e25d02bc")
How it ran

no invocation recorded.

process_type Not yet run
unverified (harvested, no recorded run)
XYPB/CondFoleyGen/audio_type_analysis.py
code served (permissive licence) · get_code("cb8eaae03e9b85ac")
How it ran

no invocation recorded.

sample_spectrogram Not yet run
unverified (harvested, no recorded run)
XYPB/CondFoleyGen/evaluation/generate_samples.py
code served (permissive licence) · get_code("48ef389d993cb3c8")
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, 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 12 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
gram_matrix 12 other papers
6 dated earlier, 6 later
1508.06576 (2015-08)
A Neural Algorithm of Artistic Style
1703.07511 (2017-03)
Deep Photo Style Transfer
1804.03189 (2018-04)
Deep Painterly Harmonization
and 9 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

Generated audio Input example's audio Input silent video Conditional video Figure 1. Conditional Foley generation via analogy. We generate a soundtrack for a silent input video, given a user-provided conditional example specifying what its audio should "sound like." In the first example, we make the xylophone strikes sound like the clicks of a mechanical keyboard. In the second, we generate a soundtrack for a video in which the drumstick striking a wooden door sounds as though it were made of metal. Notice that the shape of the sound events in the generated audio (e.g., thin stripes in the top example) matches the conditional audio and the onsets match the input example's audio. For reference, we provide the input video's (held out) sound on the right. We encourage the reader to watch and listen to the results on our project webpage.

For agents

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

get_harvested_code_for_paper("2304.08490")
get_code_for_paper("2304.08490")
have("2304.08490")

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

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

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

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

Connect an agent — have() is free.