SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.13382 · 2024

VTG-LLM: Integrating Timestamp Knowledge into Video LLMs for Enhanced Video Temporal Grounding

arXiv · PDF · Open in the Atlas

Code that ran

15 of 17 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 13 failures of our instrument; 2 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/2405.13382.json · badge: /api/ran/2405.13382.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
gyxxyg/vtg-llm canonical (classifier label)
classifier basis: census
15 ran · 2 no recorded run
FunctionStatusWhere it lives
extract_time Ran
ran, honoured the contract we drafted
gyxxyg/vtg-llm/utils/format_tvg.py
code served (permissive licence) · get_code("c033cc58db86cb93")
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 2, 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 re

def extract_time(paragraph):
    prompt = 'A specific example is : 20.8 - 30.0 seconds'.lower()
    paragraph = paragraph.lower()
    paragraph.replace(prompt, '')
    sentences = re.split('[!?\\n]', paragraph)
    keywords = ['starts', 'ends', 'happens in', 'start time', 'end time', 'start', 'end', 'happen']
    candidates = []
    for sentence in sentences:
        if any((keyword in sentence for keyword in keywords)):
            candidates.append(sentence)
    timestamps = []
    patterns = ['(\\d+\\.*\\d*)\\s*-\\s*(\\d+\\.*\\d*)']
    for time_pattern in patterns:
        time_matches = re.findall(time_pattern, paragraph)
        if time_matches:
            timestamps = [[float(start), float(end)] for start, end in time_matches]
    if len(sentences) == 0:
        return []
    if len(timestamps) == 0:
        times = []
        time_regex = re.compile('\\b(\\d+\\.\\d+\\b|\\b\\d+)\\b')
        for sentence in candidates:
            time = re.findall(time_regex, sentence)
            if time:
                time_in_sec = float(time[0])
                times.append(time_in_sec)
        times = times[:len(times) // 2 * 2]
        timestamps = [(times[i], times[i + 1]) for i in range(0, len(times), 2)]
    if len(timestamps) == 0:
        times = []
        time_regex = re.compile('\\b((\\d{1,2}:\\d{2}:\\d{2}))\\b')
        for sentence in candidates:
            time = re.findall(time_regex, sentence)
            if time:
                t = time[0]
            else:
                continue
            if t.count(':') == 2:
                h, m, s = map(int, t.split(':'))
                time_in_sec = h * 3600 + m * 60 + s
            elif t.count(':') == 1:
                m, s = map(int, t.split(':'))
                time_in_sec = m * 60 + s
            times.append(time_in_sec)
        times = times[:len(times) // 2 * 2]
        timestamps = [(times[i], times[i + 1]) for i in range(0, len(times), 2)]
    results = []
    for start, end in timestamps:
        if end > start:
            results.append([start, end])
        else:
            results.append([end, start])
    if len(results) > 1:
        results = results[:1]
    return results


# Setup code to construct valid arguments
paragraph_with_range = "The action starts at 20.8 - 30.0 seconds during the sequence."

paragraph_with_keywords = "The event starts at 5 and ends at 10 seconds in the video."

paragraph_with_time_format = "The scene happens in 00:01:30 to 00:02:45 format."

paragraph_simple = "Something happens."

# ARGS dict mapping every parameter of extract_time to a value
ARGS = {
    "paragraph": paragraph_with_range
}
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 2, 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
extract_time_from_para Ran
ran; our contract draft was wrong, not the code
gyxxyg/vtg-llm/utils/format_dvc.py
code served (permissive licence) · get_code("856796b6222350db")
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 re
import pdb

def extract_time_from_para(paragraph):
    paragraph = paragraph.lower()
    patterns = [('(\\d+\\.*\\d*)\\s*-\\s*(\\d+\\.*\\d*)', '(\\d+\\.*\\d*\\s*-\\s*\\d+\\.*\\d*)')]
    timestamps = []
    captions = []
    for time_pattern, string_pattern in patterns:
        time_matches = re.findall(time_pattern, paragraph)
        string_matches = re.findall(string_pattern, paragraph)
        if time_matches:
            timestamps = [[float(start), float(end)] for start, end in time_matches]
            rest_para = paragraph
            for time_string in string_matches:
                rest_para = rest_para.replace(time_string, '\n')
            captions = rest_para.replace('seconds', '').split('\n')
        if len(timestamps) > 0:
            break
    if len(timestamps) == 0:
        start_time_pattern = '(?:start(?:ing)? time: (\\d+\\.*\\d*)(?:s| seconds)?)'
        end_time_pattern = '(?:end(?:ing)? time: (\\d+\\.*\\d*)(?:s| seconds)?)'
        end_matches = re.findall(end_time_pattern, paragraph, re.DOTALL | re.IGNORECASE)
        start_matches = re.findall(start_time_pattern, paragraph, re.DOTALL | re.IGNORECASE)
        if start_matches and end_matches:
            timestamps = [[float(start), float(end)] for start, end in zip(start_matches, end_matches)]
            captions = re.findall('description: (.*)', paragraph)
            if len(captions) == 0:
                captions = re.findall('\\*\\s*(.*)', paragraph)
    if len(timestamps) == 0:
        start_end_matches = re.findall('start time (\\d+\\.*\\d*), end time (\\d+\\.*\\d*)', paragraph)
        if start_end_matches:
            timestamps = list(start_end_matches)
            for start, end in start_end_matches:
                paragraph = paragraph.replace(f'start time {start}, end time {end}', '\n')
                captions = paragraph.split('\n')
            if len(timestamps) > 0:
                pass
    captions = [c.strip().strip(', ').rstrip() for c in captions if len(c) > 5]
    min_len = min(len(timestamps), len(captions))
    timestamps = timestamps[:min_len]
    captions = captions[:min_len]
    assert len(timestamps) == len(captions), f'# timestamps {len(timestamps)}, # captions {len(captions)}, para {paragraph}.'
    return (timestamps, captions)


paragraph_1 = "0.5 - 2.3 This is a caption about something happening. 3.0 - 5.5 Another event description here. seconds"

ARGS = {
    "paragraph": paragraph_1
}
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
extract_time_part Ran
ran; our contract draft was wrong, not the code
gyxxyg/vtg-llm/utils/format_dvc.py
code served (permissive licence) · get_code("adfc3585c242cfb2")
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 re

def extract_time_part(time_part):
    radius = 20
    extracted_time_part = re.compile('\\d+\\.*\\d*\\s*-\\s*\\d+\\.*\\d*').findall(time_part)
    if len(extracted_time_part) == 0:
        if time_part.count(':') == 1:
            extracted_time = re.compile('\\d+\\.*\\d*:\\d+\\.*\\d*').findall(time_part)[0]
            extracted_time = int(extracted_time.split(':')[0]) * 60 + int(extracted_time.split(':')[1])
            if extracted_time > radius:
                extracted_time_part = [f'{extracted_time - radius} - {extracted_time + radius}']
            else:
                extracted_time_part = [f'{extracted_time} - {extracted_time + 2 * radius}']
        elif time_part.count(':') == 2:
            start, end = re.compile('\\d+\\.*\\d*:\\d+\\.*\\d*').findall(time_part)
            start_seconds = int(start.split(':')[0]) * 60 + int(start.split(':')[1])
            end_seconds = int(end.split(':')[0]) * 60 + int(end.split(':')[1])
            extracted_time_part = [f'{start_seconds} - {end_seconds}']
        else:
            pass
    if len(extracted_time_part) == 0:
        extracted_time_part = re.compile('\\d+\\.*\\d*(?!\\.)').findall(time_part)
        if len(extracted_time_part) == 1:
            extracted_time = float(extracted_time_part[0])
            if extracted_time > radius:
                extracted_time_part = [f'{extracted_time - radius} - {extracted_time + radius}']
            else:
                extracted_time_part = [f'{extracted_time} - {extracted_time + 2 * radius}']
        elif len(extracted_time_part) == 2:
            extracted_time_part = [f'{extracted_time_part[0]} - {extracted_time_part[1]}']
        else:
            pass
    return extracted_time_part


ARGS = {
    "time_part": "1:30"
}
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
extract_time_special_time_token Ran
ran, honoured the contract we drafted
gyxxyg/vtg-llm/utils/format_tvg.py
code served (permissive licence) · get_code("3223c4fbb3dd41e6")
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 2, 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 re

TIME_STR = {0: 'ZERO', 1: 'ONE', 2: 'TWO', 3: 'THREE', 4: 'FOUR', 5: 'FIVE', 6: 'SIX', 7: 'SEVEN', 8: 'EIGHT', 9: 'NINE'}

def extract_time(paragraph):
    prompt = 'A specific example is : 20.8 - 30.0 seconds'.lower()
    paragraph = paragraph.lower()
    paragraph.replace(prompt, '')
    sentences = re.split('[!?\\n]', paragraph)
    keywords = ['starts', 'ends', 'happens in', 'start time', 'end time', 'start', 'end', 'happen']
    candidates = []
    for sentence in sentences:
        if any((keyword in sentence for keyword in keywords)):
            candidates.append(sentence)
    timestamps = []
    patterns = ['(\\d+\\.*\\d*)\\s*-\\s*(\\d+\\.*\\d*)']
    for time_pattern in patterns:
        time_matches = re.findall(time_pattern, paragraph)
        if time_matches:
            timestamps = [[float(start), float(end)] for start, end in time_matches]
    if len(sentences) == 0:
        return []
    if len(timestamps) == 0:
        times = []
        time_regex = re.compile('\\b(\\d+\\.\\d+\\b|\\b\\d+)\\b')
        for sentence in candidates:
            time = re.findall(time_regex, sentence)
            if time:
                time_in_sec = float(time[0])
                times.append(time_in_sec)
        times = times[:len(times) // 2 * 2]
        timestamps = [(times[i], times[i + 1]) for i in range(0, len(times), 2)]
    if len(timestamps) == 0:
        times = []
        time_regex = re.compile('\\b((\\d{1,2}:\\d{2}:\\d{2}))\\b')
        for sentence in candidates:
            time = re.findall(time_regex, sentence)
            if time:
                t = time[0]
            else:
                continue
            if t.count(':') == 2:
                h, m, s = map(int, t.split(':'))
                time_in_sec = h * 3600 + m * 60 + s
            elif t.count(':') == 1:
                m, s = map(int, t.split(':'))
                time_in_sec = m * 60 + s
            times.append(time_in_sec)
        times = times[:len(times) // 2 * 2]
        timestamps = [(times[i], times[i + 1]) for i in range(0, len(times), 2)]
    results = []
    for start, end in timestamps:
        if end > start:
            results.append([start, end])
        else:
            results.append([end, start])
    if len(results) > 1:
        results = results[:1]
    return results

def extract_time_special_time_token(paragraph):
    for i in range(10):
        paragraph = paragraph.replace('<TIME_{}>'.format(TIME_STR[i]), str(i))
    paragraph = paragraph.replace('<TIME_DOT>', '.')
    pattern = '\\d[\\d\\s]*(\\.[\\s\\d]*\\d)*'
    paragraph = re.sub(pattern, lambda match: match.group(0).replace(' ', ''), paragraph)
    print(paragraph)
    return extract_time(paragraph)

ARGS = {
    'paragraph': 'The event <TIME_FIVE> starts at <TIME_TWO><TIME_DOT><TIME_EIGHT> - <TIME_THREE><TIME_DOT><TIME_ZERO> seconds and ends at the mark.'
}
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 2, 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
load_data Ran
ran; our contract draft was wrong, not the code
gyxxyg/vtg-llm/evaluate.py
code served (permissive licence) · get_code("741e5b0b3aa32a32")
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 os
import json
import tempfile

# Create a temporary directory and annotation file
temp_dir = tempfile.mkdtemp()

# Create a sample annotation file in COCO format
anno_data = {
    "annotations": [
        {"image_id": "xHr8X2Wpmno.mp4", "caption": "A person walking"},
        {"image_id": "anotherVideo.mp4", "caption": "A dog running"},
    ]
}

# Write the annotation file
split_name = "train"
file_path = os.path.join(temp_dir, f'{split_name}.caption_coco_format.json')
with open(file_path, 'w') as f:
    json.dump(anno_data, f)

# Create a simple args object with debug attribute
class Args:
    def __init__(self, debug=False):
        self.debug = debug

ARGS = {
    "args": Args(debug=False),
    "anno_path": temp_dir,
    "split": split_name
}
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
merge_seg_caps Ran
ran; our contract draft was wrong, not the code
gyxxyg/vtg-llm/evaluate.py
code served (permissive licence) · get_code("d650b26a59df9e29")
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
import numpy as np

def merge_seg_caps(results):
    """merge mulple generated captions from a same video into paragraph."""
    merge_results = {}
    for jterm in results:
        vname = jterm['vname']
        cap = jterm['generated_cap']
        postfix = vname.split('.mp4')[-1]
        start_time, end_time = (float(postfix.split('_')[-2]), float(postfix.split('_')[-1]))
        vid = vname.split('.mp4')[0] + '.mp4'
        if vid not in merge_results:
            merge_results[vid] = []
        merge_results[vid].append({'timestamp': [start_time, end_time], 'caption': cap})
    return merge_results

# Construct valid arguments
results = [
    {
        'vname': 'video1.mp4_0.5_1.5',
        'generated_cap': 'A person is walking in the park'
    },
    {
        'vname': 'video1.mp4_1.5_2.5',
        'generated_cap': 'The person sits down on a bench'
    },
    {
        'vname': 'video2.mp4_0.0_1.0',
        'generated_cap': 'A dog is running'
    },
    {
        'vname': 'video2.mp4_1.0_2.0',
        'generated_cap': 'The dog catches a frisbee'
    }
]

ARGS = {
    'results': results
}
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 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
parse_highlights Ran
ran; our contract draft was wrong, not the code
gyxxyg/vtg-llm/utils/format_vhd.py
code served (permissive licence) · get_code("e7f3262c5969234f")
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 2, 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 torch
import torch.nn as nn

# Analyzing the function parse_highlights:
# - It takes a single parameter: output (str)
# - The function processes a string to extract highlight moments and saliency scores
# - It expects strings with patterns like "second", "score", timestamps, and numeric values

# Create example outputs that the function can parse
# The function looks for:
# 1. "second" keyword
# 2. "score" keyword
# 3. Timestamps in format HH:MM:SS or just numbers
# 4. Numeric scores

output_1 = """
Highlight 1: at 10 seconds, score 0.8
Highlight 2: at 25 seconds, score 0.9
Highlight 3: at 45 seconds, score 0.7
"""

output_2 = "Second 10, score 0.5\nSecond 30, score 0.85"

output_3 = "00:01:15 score 0.95, 00:02:30 score 0.7"

# Test with one of the outputs
ARGS = {
    "output": output_1
}
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, ndim 2, 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
parse_highlights_special_time_token Ran
ran; our contract draft was wrong, not the code
gyxxyg/vtg-llm/utils/format_vhd.py
code served (permissive licence) · get_code("4eccf153227f2e66")
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 re

TIME_STR = {0: 'ZERO', 1: 'ONE', 2: 'TWO', 3: 'THREE', 4: 'FOUR', 5: 'FIVE', 6: 'SIX', 7: 'SEVEN', 8: 'EIGHT', 9: 'NINE'}

def parse_highlights(output):
    """
    Parses the model's output to extract highlight moments and their saliency scores.

    Parameters:
    output (str): The string output from the model.

    Returns:
    list: A list of dictionaries, each containing a timestamp and a saliency score.
    """
    output = output.lower()
    output = output.replace('th', ' ')
    highlights = []
    timestamps = []
    scores = []
    second_num = output.count('second')
    score_num = output.count('score')
    if second_num == 0 or score_num == 0:
        return (highlights, timestamps, scores)
    if second_num > 0 and score_num > 0:
        descriptions = re.split('[,\\n]+', output)
        cands = []
        for desc in descriptions:
            if 'second' not in desc and 'score' not in desc and (':' not in desc):
                continue
            else:
                cands.append(desc)
        for output in cands:
            if 'score' in output:
                saliency_score = re.findall('\\b\\d\\.?\\d?\\b', output)
                if len(saliency_score) > 0:
                    score = saliency_score[-1]
                    score = score[-1] if isinstance(score, tuple) else score
                    scores.append(float(score))
            else:
                times = re.findall('\\b((\\d{1,2}:\\d{2}:\\d{2}))\\b|\\b(\\d+\\.?\\d+?\\b|\\b\\d+)\\b', output)
                filter_time = []
                for timestamp in times:
                    if ':' in timestamp:
                        parts = list(map(int, timestamp.split(':')))
                        if len(parts) == 3:
                            seconds = parts[0] * 3600 + parts[1] * 60 + parts[2]
                        else:
                            seconds = parts[0] * 60 + parts[1]
                        filter_time.append(seconds)
                    else:
                        timestamp = timestamp[-1] if isinstance(timestamp, tuple) else timestamp
                        if timestamp != '':
                            filter_time.append(timestamp)
                if len(filter_time) > 0:
                    timestamps.append(filter_time[-1])
    timestamps = [float(t) for t in timestamps]
    scores = [float(s) for s in scores]
    time_len = len(timestamps)
    if time_len > 1:
        score_len = len(scores)
        if score_len < time_len:
            scores.extend([0.0] * (time_len - score_len))
        else:
            scores = scores[:time_len]
        highlights = [{'timestamp': ts, 'saliency_score': sc} for ts, sc in zip(timestamps, scores)]
    return (highlights, timestamps, scores)

def parse_highlights_special_time_token(paragraph):
    for i in range(10):
        paragraph = paragraph.replace('<TIME_{}>'.format(TIME_STR[i]), str(i))
    paragraph = paragraph.replace('<TIME_DOT>', '.')
    pattern = '\\d[\\d\\s]*(\\.[\\s\\d]*\\d)*'
    paragraph = re.sub(pattern, lambda match: match.group(0).replace(' ', ''), paragraph)
    return parse_highlights(paragraph)

# Create a test paragraph with time tokens
test_paragraph = "At <TIME_ZERO> seconds, highlight detected with score 0.8, and at <TIME_FIVE> seconds, another highlight with score 0<TIME_DOT>9"

ARGS = {
    'paragraph': test_paragraph
}
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
prepare_input_output_pairs Ran
ran; our contract draft was wrong, not the code
gyxxyg/vtg-llm/utils/compress_video_data.py
code served (permissive licence) · get_code("5d0935bf83ca723a")
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 2, 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 tempfile
import os

# Create temporary directories and files for testing
temp_input_dir = tempfile.mkdtemp()
temp_output_dir = tempfile.mkdtemp()

# Create a temporary input file list
input_list_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
input_list_file.write("video1.mp4\n")
input_list_file.write("video2.mp4\n")
input_list_file.write("image1.jpg\n")
input_list_file.close()

# Create a temporary exist file list (for files that already exist)
exist_list_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
exist_list_file.write("video2.mp4\n")
exist_list_file.close()

# Create some dummy output files to simulate already processed files
os.makedirs(os.path.join(temp_output_dir, "subdir"), exist_ok=True)
with open(os.path.join(temp_output_dir, "video1.mp4"), 'w') as f:
    f.write("dummy")

ARGS = {
    "input_root": temp_input_dir,
    "output_root": temp_output_dir,
    "input_file_list_path": input_list_file.name,
    "exist_file_list_path": exist_list_file.name,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, 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_string Ran
ran; our contract draft was wrong, not the code
gyxxyg/vtg-llm/metrics/dvc/eval_dvc_anet.py
code served (permissive licence) · get_code("cfb0aa2342a41918")
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 random
import string

def random_string(string_length):
    letters = string.ascii_lowercase
    return ''.join((random.choice(letters) for i in range(string_length)))

ARGS = {
    'string_length': 10
}
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
read_json Ran
ran; our contract draft was wrong, not the code
gyxxyg/vtg-llm/utils/format_dvc.py
code served (permissive licence) · get_code("7aad81b5c188085c")
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 valid data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_data.json")

# Write test data to the temporary file
test_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "object"}
}

with open(temp_file, 'w') as f:
    json.dump(test_data, f)

# Define ARGS with the path to the temporary JSON file
ARGS = {
    "path": 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
read_txt Ran
ran; our contract draft was wrong, not the code
gyxxyg/vtg-llm/evaluate.py
code served (permissive licence) · get_code("e49f0cf401af904b")
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 tempfile
import os

# Create a temporary text file with some content
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.txt")

with open(temp_file, 'w') as f:
    f.write("Hello, World!\n")
    f.write("This is a second line\n")

# Define arguments for read_txt function
ARGS = {
    "path": 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 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
remove_nonascii Ran
ran; our contract draft was wrong, not the code
gyxxyg/vtg-llm/metrics/dvc/eval_dvc_anet.py
code served (permissive licence) · get_code("a45f62024eb3d2c5")
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

torch.manual_seed(0)

# The function remove_nonascii takes a text parameter (string)
# and filters out non-ASCII characters, replacing them with spaces
# It iterates through each character and checks if ord(i) < 128

ARGS = {
    "text": "Hello World! Café naïve 你好 Москва"
}
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 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
time_to_seconds Ran
ran; our contract draft was wrong, not the code
gyxxyg/vtg-llm/utils/parse_annotation_dvc.py
code served (permissive licence) · get_code("8c2ceabd4b50b073")
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

# Construct valid arguments for time_to_seconds
# The function takes a time_str parameter which should be a string in format:
# "h:m:s" (3 parts), "m:s" (2 parts), or "s" (1 part)

ARGS = {
    "time_str": "1:30:45"
}
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 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
time_to_seconds_B Ran
ran; our contract draft was wrong, not the code
gyxxyg/vtg-llm/utils/parse_annotation_dvc.py
code served (permissive licence) · get_code("29c4fd20bc454255")
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 re

def time_to_seconds_B(time_str, event_data=None):
    pattern = re.compile('(\\d+)\\s*(minute|second)s?')
    matches = pattern.findall(time_str)
    seconds = 0
    for value, unit in matches:
        value = int(value)
        if unit == 'minute':
            seconds += value * 60
        elif unit == 'second':
            seconds += value
    return str(seconds)

# Setup valid arguments for time_to_seconds_B
time_str_examples = [
    "5 minutes",
    "30 seconds",
    "2 minutes 15 seconds",
    "1 minute 45 seconds",
    "10 minutes 5 second",
]

ARGS = {
    "time_str": "2 minutes 30 seconds",
    "event_data": None,
}
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
read_jsonl Not yet run
unverified (harvested, no recorded run)
gyxxyg/vtg-llm/utils/get_coco_format.py
code served (permissive licence) · get_code("8871a34f67963cf7")
How it ran

no invocation recorded.

time_to_seconds_B Not yet run
unverified (harvested, no recorded run)
gyxxyg/vtg-llm/utils/parse_annotation_vhd.py
code served (permissive licence) · get_code("f6211c4b35fc395b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 17 samples lifted from this paper's linked repositories, 17 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 5 later) and 11 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
remove_nonascii 4 other papers
3 dated earlier, 1 later
2001.09099 (2020-01)
TVR: A Large-Scale Dataset for Video-Subtitle Moment Retrieval
2303.06378 (2023-03)
Learning Grounded Vision-Language Representation for Versatile Understanding in Untrimmed Videos
2403.17935 (2024-03)
OmniViD: A Generative Framework for Universal Video Understanding
and 1 more not named here
load_data 2 other papers
1 dated earlier, 1 later
2312.02051 (2023-12)
TimeChat: A Time-sensitive Multimodal Large Language Model for Long Video Understanding
2410.05643 (2024-10)
TRACE: Temporal Grounding Video LLM via Causal Event Modeling
merge_seg_caps 2 other papers
1 dated earlier, 1 later
2312.02051 (2023-12)
TimeChat: A Time-sensitive Multimodal Large Language Model for Long Video Understanding
2410.05643 (2024-10)
TRACE: Temporal Grounding Video LLM via Causal Event Modeling
random_string 2 other papers
1 dated earlier, 1 later
2403.17935 (2024-03)
OmniViD: A Generative Framework for Universal Video Understanding
2412.12791 (2024-12)
Implicit Location-Caption Alignment via Complementary Masking for Weakly-Supervised Dense Video Captioning
read_txt 2 other papers
1 dated earlier, 1 later
2312.02051 (2023-12)
TimeChat: A Time-sensitive Multimodal Large Language Model for Long Video Understanding
2410.05643 (2024-10)
TRACE: Temporal Grounding Video LLM via Causal Event Modeling

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

Video Temporal Grounding (VTG) strives to accurately pinpoint event timestamps in a specific video using linguistic queries, significantly impacting downstream tasks like video browsing and editing. Unlike traditional task-specific models, Video Large Language Models (video LLMs) can handle multiple tasks concurrently in a zero-shot manner. Consequently, exploring the application of video LLMs for VTG tasks has become a burgeoning research area. However, despite considerable advancements in video content understanding, video LLMs often struggle to accurately pinpoint timestamps within videos, limiting their effectiveness in VTG tasks. To address this, we introduce VTG-LLM, a model designed to enhance video LLMs' timestamp localization abilities. Our approach includes: (1) effectively integrating timestamp knowledge into visual tokens; (2) incorporating absolute-time tokens to manage timestamp knowledge without concept shifts; and (3) introducing a lightweight, high-performance, slot-based token compression technique designed to accommodate the demands of a large number of frames to be sampled for VTG tasks. Additionally, we present VTG-IT-120K, a collection of publicly available VTG datasets that we have re-annotated to improve upon low-quality annotations. Our comprehensive experiments demonstrate the superior performance of VTG-LLM in comparison to other video LLM methods across a variety of VTG tasks.

For agents

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

get_harvested_code_for_paper("2405.13382")
get_code_for_paper("2405.13382")
have("2405.13382")

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

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

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

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

Connect an agent — have() is free.