Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

StreamDuet (misaligned-slt)

This repository trains and evaluates StreamDuet, a three-stage framework for streaming sign language translation. StreamDuet reads the body poses of a sign language video and writes timed English sentences while the video streams in. It uses no glosses. It learns segmentation and translation together, so that its text stays good when its sentence boundaries are wrong.

This README is the runbook of the paper experiments. It gives the commands in run order, with what each step writes and what to check. The rules behind the commands are in .claude/CLAUDE.md (a local file), in streaming_slt_prompt.md (the design spec) and in each --help text. Runs that no paper item uses are in the local guide docs/run_real_data.md, "Other runs".

Run order. Setup, Data, Stage 1a and Stage 1b (in any order), the config edit that points the configs at Uni-Sign (B2b), Stage 2, then the tables. Stage 3, the streaming inference engine, trains nothing: every --online row runs it.

Paper items

Paper item What it shows What it needs Step
Table 1 The 4 window types (Complete, Truncated, Merged, Empty), each with the share of the Moryossef cascade outputs of that type No training: 2 analyze.py commands for each of how2sign and auslan_daily Table 1
Table 2 Main results on How2Sign, Auslan-Daily and BOBSL Stage 1a, Stage 1b and Stage 2, then the rows of each corpus Tables 2 and 3
Table 3 Main results on YouTube-SL-25 ASL, Auslan and BSL The same stages, then the rows of each corpus Tables 2 and 3
Table 4 Stage 1 ablation: the train inputs of the segmenter 1 more Stage 1a run, then 2 rows for each of how2sign and auslan_daily Table 4
Table 5 Stage 2 ablation: the parts of the joint model, and 2 zero-shot rows 4 more Stage 2 runs and 5 rows for each of how2sign and auslan_daily Table 5
Table 6 Stage 3 ablation: the commit votes K No training: 3 online rows for each of how2sign and auslan_daily Table 6
Table 7 Stage 3 ablation: the display policies Nothing new: the stability files of the Table 2 rows Table 7
Figure 3 Case studies on 2 test videos Nothing new: saved outputs of the Table 2 rows Figure 3

Names

Name in the paper What it is Train command Checkpoint eval.py flags (file tokens)
Moryossef The baseline segmenter of Moryossef et al., trained again on the pool train.py --stage train-moryossef checkpoints/moryossef/multi_ase-asf-bfi-bobsl_auto/model.pt --spans moryossef (moryossef)
StreamDuet-Seg Our segmenter of Stage 1a, pretrained on the pool (S1 in the code) train.py --stage train-bio checkpoints/bio_s1/multi_ase-asf-bfi-bobsl_auto/model.pt --spans s1 (s1)
Uni-Sign The pre-trimmed translator of Stage 1b: the OpenASL release of the Uni-Sign project, fine-tuned on the gold sentences of one corpus train.py --stage train-slt --slt-config configs/baseline_train.yaml checkpoints/baseline_train_ar/<corpus>/model.pt --text pretrimmed (pretrimmed)
StreamDuet The model of Stage 2: segmenter and translator trained together (the two-stream AR arm in the code) train.py --stage train-slt --slt-config configs/ar.yaml checkpoints/ar/<corpus>/model.pt --spans ar --text ar (joint-ar, ar)
  • Cascade, Joint: the 2 pipeline labels. A Cascade row is a segmenter followed by Uni-Sign (Moryossef + Uni-Sign, StreamDuet-Seg + Uni-Sign). A Joint row is StreamDuet.
  • window-based systems: StreamSLST (mBART) and Multi-Stage. Each reads the video in fixed windows. Multi-Stage translates the spans of StreamSLST with GFSLT-VLP. Both train and run in the StreamSLST code, outside this repository. The paper lists StreamSLST (mBART) as Joint and Multi-Stage as Cascade.
  • pool: ase, asf, bfi and bobsl_auto. Each segmenter trains on it once.
  • row: one eval.py command. It writes the events file <name>.json (the timed output sentences) and the scores file <name>_scores.json. A row of a paper table reads 1 such row, or 2 where a cell shows offline / online.
  • access: --offline reads each whole video at once. --online runs the streaming engine, which decides from the past alone.
  • no-text row: a row with --text none. It gives the spans (start and end times) alone, with no translation. It is not a row of the arm ar_notext (Table 5).
  • decode: how a segmenter turns its label of each frame (its tag) into sentence spans. Every paper row uses argmax, the default: the commands carry no --decode, and the file names hold _argmax_.
  • arm: a Stage 2 model. StreamDuet is the arm of the shipped configs/ar.yaml. An arm of Table 5 is the same run with a config edit.
  • corpus keys: ase, asf and bfi are YouTube-SL-25 ASL, Auslan and BSL (SignVerse-2M poses). how2sign is How2Sign. auslan_daily is Auslan-Daily News. bobsl_auto is BOBSL under the LiTFiC protocol. It trains on the automatic alignment. Its dev and test sets are the hand-aligned Sent-Val and Sent-Test, the labels of bobsl_manual. No command names bobsl_manual, except the copy check.
  • B2a, B2b: the labels that code messages and config comments print for Stage 1b and for the config edit after it.

Setup

You need Python 3.9 to 3.13 and a CUDA GPU to train. A Mac (MPS) or a CPU machine is enough to evaluate. The code selects cuda, then mps, then cpu; --device changes this. The code does not download the 2 released files and BLEURT. The first run downloads mT5, the NLTK data and METEOR by itself.

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# The 2 released files: the OpenASL release (the pose-only translator of the Uni-Sign project), and the weights of the Moryossef segmenter.
mkdir -p checkpoints
curl -L -o checkpoints/openasl_pose_only_slt.pth \
    https://huggingface.co/ZechengLi19/Uni-Sign/resolve/eab251b7fe7e8521afc0e67be98add670ea40a0d/openasl_pose_only_slt.pth
curl -L -o checkpoints/moryossef26.safetensors \
    https://raw.githubusercontent.com/sign-language-processing/segmentation/a4596048fadf22864e2fdd6a2ef3ca1004835737/sign_language_segmentation/dist/2026/model.safetensors
# BLEURT, on every machine that evaluates. The code reads the checkpoint at /tmp/BLEURT-20.
pip install git+https://github.com/google-research/bleurt.git
curl -L -o /tmp/BLEURT-20.zip https://storage.googleapis.com/bleurt-oss-21/BLEURT-20.zip
unzip /tmp/BLEURT-20.zip -d /tmp
# On a CUDA machine only: 2 files of the CUDA compiler for BLEURT, in the version of your torch wheel (12.8 for +cu128).
python -m pip install "nvidia-cuda-nvcc-cu12==12.8.*"
# Only for a machine with no internet: run these 4 commands on a machine with internet, then copy ~/.cache/huggingface and ~/nltk_data.
python -c "import nltk; nltk.download('punkt'); nltk.download('punkt_tab')"
python -c "import evaluate; evaluate.load('meteor')"
python -c "from transformers import T5Tokenizer; T5Tokenizer.from_pretrained('google/mt5-base', legacy=False)"
python -c "from transformers import MT5ForConditionalGeneration; MT5ForConditionalGeneration.from_pretrained('google/mt5-base')"
  • Released files. The encoder of StreamDuet-Seg and Uni-Sign of every corpus start from openasl_pose_only_slt.pth, the OpenASL release (Uni-Sign). The Moryossef segmenter and most of the head of StreamDuet-Seg start from moryossef26.safetensors (segmentation).
  • BLEURT setup. Without BLEURT, the B-RT column reads 0.0 and the run prints one WARNING. Many systems clear /tmp at restart, so make sure that /tmp/BLEURT-20 is there before each evaluation.
  • BLEURT on CUDA. Without the compiler files, BLEURT stops with JIT compilation failed and libdevice not found. Install the package into the site-packages folder of TensorFlow (python -m pip show tensorflow shows it; add --user when it is in ~/.local). A machine with a full CUDA toolkit can set XLA_FLAGS=--xla_gpu_cuda_data_dir=/path/to/cuda instead.
  • Check. python -c "import metrics; print(metrics.pair_text_scores(['the cat sat on the mat'], ['the cat sat on the mat'], False, keys=('bleurt',)))" prints a score near 1.0 and no WARNING.
  • Check. python -c "import transformers; print(transformers.__version__)" prints a 4.x version. Version 5.x loads the OpenASL release wrong with no error.
  • Check. python -c "import sacrebleu, evaluate, rouge, nltk, pycocoevalcap" prints no error. A missing package stops the run (sacrebleu), changes R-L with no WARNING (rouge: the code then uses rouge_score), or gives a 0.0 column with a WARNING.

Rules for every run

Set the corpus once in each shell. Every per-corpus command reads $LANG. LANG is also the locale variable of the shell: use a shell for these runs alone, and ignore its locale warnings.

LANG=asf    # ase | asf | bfi | how2sign | auslan_daily | bobsl_auto
  • Test. Read test only after all training and all choices on dev are final. Every eval.py and analyze.py command that reads model outputs on test needs --allow-test. report.py has no such flag.
  • Resume. Every epoch writes latest.pt. To continue a stopped run, give the same command with --resume (it refuses a run whose config changed: start a new run then). Without --resume, a run refuses to start while latest.pt is in its folder. To start again, move latest.pt, model.pt and best.json out of the folder.
  • Files. A command writes over a file with the same name. Keep a copy of your result files before you run a command again.
  • Config edits. Some steps need a config edit. Only the edit of configs/data.yaml (B2b) stays: undo every other edit before the next run or row. While an edit is in place, start no other run from the same configs/ folder. Use a second copy of the repository for runs at the same time.
  • Several GPUs. For training, put torchrun --standalone --nproc-per-node=N before train.py (for example torchrun --standalone --nproc-per-node=4 train.py --stage train-slt --language "$LANG" --slt-config configs/ar.yaml). batch_size and checkpoint.dev_batch_size are global batches, so each must be at least N. An online row takes --workers N instead.
  • GPU memory. If a training run has not enough GPU memory, lower batch_size in its config and raise grad_accum_steps by the same factor. If a dev evaluation has not enough memory, lower checkpoint.dev_batch_size; no score depends on it.
  • Two machines. You can train on a CUDA machine and evaluate on another one. Use the same configs/ (with the B2b edit) and the same prepared data on both. After a data step, copy the changed files to the other machine (usually the sidecars video_meta*.csv and the casing files case_lexicon.en_XX.json).
  • Files to copy. The repository, the 2 released files, and the model.pt of each model that a step reads (with latest.pt to continue a run). Of data/youtube-sl-25/: the split CSV, case_lexicon.en_XX.json and, in each <corpus>/ folder, poses/, subs/ and video_meta.csv (not signverse_shards/). Of each benchmark folder: poses/, subs/, the split files, video_meta*.csv and case_lexicon.en_XX.json (not persons/, not .cache/).

Data

YouTube-SL-25

This step downloads the SignVerse-2M pose shards of ase, asf and bfi, converts them to one pose file per video, and writes the captions and one sidecar video_meta.csv per corpus. Its last part, the copy check (--stage dedup), marks each train video that copies a dev or test video. It needs no GPU, but much free disk space.

mkdir -p data/youtube-sl-25
curl -L -o data/youtube-sl-25/SignVerse-2M-metadata_split.csv \
    https://huggingface.co/datasets/SignerX/SignVerse-2M/resolve/0c7e956a8471acad3a9cebaeb66bb23bf5deaafa/SignVerse-2M-metadata_split.csv
# Optional: shard and video counts, with a size estimate.
python prepare_yt25.py --stage plan --size
# All stages in order: download, convert, person-counts, subs and the copy check.
python prepare_yt25.py --stage all --languages ase asf bfi --workers 12
# The corpus audit, then the sampler check of each corpus.
python report.py data --language ase --language asf --language bfi
for L in ase asf bfi; do
    python train.py --stage smoke-data --language "$L" --split train --num-samples 64
done
  • Writes. data/youtube-sl-25/<corpus>/poses/, subs/ and video_meta.csv; the casing file data/youtube-sl-25/case_lexicon.en_XX.json; outputs/report/data/data_audit_<corpus>.md and .json. A train load builds the casing file from the train captions of all 3 corpora. Build it on a machine that holds them, then copy it to the other machines: the dev and test loaders refuse to start without it.
  • Check. Every person-counts line shows 0/N for empty_runs, handless_runs, switch_runs and default_signing_runs, and the convert | reconciliation line shows shard not downloaded 0. If not, run --stage all again (to repair with one stage alone: docs/run_real_data.md, "Other runs", "Data repair").
  • Check. Each dedup | <corpus> line gives the number of train videos that copy a dev or test video.
  • Check. smoke-data shows records and translation_targets above 0, padding_label UNK, a batch_pose_shape that ends in [69, 3], and more than one mode (window type) in modes.
  • Workers. --workers N converts N shards at the same time. Keep N below the number of CPU cores and below the free memory in GB, with about 9 GB more free for the longest videos. A stopped run loses at most the shards in progress: run the same command again without --overwrite.

The benchmarks

The poses, captions, split files and sidecars of the 3 benchmarks come ready from the extractor slp-pose, in data/how2sign, data/auslan-daily-abc and data/bobsl. This step runs only the copy check on them. Its first train load also builds the casing file of each benchmark.

python prepare_yt25.py --stage dedup --languages how2sign auslan_daily bobsl_auto bobsl_manual
python report.py data --language how2sign --language auslan_daily --language bobsl_auto
for L in how2sign auslan_daily bobsl_auto; do
    python train.py --stage smoke-data --language "$L" --split train --num-samples 64
done
  • Writes. The copy_of column of each benchmark sidecar, and case_lexicon.en_XX.json in each benchmark folder.
  • Check. Each dedup | <corpus> line shows 0 train videos that copy a dev or test video. A dev or test load of bobsl_auto prints [loader] bobsl_auto/<split>: the N records of bobsl_manual. smoke-data passes the check of YouTube-SL-25 on each key.

Stage 1: pretraining

Stage 1a: the segmenters

Train the 2 segmenters, each once, on the pool, on a CUDA GPU. The commands take no --language: a pool has no target corpus.

python train.py --stage train-moryossef
python train.py --stage train-bio
  • Writes. checkpoints/moryossef/multi_ase-asf-bfi-bobsl_auto/ and checkpoints/bio_s1/multi_ase-asf-bfi-bobsl_auto/, each with model.pt, best.json, latest.pt and history.csv.
  • Check. Each run prints its best-epoch floor (the first epoch that can become the best one). No epoch before the floor shows saved in the ckpt column.
  • Check. Train both segmenters from one code state. The meta of the 2 model.pt files then stamps monitor_decode argmax and the same language_fingerprints (the script that prints them: docs/run_real_data.md, "Other runs", "More checks").

Stage 1b: Uni-Sign of each corpus (B2a)

Fine-tune the OpenASL release on the gold sentences of one corpus, each clip cut at the true edges of its sentence. Run it on a CUDA GPU, once for each of ase, asf, bfi, how2sign, auslan_daily and bobsl_auto. configs/baseline_eval.yaml must hold decoder: ar.

python train.py --stage train-slt --language "$LANG" --slt-config configs/baseline_train.yaml
  • Writes. checkpoints/baseline_train_ar/$LANG/ (model.pt, best.json, latest.pt, history.csv).
  • Check. In best.json, value is the dev BLEU-4 of the selected epoch (monitor is val_translation_bleu4). It must be well above the dev BLEU-4 of the OpenASL release with no fine-tuning (the command that measures it: docs/run_real_data.md, "Other runs", "More checks").
  • Check. In history.csv, val_translation_len_ratio on the line of that epoch is near 1. A value far from 1 shows outputs that are too short or too long.

Point the configs at Uni-Sign (B2b)

StreamDuet and every --text pretrimmed row read Uni-Sign from the pretrained_slt entry of the corpus in configs/data.yaml. Until you edit it, the entry names the OpenASL release: a row then reads the release with no error, and its files still carry the name pretrimmed. So make this edit on every machine that trains Stage 2 or evaluates.

In configs/data.yaml, in the pretrained_slt block of each of the 6 corpora, replace the active ar line with the commented ar line of that block: ar: checkpoints/baseline_train_ar/<corpus>/model.pt. Leave the dlm lines as they are.

  • Check. This command prints 6 trained files and no OpenASL file: python -c "from utils import load_yaml; cfg = load_yaml('configs/data.yaml')['languages']; print(*[(c, cfg[c]['pretrained_slt']['ar']) for c in ('ase', 'asf', 'bfi', 'how2sign', 'auslan_daily', 'bobsl_auto')], sep='\n')"

Stage 2: StreamDuet of each corpus

Stage 2 trains segmentation and translation together. The segmenter starts from StreamDuet-Seg (Stage 1a), and the translator starts from Uni-Sign of the corpus (B2b). Run it once for each of the 6 corpora, on a CUDA GPU with much memory: watch nvidia-smi during the first steps (see "GPU memory" in Rules for every run).

python train.py --stage train-slt --language "$LANG" --slt-config configs/ar.yaml
  • Writes. checkpoints/ar/$LANG/: model.pt (the epoch with the best monitor), best.json, latest.pt and history.csv, and the study files model_seg.pt, model_text.pt and model_last.pt.
  • Check. The dev losses val_bio_loss and val_translation_loss fall over the first epochs, and text_grad_rate is above 0.
  • Check. val_offline_f1 and val_offline_bleu4 rise over the run (their product is the monitor val_offline_score). best.json gives the selected epoch.

Tables 2 and 3: main results

Do this section once for each corpus: how2sign, auslan_daily and bobsl_auto (Table 2), then ase, asf and bfi (Table 3). Both tables have the same rows. Offline: Multi-Stage, Moryossef + Uni-Sign, StreamDuet-Seg + Uni-Sign, StreamSLST (mBART), StreamDuet. Online: the 2 Cascade rows and StreamDuet. Gold: the gray row of Uni-Sign. The columns are F1, B-4, B-RT, R-L and MTR.

The 6 system rows

# Moryossef + Uni-Sign (Cascade), offline and online.
python eval.py --offline --spans moryossef --text pretrimmed --language "$LANG" --split test --allow-test
python eval.py --online --spans moryossef --text pretrimmed --stability --stability-hours 6 --count-flops --language "$LANG" --split test --allow-test
# StreamDuet-Seg + Uni-Sign (Cascade), offline and online.
python eval.py --offline --spans s1 --text pretrimmed --language "$LANG" --split test --allow-test
python eval.py --online --spans s1 --text pretrimmed --stability --stability-hours 6 --count-flops --language "$LANG" --split test --allow-test
# StreamDuet (Joint), offline and online.
python eval.py --offline --spans ar --text ar --language "$LANG" --split test --allow-test
python eval.py --online --spans ar --text ar --stability --stability-hours 6 --count-flops --language "$LANG" --split test --allow-test
  • --stability --stability-hours 6 records the provisional text on a fixed sample of the streams (at least 6 hours of pose). Table 7 and Figure 3 read it for how2sign and auslan_daily. For the other 4 corpora, the 2 flags are optional. Use one value in all rows of a corpus. If a process has not enough memory, lower --batch-size.
  • --count-flops (optional) counts the GFLOPs per second of video, for the supplementary material. The [row] compute line of the row prints them.
  • --workers N (not in the commands above) runs the streams in N processes, so the row ends sooner: use 2 on one GPU, or the number of GPUs. Give a real-time factor only from a row with --workers 1. These 3 flags change no output sentence and no score.
  • Writes. For each row, its events file and its scores file in outputs/offline/ or outputs/online/, named {access}_{spans}_argmax_{text}_{corpus}_test (see Reference). Each online row also writes outputs/stability/stability_<system>-6h_<corpus>_test.json and provisional_<system>-6h_<corpus>_test.json, where <system> is moryossef, s1 or ar.
  • Check. Each row prints a title line with its main score and one table. The F1 line no limit, column avg, is the main score: the F1 of the paper.
  • Check. The translator of each Cascade row is Uni-Sign of the corpus, not the OpenASL release: in its scores file, provenance.checkpoint (offline) or provenance.translation_checkpoint (online) is checkpoints/baseline_train_ar/<corpus>/model.pt.

The gray row: Uni-Sign on gold sentences

This row cuts each gold test sentence at its true start and end, and Uni-Sign of the corpus translates each clip. Its scorer is that of the other rows.

python eval.py --offline --spans gold --text pretrimmed --language "$LANG" --split test --allow-test
  • Writes. outputs/offline/offline_gold_none_pretrimmed_<corpus>_test.json and its scores file.
  • Read. B-4, B-RT, R-L and MTR have the keys of the table in Collect the numbers of one corpus. The gray row has no F1 cell: its spans are the gold sentences.
  • Check. In the scores file, provenance.checkpoint is checkpoints/baseline_train_ar/<corpus>/model.pt.

The window rows: StreamSLST (mBART) and Multi-Stage

These systems train and run in the StreamSLST code, outside this repository. Score their test outputs here.

  1. In the StreamSLST code, write the test outputs of each system and corpus as one events file, in the form below. Use the video ids of the split file of the corpus, and times in seconds of the source video. commit_time_s is the video time at which the system shows the sentence.
{"events": {"<video_id>": [{"start_s": 12.0, "end_s": 15.5, "text": "the output sentence", "commit_time_s": 18.0}]}}
  1. Keep these files outside outputs/, in a folder $EXT of your choice, and score each one. The command prints the main score table of the file and writes its scores file beside it. Then add each file to the report command below with one more --events, for example --events "Multi-Stage"="$EXT/multistage_${LANG}_test.json".
EXT=../streamslst_events    # a folder of your choice, outside outputs/
python eval.py --predictions "$EXT/multistage_${LANG}_test.json" --language "$LANG" --split test --allow-test
  • Check. The command prints no WARNING that video ids are absent from the split. One WARNING about UNSTAMPED annotations is expected: the file comes from outside this repository.

Collect the numbers of one corpus

report.py results scores all rows of one corpus again and writes their numbers into the CSV files of one report folder.

python report.py results --language "$LANG" --split test \
    --events "Moryossef + Uni-Sign Offline"=outputs/offline/offline_moryossef_argmax_pretrimmed_${LANG}_test.json \
    --events "Moryossef + Uni-Sign Online"=outputs/online/online_moryossef_argmax_pretrimmed_${LANG}_test.json \
    --events "StreamDuet-Seg + Uni-Sign Offline"=outputs/offline/offline_s1_argmax_pretrimmed_${LANG}_test.json \
    --events "StreamDuet-Seg + Uni-Sign Online"=outputs/online/online_s1_argmax_pretrimmed_${LANG}_test.json \
    --events "StreamDuet Offline"=outputs/offline/offline_joint-ar_argmax_ar_${LANG}_test.json \
    --events "StreamDuet Online"=outputs/online/online_joint-ar_argmax_ar_${LANG}_test.json
  • Writes. outputs/report/results_<corpus>_test/, with results.md, fig/ and tables/.
  • Read. Each cell of Tables 2 and 3 is in 2 places: the scores file of its row, and tables/edge_chunk.csv. In the CSV, read the line with system = the label, tau_s = no limit and tiou = avg. The table below gives the key and the column.
  • Check. The f1 of those CSV lines equals the main score in the title line of each row.
Paper column Key of the scores file, under main.edge_chunk.no_edge_limit.avg Column of edge_chunk.csv In the paper
F1 f1 f1 × 100
B-4 dvc.bleu4 dvc_bleu4 as it is
B-RT dvc.bleurt dvc_bleurt × 100
R-L dvc.rougeL dvc_rougeL × 100
MTR dvc.meteor dvc_meteor × 100

Table 1 and the ablations (Tables 4 to 7, Figure 3)

These items use how2sign and auslan_daily only. Do each step with LANG=how2sign, then with LANG=auslan_daily. They read the rows of Table 2, so make those first. The new training runs of Tables 4 and 5 read no test result: you can also start them with Stage 2, in a second copy of the repository.

Table 1: window types

Table 1 gives the share of the test outputs of the Moryossef cascade that match each window type, offline and online. analyze.py --stage segmenter-errors computes the shares from the events files of the 2 Moryossef + Uni-Sign rows alone. It needs values in scoring.edge_taus_s, but configs/eval.yaml holds null: give it a copy of that file with the values.

# A copy of configs/eval.yaml, outside configs/, with scoring.edge_taus_s: [0.5, 1.0, 2.0]. Do not edit configs/eval.yaml itself.
TAUS="${TMPDIR:-/tmp}/eval_taus.yaml"
sed 's/edge_taus_s: null/edge_taus_s: [0.5, 1.0, 2.0]/' configs/eval.yaml > "$TAUS"
python analyze.py --stage segmenter-errors --language "$LANG" --split test --allow-test --eval-config "$TAUS" \
    --predictions outputs/offline/offline_moryossef_argmax_pretrimmed_${LANG}_test.json
python analyze.py --stage segmenter-errors --language "$LANG" --split test --allow-test --eval-config "$TAUS" \
    --predictions outputs/online/online_moryossef_argmax_pretrimmed_${LANG}_test.json --output-dir outputs/analysis/online
  • Writes. mode_ratios_moryossef_argmax_<corpus>_test.json, with jitter_* and error_types_*, in outputs/analysis/ (offline) and in outputs/analysis/online/ (online). The file names hold no access, so the online files need their own --output-dir.
  • Read. In each mode_ratios_* file, cells holds 1 entry for each edge limit and tIoU threshold. Read an entry with tau_s 0.5 (the paper found the same shares at the 3 thresholds): mode1 is Complete, mode2 Truncated, mode3 Merged and mode4 Empty (× 100). Do not read the top key mode_ratios: it is the mean over all entries.

Table 4: Stage 1 ablation

Table 4 gives the F1 of each segmenter alone, offline and online. Only the row of StreamDuet-Seg with the train inputs chunks needs a new run:

  1. In configs/bio_pretrain.yaml, set pretrain.inputs: [chunks], checkpoint.dir: checkpoints/bio_s1_chunks/${corpus} and wandb.name: bio_s1_chunks_${corpus}. Train with python train.py --stage train-bio. Keep the edit until the run is complete, then undo it. While it is in place, every --spans s1 row and every Stage 2 run read this segmenter.
  2. Run its 2 no-text rows:
SEG=checkpoints/bio_s1_chunks/multi_ase-asf-bfi-bobsl_auto/model.pt
python eval.py --offline --spans s1 --text none --segmenter-checkpoint "$SEG" --language "$LANG" --split test --allow-test \
    --output outputs/offline/offline_s1-chunks_argmax_none_${LANG}_test.json
python eval.py --online --spans s1 --text none --segmenter-checkpoint "$SEG" --language "$LANG" --split test --allow-test \
    --output outputs/online/online_s1-chunks_argmax_none_${LANG}_test.json
  • Writes. checkpoints/bio_s1_chunks/multi_ase-asf-bfi-bobsl_auto/ (step 1), and the 2 --output files of step 2, each with its scores file.
  • Read. F1 is main.edge_chunk.no_edge_limit.avg.f1 × 100 of each scores file. The other cells are F1 cells of Table 2 (the F1 of a Cascade row is the F1 of its segmenter). Moryossef: the Moryossef + Uni-Sign rows. StreamDuet-Seg with all 3 inputs: the StreamDuet-Seg + Uni-Sign rows. After Stage 2: the StreamDuet rows. StreamSLST: its row (offline only).
  • Check. Each row of step 2 prints segmenter | s1 weights from checkpoints/bio_s1_chunks/... with train inputs ['chunks'].

Table 5: Stage 2 ablation

All rows of Table 5 are online rows. Its rows StreamDuet-Seg + Uni-Sign (cascade) and + adapter (StreamDuet) are the online rows of Table 2. Each of the 4 rows between them is an arm, a Stage 2 run with a config edit:

Paper row Keys to set in configs/ar.yaml <arm> Tokens in its file names
Shared-encoder baseline shared_pose_encoder: true, stitch.enabled: false, bio.adapter: false, membership_gate.enabled: false ar_shared_encoder -onestream-nostitch-nogate
+ separate pretrained encoders bio.adapter: false, membership_gate.enabled: false ar_no_gate -nogate-noadapter
+ membership gate Ω and span routing bio.adapter: false, membership_gate.end_refinement: false ar_notext -norefine-noadapter
+ end refinement bio.adapter: false ar_noadapter -noadapter
  1. In configs/ar.yaml, set the keys of one line, with checkpoint.dir: checkpoints/<arm>/${language} and wandb.name: <arm>_${language}. A dotted key is a nested YAML key: bio.adapter: false is adapter: false under bio:.
  2. Train with the Stage 2 command, for the 2 corpora. Keep the edit until the runs are complete (--resume refuses a changed config), then undo it. While it is in place, --spans ar with no --arm-checkpoint reads this arm, and its files take the names of StreamDuet. Do steps 1 and 2 for each line of the table.
  3. Run the online row of each arm:
for ARM in ar_shared_encoder ar_no_gate ar_notext ar_noadapter; do
    python eval.py --online --spans ar --text ar --arm-checkpoint checkpoints/${ARM}/${LANG}/model.pt --language "$LANG" --split test --allow-test
done
  • Writes. outputs/online/online_joint-ar<tokens>_argmax_ar<tokens>_<corpus>_test.json and its scores file, for example online_joint-ar-noadapter_argmax_ar-noadapter_how2sign_test.json.
  • Check. In training, the Stage 2 checks apply, with 3 differences: text_grad_rate is 0 for ar_notext; ar_shared_encoder and ar_no_gate log no text_grad_rate; ar_shared_encoder prints slt | one stream, no stitch (stitch.enabled false): ... before its first epoch.
  • Check. In the scores file of each arm row, provenance.checkpoint names checkpoints/<arm>/<corpus>/model.pt.

Transfer from YouTube-SL-25 (the 2 zero-shot rows). The rows Trained on YouTube-SL-25 ASL (on How2Sign) and Trained on YouTube-SL-25 Auslan (on Auslan-Daily) run StreamDuet of a YouTube-SL-25 corpus on the benchmark of the same sign language. They train nothing. --source-language names the corpus of the model, and --language names the corpus of the data and of the gold sentences.

python eval.py --online --spans ar --text ar --source-language ase --language how2sign --split test --allow-test
python eval.py --online --spans ar --text ar --source-language asf --language auslan_daily --split test --allow-test
  • Writes. outputs/online/online_joint-ar_argmax_ar_ase-to-how2sign_test.json and online_joint-ar_argmax_ar_asf-to-auslan_daily_test.json, each with its scores file.
  • Read. F1 and B-4 of the 4 arm rows and of the 2 zero-shot rows, as in Tables 2 and 3.
  • Check. The provenance of the 2 zero-shot rows holds "source_language": "ase" and "source_language": "asf".

Table 6: commit votes

K is the number of strides in sequence that must find the same span end before the engine commits the span. Table 6 changes K. K = 3 is the default, so its row is the online StreamDuet row of Table 2. The rows of K = 1, 2 and 4 train nothing: do not edit configs/inference.yaml for them.

for K in 1 2 4; do
    python eval.py --online --spans ar --text ar --commit-votes "$K" --language "$LANG" --split test --allow-test
done
python report.py results --language "$LANG" --split test --out outputs/report/commit_votes_${LANG}_test \
    --events "K=1"=outputs/online/online_joint-ar_argmax-k1_ar_${LANG}_test.json \
    --events "K=2"=outputs/online/online_joint-ar_argmax-k2_ar_${LANG}_test.json \
    --events "K=3"=outputs/online/online_joint-ar_argmax_ar_${LANG}_test.json \
    --events "K=4"=outputs/online/online_joint-ar_argmax-k4_ar_${LANG}_test.json
  • Writes. outputs/online/online_joint-ar_argmax-k<K>_ar_<corpus>_test.json with its scores file (its provenance holds commit_votes), and the report folder outputs/report/commit_votes_<corpus>_test/.
  • Read. F1 and B-4 as in Tables 2 and 3. In tables/held_unit_latency.csv of the report folder, Held is covered_share × 100 and Delay is median_s (seconds). The delay values in the text of the paper are the median_s of the online rows in outputs/report/results_<corpus>_test/tables/held_unit_latency.csv.
  • Check. The rows of K = 1 and K = 2 print one [online] WARNING: --commit-votes line: the head reads further ahead than these rows wait before a commit. This is expected.

Table 7: display policies

Table 7 needs no new run. It reads the files outputs/stability/stability_<system>-6h_<corpus>_test.json of the online rows of Table 2: ar (StreamDuet) with 4 policies, then moryossef (Moryossef cascade), s1 (StreamDuet-Seg cascade) and ar (StreamDuet) with the policy LA-2 + confidence.

  • Read. The policies are the top keys of a file: Commit only is commit_only, Re-translation is mask_k0, LA-2 (LocalAgreement-2) is frozen_agreement_n2, and LA-2 + confidence is agreement_n2_confidence_tau30. In that policy, 2 translations in sequence agree, and each token has a confidence of at least 0.3.
  • Read. The columns are the keys of a policy: NE is normalized_erasure, LAAL is laal_s, Shown is revealed_fraction × 100, Rew. is contradicted_track_rate × 100, and Pha. is phantom_reveal_rate × 100.

Figure 3: case studies

Figure 3 shows saved test outputs of how2sign and auslan_daily. It needs no new run, and no command of this repository draws it.

  • Read. The figure reads 4 things: (1) the events files of the 3 online rows of Table 2, (2) outputs/stability/provisional_ar-6h_<corpus>_test.json (the provisional text and the commits of StreamDuet), (3) the gold test sentences, (4) the StreamSLST outputs. The comment above the figure in docs/cvpr2027/sec/5_experiments.tex names the 2 videos, their time ranges and each file.

After a change: what to run again

Find your change in the left column, and run again everything in the right column, in the order of this README. "Every training stage" is Stage 1a, Stage 1b and Stage 2. Before a new training run, move its latest.pt. docs/run_real_data.md holds the guards and warnings (§8) and every case in full ("Other runs", "After a change: all cases").

Change Run again
A caption file, a split file, the annotation rules or subtitles.dedup in configs/data.yaml, or new data in a benchmark folder python prepare_yt25.py --stage dedup for those corpora, then every training stage and every row
The pose converter (prepare_yt25.py), poses.switch_signing_speed or poses.switch_raised_offset python prepare_yt25.py --stage all --overwrite --languages ase asf bfi --workers 12, report.py data, then every training stage and every row
The pose reader or a label rule of poses (model_fps, pulldown_*, handless_unit_share, switch_unit_share, switch_doubt_share), or a video size in video_meta.csv No conversion. Every training stage, then every row. Nothing warns for pulldown_* and the video sizes
The casing file of a dataset (subtitles.case_lexicon), or lowercase_references of a corpus Stage 1b and Stage 2 of those corpora, then every row with text of those corpora
The recipe, the pool or pretrain.inputs of StreamDuet-Seg, or the window sampler (data/sampler.py), mode_ratios, jitter or segmenter_decode in configs/dlm.yaml Stage 1a (StreamDuet-Seg) and Stage 2 as new runs, then their rows
The recipe of the Moryossef segmenter (configs/moryossef26.yaml, moryossef26/) Stage 1a (Moryossef) as a new run, then the Moryossef rows and Table 1
Uni-Sign of a corpus The B2b entry, Stage 2 of that corpus, and every --text pretrimmed row that reads it
Stage 2: the model, the loss, train_inputs, or how the translator reads the span Stage 2 of every corpus and every arm, as new runs, then their rows
augmentation in configs/dlm.yaml, or the learning rate of a stage augmentation: StreamDuet-Seg, Stage 1b, the B2b edit, Stage 2. A rate: that stage and every stage that loads it. Then their rows
The edge tolerance δ, the shortest span Λ_min, K, the stride or the buffer cap in configs/inference.yaml δ or Λ_min: every training stage. Cap: StreamDuet-Seg, Uni-Sign and Stage 2. K or stride: StreamDuet-Seg and Stage 2. Then every row
Scoring: metrics.py, or scoring in configs/eval.yaml Every row, Table 1 and every report. chunk_gap_s and tiou_thresholds also change the monitors
The streaming engine (infer/stream.py) Every online row and the stability files
The offline span rule (infer/commit_gate.py) Every offline row of a segmenter or of StreamDuet, and Table 1

Reference

Configuration

Config Drives Extends
dlm.yaml The single source of the sampler, augmentation, BIO head, gate and optimizer keys (and the DLM arm) none
ar.yaml StreamDuet (Stage 2) dlm.yaml
baseline_eval.yaml Uni-Sign at evaluation. Its decoder picks the translator of B2a and the pretrained_slt entry of --text pretrimmed dlm.yaml
baseline_train.yaml Stage 1b (B2a) baseline_eval.yaml
bio_pretrain.yaml StreamDuet-Seg (Stage 1a): its rates, its pool and its train inputs dlm.yaml
moryossef26.yaml The Moryossef segmenter (Stage 1a). The head of the file lists what differs from its release none
inference.yaml The fixed constants of the streaming engine (stride, commit votes K, edge tolerance δ, buffer cap, shortest span Λ_min), in seconds. Do not tune them none
data.yaml The corpora, their files and caption rules, the translator starts (pretrained_slt), the pose reader (poses) none
eval.yaml The scoring of the rows (scoring) and the boundary-sweep grid none

--language points every templated path at the corpus, so do not edit a config for one corpus. ${language} and ${corpus} are the config placeholders of the corpus key.

Output folders and row file names

An offline row goes to outputs/offline/, and an online row to outputs/online/. The stability files of --stability go to outputs/stability/, the analyze.py files to outputs/analysis/, and each report to its folder in outputs/report/. The flags of a row give the name of its 2 files: {access}_{spans}_{decode}_{text}_{corpus}_{split}.json (the events file) and the same name with _scores.json (the scores file).

Field Values
access offline, online (--offline, --online)
spans gold, moryossef, s1, joint-ar, chance (--spans). An arm of Table 5 adds its tokens
decode argmax in every paper row, none for the gold and chance spans. --commit-votes K adds -k<K>
text pretrimmed, ar, none (--text), with the tokens of an arm
corpus The corpus key, or <source>-to-<target> with --source-language

For example, offline_moryossef_argmax_pretrimmed_asf_test.json holds the spans of the Moryossef segmenter, read by Uni-Sign, offline, on the asf test set.

More rows and study runs

The tables read the model.pt of each model. --arm-checkpoint <file> reads another file of a Stage 2 run (model_seg.pt, model_text.pt, model_last.pt or an arm): its rows take a token of that file. --segmenter-checkpoint <file> reads another segmenter: give its row its own --output. Each eval.py and analyze.py command of the table also takes --language "$LANG" --split test --allow-test.

Row or study Command or key
Uni-Sign on all gold sentences as one set, with one pooled score (the cell (0, 0) of the boundary sweep) analyze.py --stage boundary-sweep --text pretrimmed --severity-grid-head=0 --severity-grid-tail=0 --output <file>
Same-span control: Uni-Sign on the spans of StreamDuet eval.py --offline --spans ar --text pretrimmed, eval.py --online --spans ar --text pretrimmed
A segmenter alone (no text), with a study decode (viterbi, duration) eval.py --offline --spans s1 --text none --decode viterbi
Spans made by no model (chance) eval.py --offline --spans chance --text none
The untrained controls of the Moryossef segmenter eval.py --offline --spans moryossef --text none --segmenter-init released
Beam search of an offline translator eval.py --offline --spans ar --text ar --num-beams 4
The spans of a saved row, read by a translator eval.py --spans <events file> --text pretrimmed
The scores of a saved row, again eval.py --predictions <events file> --language ${LANG} --split test --allow-test
The boundary sweep analyze.py --stage boundary-sweep --text ar --output <file>
The DLM decoder train.py --stage train-slt --slt-config configs/dlm.yaml, then rows with --spans dlm --text dlm
The one-stream arm with the stitch, and a run with another seed shared_pose_encoder: true with bio.adapter: false, or seed: <n>, in configs/ar.yaml
The dev decode choice, the transfer rows of all systems, the segmenter pretraining study, Stage 2 with no Stage 1, the numbered rows of the result table docs/run_real_data.md, "Other runs"

eval.py --predictions runs no model: it writes the scores file of the row again, beside the events file, and replaces the file that is there.

A text scorer that does not run in the re-score (for example BLEURT with no checkpoint) keeps its values of the replaced file, when that file holds the scores of the same pairs (the same counts and BLEU-4). The last line names each such scorer and says if its values were kept or read 0.0.

Repository map

The entry points are train.py, eval.py, analyze.py, report.py and prepare_yt25.py (see the --help of each). train/ holds the training loops, infer/ the decodes, the commit rules and the streaming engine, evaluation/ what eval.py runs, reporting/ what report.py runs, and metrics.py every metric calculation. docs/ holds the local guides (data_pipeline.md with the data rules, run_real_data.md, implementation_notes.md) and the paper source (docs/cvpr2027/).

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages