SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.02677 · 2023

Caption Anything: Interactive Image Description with Diverse Multimodal Controls

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 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 5 have no contract verdict; 3 failures of our instrument; 2 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/2305.02677.json · badge: /api/ran/2305.02677.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
ttengwang/caption-anything canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
blip_loss Ran
ran on a synthesized input
ttengwang/caption-anything/caption_anything/captioner/modeling_blip.py
code served (permissive licence) · get_code("a5e8522096c36f22")
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 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
import torch.nn as nn

torch.manual_seed(0)

# Create a similarity matrix: shape (batch_size, batch_size)
# This represents similarity scores between captions and images
# For contrastive_loss to work, we need len(logits) to be the batch size
# The function uses torch.arange(len(logits)) as targets
batch_size = 2
similarity = torch.randn(batch_size, batch_size, dtype=torch.float32)

ARGS = {
    "similarity": similarity
}
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 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
boundary Ran
ran on a synthesized input
ttengwang/caption-anything/caption_anything/captioner/base_captioner.py
code served (permissive licence) · get_code("ce21ed86e2cfbd5d")
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 numpy as np

# Create a simple 2D numpy array for testing the boundary function
# The function expects inputs to have a shape with 2 dimensions (inputs.shape[1])
# It will reshape to 1D and find the argmax at the start and end
# Let's create a small 3x4 array (3 rows, 4 columns)
inputs = np.array([
    [0.1, 0.2, 0.3, 0.4],
    [0.5, 0.9, 0.2, 0.1],  # max value 0.9 at position 5 (row 1, col 1)
    [0.2, 0.3, 0.1, 0.8]   # second max 0.8 at position 11 (row 2, col 3)
], dtype=np.float32)

ARGS = {
    "inputs": inputs
}
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 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
contrastive_loss Ran
ran; our contract draft was wrong, not the code
ttengwang/caption-anything/caption_anything/captioner/modeling_blip.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from microsoft/xpretrain, is pointer only (licence: NOASSERTION) · get_code("4675779aec92d6c0")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-3-Clause), but get_code serves the stored copy, first harvested from microsoft/xpretrain, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

cut_dialogue_history Ran
ran; our contract draft was wrong, not the code
ttengwang/caption-anything/caption_anything/utils/chatbot.py
code served (permissive licence) · get_code("0f0179451c7c8909")
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 str. 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

# The function uses:
# - history_memory: a string (or None)
# - keep_last_n_words: an integer (default 500)
#
# The function:
# - Checks if history_memory is None or empty
# - Splits by whitespace to count tokens
# - Splits by newlines to get paragraphs
# - Returns a string
#
# We need to construct test cases for the parameters

# Test case 1: A non-trivial dialogue history with multiple paragraphs
history_memory = """Hello, how are you today?
I am doing well, thank you for asking.
The weather is nice outside.
Let's go for a walk in the park.
We can see the trees and flowers.
The birds are singing beautifully.
It's a perfect day for outdoor activities.
We should bring some snacks and water.
The trail near the park is very scenic.
I love spending time in nature with friends."""

keep_last_n_words = 500

ARGS = {
    "history_memory": history_memory,
    "keep_last_n_words": keep_last_n_words,
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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_new_image_name Ran
ran on a synthesized input
ttengwang/caption-anything/caption_anything/utils/chatbot.py
code served (permissive licence) · get_code("5ae4d76bf88ad349")
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 str. 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 uuid

# The function get_new_image_name takes two parameters:
# - folder: a string representing the folder path (default 'chat_image')
# - func_name: a string representing the function name (default 'update')
# 
# The function uses:
# - uuid.uuid4() to generate a UUID and take first 8 chars
# - f-string formatting with func_name and the UUID
# - os.path.join() with folder and the new filename
# 
# So we need to provide valid string arguments

ARGS = {
    'folder': 'chat_image',
    'func_name': 'update'
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
gt_bbox Ran
ran on a synthesized input
ttengwang/caption-anything/caption_anything/utils/densecap_painter.py
code served (permissive licence) · get_code("91c053efaa6c0477")
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 json
import tempfile
import os

# Create a temporary JSON file with mock annotations
temp_dir = tempfile.mkdtemp()
anno_file = os.path.join(temp_dir, "annotations.json")

annotations_data = {
    "annotations": [
        {
            "image_id": 63,
            "bbox": [10, 20, 30, 40],
            "caption": "A cat on a mat"
        },
        {
            "image_id": 63,
            "bbox": [50, 60, 70, 80],
            "caption": "A dog running"
        },
        {
            "image_id": 64,
            "bbox": [100, 100, 50, 50],
            "caption": "A bird flying"
        }
    ]
}

with open(anno_file, 'w') as f:
    json.dump(annotations_data, f)

ARGS = {
    "anno": anno_file,
    "img_name": "63.jpg"
}
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 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
new_seg_to_box Ran
ran on a synthesized input
ttengwang/caption-anything/caption_anything/captioner/base_captioner.py
code served (permissive licence) · get_code("46167d2d7c39ffb7")
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
from PIL import Image

# Create a small segmentation mask as a numpy array
# The function expects a 2D array where values > 0 indicate the object
seg_mask_array = np.zeros((10, 8), dtype=np.uint8)
# Add some non-zero values to create a boundary
seg_mask_array[2:5, 2:6] = 255

ARGS = {
    "seg_mask": seg_mask_array
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, 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
prompts Ran
ran; our contract draft was wrong, not the code
ttengwang/caption-anything/caption_anything/utils/chatbot.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from zhongyy/viotgpt, is pointer only (licence: NONE) · get_code("e8bafcb096991087")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-3-Clause), but get_code serves the stored copy, first harvested from zhongyy/viotgpt, 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.

parse_bbox Not yet run
unverified (harvested, no recorded run)
ttengwang/caption-anything/caption_anything/utils/densecap_painter.py
code served (permissive licence) · get_code("68ef60bd886a1090")
How it ran

no invocation recorded.

seg_to_box Not yet run
unverified (harvested, no recorded run)
ttengwang/caption-anything/caption_anything/captioner/base_captioner.py
code served (permissive licence) · get_code("ce858c1a6ea89f7c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 3 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 2 the same month, 3 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
contrastive_loss 27 other papers
4 dated earlier, 1 the same month, 22 later · 3 only as an assembly brick
2206.00621 (2022-06)
Cross-View Language Modeling: Towards Unified Cross-Lingual Cross-Modal Pre-training
2209.06430 (2022-09)
CLIP-ViP: Adapting Pre-trained Image-Text Model to Video-Language Alignment
2210.00312 (2022-10)
Multimodal Analogical Reasoning over Knowledge Graphs
and 24 more not named here
prompts 4 other papers
4 later
2309.06719 (2023-09)
TrafficGPT: Viewing, Processing and Interacting with Traffic Foundation Models
2309.16292 (2023-09)
DiLu: A Knowledge-Driven Approach to Autonomous Driving with Large Language Models
2310.12404 (2023-10)
Loop Copilot: Conducting AI Ensembles for Music Generation and Iterative Editing
and 1 more not named here
cut_dialogue_history 2 other papers
1 the same month, 1 later
2305.05662 (2023-05)
InternGPT: Solving Vision-Centric Tasks by Interacting with ChatGPT Beyond Language
2310.12404 (2023-10)
Loop Copilot: Conducting AI Ensembles for Music Generation and Iterative Editing

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

Controllable image captioning is an emerging multimodal topic that aims to describe the image with natural language following human purpose, $\textit{e.g.}$, looking at the specified regions or telling in a particular text style. State-of-the-art methods are trained on annotated pairs of input controls and output captions. However, the scarcity of such well-annotated multimodal data largely limits their usability and scalability for interactive AI systems. Leveraging unimodal instruction-following foundation models is a promising alternative that benefits from broader sources of data. In this paper, we present Caption AnyThing (CAT), a foundation model augmented image captioning framework supporting a wide range of multimodel controls: 1) visual controls, including points, boxes, and trajectories; 2) language controls, such as sentiment, length, language, and factuality. Powered by Segment Anything Model (SAM) and ChatGPT, we unify the visual and language prompts into a modularized framework, enabling the flexible combination between different controls. Extensive case studies demonstrate the user intention alignment capabilities of our framework, shedding light on effective user interaction modeling in vision-language applications. Our code is publicly available at https://github.com/ttengwang/Caption-Anything.

For agents

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

get_harvested_code_for_paper("2305.02677")
get_code_for_paper("2305.02677")
have("2305.02677")

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

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

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

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

Connect an agent — have() is free.