FangSen9000 commited on
Commit ·
dde130b
1
Parent(s): d6bdfb4
Runs normally, but training still has some issues
Browse files- .gitignore +3 -0
- env/{requirements.txt → dashboard.txt} +0 -0
- env/signx-slt.txt +88 -0
- env/slt_tf1.txt +39 -0
- plugins/SignX/smkd/asllrp第七次训练全pose协助2000/gloss_dict.txt +1243 -0
- plugins/SignX/smkd/configs/youtubeasl.yaml +4 -0
- plugins/SignX/smkd/dataset/dataloader_video.py +93 -10
- plugins/SignX/smkd/evaluation/slr_eval/wer_calculation.py +6 -3
- plugins/SignX/smkd/seq_scripts.py +8 -8
- plugins/SignX/training_yutubeasl/ENVIRONMENT_SETUP.md +106 -0
- plugins/SignX/training_yutubeasl/QUICK_START.md +61 -0
- plugins/SignX/training_yutubeasl/README.md +41 -0
- plugins/SignX/training_yutubeasl/START_HERE.md +115 -0
- plugins/SignX/training_yutubeasl/configs/youtubeasl_dataset.yaml +4 -0
- plugins/SignX/training_yutubeasl/configs/youtubeasl_smkd.yaml +51 -0
- plugins/SignX/training_yutubeasl/docs/QUICKSTART.md +203 -0
- plugins/SignX/training_yutubeasl/docs/TUTORIAL.md +193 -0
- plugins/SignX/training_yutubeasl/run_all.sh +247 -0
- plugins/SignX/training_yutubeasl/scripts/.nfs000000004234454e00002a55 +95 -0
- plugins/SignX/training_yutubeasl/scripts/1_preprocess.py +303 -0
- plugins/SignX/training_yutubeasl/scripts/2_train_smkd.sh +95 -0
- plugins/SignX/training_yutubeasl/scripts/3_extract_features.sh +56 -0
- plugins/SignX/training_yutubeasl/scripts/4_train_sltunet.sh +95 -0
- plugins/SignX/training_yutubeasl/scripts/prepare_youtubeasl_text.py +185 -0
- plugins/SignX/training_yutubeasl/scripts/select_gpus.sh +58 -0
.gitignore
CHANGED
|
@@ -5,3 +5,6 @@ plugins/ASLLRP_utterances_results
|
|
| 5 |
plugins/CorrNet_Plus_modified
|
| 6 |
plugins/dtwSign-X
|
| 7 |
plugins/ASLLRP_info
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
plugins/CorrNet_Plus_modified
|
| 6 |
plugins/dtwSign-X
|
| 7 |
plugins/ASLLRP_info
|
| 8 |
+
plugins/YouTubeASL
|
| 9 |
+
plugins/SignX/smkd/work_dir
|
| 10 |
+
plugins/SignX/smkd/youtubeasl
|
env/{requirements.txt → dashboard.txt}
RENAMED
|
File without changes
|
env/signx-slt.txt
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
absl-py==2.1.0
|
| 2 |
+
accelerate==1.0.1
|
| 3 |
+
Brotli @ file:///home/conda/feedstock_root/build_artifacts/brotli-split_1695989787169/work
|
| 4 |
+
cachetools==5.5.1
|
| 5 |
+
certifi @ file:///home/conda/feedstock_root/build_artifacts/certifi_1725278078093/work/certifi
|
| 6 |
+
cffi @ file:///home/conda/feedstock_root/build_artifacts/cffi_1723018376978/work
|
| 7 |
+
charset-normalizer @ file:///home/conda/feedstock_root/build_artifacts/charset-normalizer_1728479282467/work
|
| 8 |
+
click==8.1.8
|
| 9 |
+
contourpy==1.1.1
|
| 10 |
+
cycler==0.12.1
|
| 11 |
+
diffusers==0.32.2
|
| 12 |
+
fastdtw==0.3.4
|
| 13 |
+
filelock @ file:///home/conda/feedstock_root/build_artifacts/filelock_1726613473834/work
|
| 14 |
+
fonttools==4.55.4
|
| 15 |
+
fsspec==2024.12.0
|
| 16 |
+
gmpy2 @ file:///home/conda/feedstock_root/build_artifacts/gmpy2_1715527302982/work
|
| 17 |
+
google-auth==2.37.0
|
| 18 |
+
google-auth-oauthlib==1.0.0
|
| 19 |
+
GPUtil==1.4.0
|
| 20 |
+
graphviz==0.20.3
|
| 21 |
+
grpcio==1.69.0
|
| 22 |
+
h2 @ file:///home/conda/feedstock_root/build_artifacts/h2_1634280454336/work
|
| 23 |
+
h5py==3.11.0
|
| 24 |
+
hiddenlayer==0.3
|
| 25 |
+
hpack==4.0.0
|
| 26 |
+
huggingface-hub==0.27.1
|
| 27 |
+
hyperframe @ file:///home/conda/feedstock_root/build_artifacts/hyperframe_1619110129307/work
|
| 28 |
+
idna @ file:///home/conda/feedstock_root/build_artifacts/idna_1726459485162/work
|
| 29 |
+
importlib_metadata==8.5.0
|
| 30 |
+
importlib_resources==6.4.5
|
| 31 |
+
Jinja2 @ file:///home/conda/feedstock_root/build_artifacts/jinja2_1715127149914/work
|
| 32 |
+
joblib==1.4.2
|
| 33 |
+
kiwisolver==1.4.7
|
| 34 |
+
Markdown==3.7
|
| 35 |
+
MarkupSafe @ file:///home/conda/feedstock_root/build_artifacts/markupsafe_1706899923320/work
|
| 36 |
+
matplotlib==3.7.5
|
| 37 |
+
mpmath @ file:///home/conda/feedstock_root/build_artifacts/mpmath_1678228039184/work
|
| 38 |
+
netron==8.1.3
|
| 39 |
+
networkx @ file:///home/conda/feedstock_root/build_artifacts/networkx_1680692919326/work
|
| 40 |
+
nltk==3.9.1
|
| 41 |
+
numpy @ file:///home/conda/feedstock_root/build_artifacts/numpy_1687808301083/work
|
| 42 |
+
oauthlib==3.2.2
|
| 43 |
+
opencv-python==4.11.0.86
|
| 44 |
+
packaging==24.2
|
| 45 |
+
pandas==2.0.3
|
| 46 |
+
pillow @ file:///home/conda/feedstock_root/build_artifacts/pillow_1719903565503/work
|
| 47 |
+
protobuf==5.29.3
|
| 48 |
+
psutil==7.0.0
|
| 49 |
+
pyarrow==17.0.0
|
| 50 |
+
pyasn1==0.6.1
|
| 51 |
+
pyasn1_modules==0.4.1
|
| 52 |
+
pycparser @ file:///home/conda/feedstock_root/build_artifacts/pycparser_1711811537435/work
|
| 53 |
+
pyparsing==3.1.4
|
| 54 |
+
PySocks @ file:///home/conda/feedstock_root/build_artifacts/pysocks_1661604839144/work
|
| 55 |
+
python-dateutil==2.9.0.post0
|
| 56 |
+
pytz==2024.2
|
| 57 |
+
PyYAML @ file:///home/conda/feedstock_root/build_artifacts/pyyaml_1723018227672/work
|
| 58 |
+
regex==2024.11.6
|
| 59 |
+
requests @ file:///home/conda/feedstock_root/build_artifacts/requests_1717057054362/work
|
| 60 |
+
requests-oauthlib==2.0.0
|
| 61 |
+
rsa==4.9
|
| 62 |
+
safetensors==0.5.2
|
| 63 |
+
scikit-learn==1.3.2
|
| 64 |
+
scipy==1.10.1
|
| 65 |
+
sentencepiece==0.2.0
|
| 66 |
+
six==1.17.0
|
| 67 |
+
sympy @ file:///home/conda/feedstock_root/build_artifacts/sympy_1728484478345/work
|
| 68 |
+
tensorboard==2.14.0
|
| 69 |
+
tensorboard-data-server==0.7.2
|
| 70 |
+
threadpoolctl==3.5.0
|
| 71 |
+
timm==1.0.20
|
| 72 |
+
tokenizers==0.20.3
|
| 73 |
+
torch==2.4.1
|
| 74 |
+
torchaudio==2.4.1
|
| 75 |
+
torchinfo==1.8.0
|
| 76 |
+
torchview==0.2.6
|
| 77 |
+
torchvision==0.20.0
|
| 78 |
+
torchviz==0.0.3
|
| 79 |
+
tqdm==4.67.1
|
| 80 |
+
transformers==4.46.3
|
| 81 |
+
triton==3.0.0
|
| 82 |
+
typing_extensions @ file:///home/conda/feedstock_root/build_artifacts/typing_extensions_1717802530399/work
|
| 83 |
+
tzdata==2025.1
|
| 84 |
+
urllib3 @ file:///home/conda/feedstock_root/build_artifacts/urllib3_1726496430923/work
|
| 85 |
+
Werkzeug==3.0.6
|
| 86 |
+
zipp==3.20.2
|
| 87 |
+
zstandard==0.23.0
|
| 88 |
+
|
env/slt_tf1.txt
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
absl-py==2.1.0
|
| 2 |
+
astor==0.8.1
|
| 3 |
+
certifi @ file:///croot/certifi_1671487769961/work/certifi
|
| 4 |
+
cycler==0.11.0
|
| 5 |
+
fonttools==4.38.0
|
| 6 |
+
gast==0.2.2
|
| 7 |
+
google-pasta==0.2.0
|
| 8 |
+
grpcio==1.62.3
|
| 9 |
+
h5py==3.8.0
|
| 10 |
+
importlib-metadata==6.7.0
|
| 11 |
+
Keras-Applications==1.0.8
|
| 12 |
+
Keras-Preprocessing==1.1.2
|
| 13 |
+
kiwisolver==1.4.5
|
| 14 |
+
Markdown==3.4.4
|
| 15 |
+
MarkupSafe==2.1.5
|
| 16 |
+
matplotlib==3.5.3
|
| 17 |
+
numpy==1.21.6
|
| 18 |
+
nvidia-cublas-cu11==11.10.3.66
|
| 19 |
+
nvidia-cuda-nvrtc-cu11==11.7.99
|
| 20 |
+
nvidia-cuda-runtime-cu11==11.7.99
|
| 21 |
+
nvidia-cudnn-cu11==8.5.0.96
|
| 22 |
+
opt-einsum==3.3.0
|
| 23 |
+
packaging==24.0
|
| 24 |
+
Pillow==9.5.0
|
| 25 |
+
protobuf==4.24.4
|
| 26 |
+
pyparsing==3.1.4
|
| 27 |
+
python-dateutil==2.9.0.post0
|
| 28 |
+
PyYAML==6.0.1
|
| 29 |
+
six==1.17.0
|
| 30 |
+
tensorboard==1.15.0
|
| 31 |
+
tensorflow==1.15.0
|
| 32 |
+
tensorflow-estimator==1.15.1
|
| 33 |
+
termcolor==2.3.0
|
| 34 |
+
tqdm==4.67.1
|
| 35 |
+
typing_extensions==4.7.1
|
| 36 |
+
Werkzeug==2.2.3
|
| 37 |
+
wrapt==1.16.0
|
| 38 |
+
zipp==3.15.0
|
| 39 |
+
|
plugins/SignX/smkd/asllrp第七次训练全pose协助2000/gloss_dict.txt
ADDED
|
@@ -0,0 +1,1243 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
1 13 "I
|
| 2 |
+
2 34 "WHAT"
|
| 3 |
+
3 3 "pause"
|
| 4 |
+
4 4 "perplexed"
|
| 5 |
+
5 7 "you
|
| 6 |
+
6 10 #ALL
|
| 7 |
+
7 2 #APT
|
| 8 |
+
8 4 #ASL
|
| 9 |
+
9 2 #BACK
|
| 10 |
+
10 15 #BBQ
|
| 11 |
+
11 2 #BURN
|
| 12 |
+
12 3 #CAR
|
| 13 |
+
13 4 #DO
|
| 14 |
+
14 2 #DO-IT
|
| 15 |
+
15 23 #DOG
|
| 16 |
+
16 2 #ED
|
| 17 |
+
17 2 #FRESH
|
| 18 |
+
18 3 #FUCK
|
| 19 |
+
19 4 #GAS
|
| 20 |
+
20 3 #GO
|
| 21 |
+
21 13 #HS
|
| 22 |
+
22 173 #IF
|
| 23 |
+
23 4 #JOB
|
| 24 |
+
24 81 #NO
|
| 25 |
+
25 3 #OFF
|
| 26 |
+
26 13 #OK
|
| 27 |
+
27 11 #OR
|
| 28 |
+
28 2 #OWN
|
| 29 |
+
29 13 #PO
|
| 30 |
+
30 6 #QUIZ
|
| 31 |
+
31 12 #SALE
|
| 32 |
+
32 34 #SO
|
| 33 |
+
33 6 #TV
|
| 34 |
+
34 12 #VP
|
| 35 |
+
35 4 #WHAT
|
| 36 |
+
36 52 #WHEN
|
| 37 |
+
37 7 (1h)5"perplexed"
|
| 38 |
+
38 2 (1h)NOW+NIGHT
|
| 39 |
+
39 2 (1h)TEACH+(1h)AGENT
|
| 40 |
+
40 4 (25)WHY+NOT
|
| 41 |
+
41 2 (2h)#NO+MORE
|
| 42 |
+
42 4 (2h)ANY+(2h)THING
|
| 43 |
+
43 7 (2h)KNOW+NEG
|
| 44 |
+
44 3 (5)FIRST-IN-LIST
|
| 45 |
+
45 12 (5)WEATHER
|
| 46 |
+
46 19 (K)KITCHEN
|
| 47 |
+
47 3 (L-X)INTERESTING
|
| 48 |
+
48 2 1"no"
|
| 49 |
+
49 4 5"dismissive
|
| 50 |
+
50 10 5"exasperation"
|
| 51 |
+
51 3 5"forget
|
| 52 |
+
52 3 5"frustration"
|
| 53 |
+
53 3 5"hands
|
| 54 |
+
54 8 5"hesitation"
|
| 55 |
+
55 3 5"hey"
|
| 56 |
+
56 4 5"let's
|
| 57 |
+
57 2 5"looking
|
| 58 |
+
58 4 5"no
|
| 59 |
+
59 5 5"not
|
| 60 |
+
60 4 5"oh
|
| 61 |
+
61 3 5"ok
|
| 62 |
+
62 6 5"out
|
| 63 |
+
63 2 5"panic"
|
| 64 |
+
64 3 5"resignation"
|
| 65 |
+
65 2 5"shocked"
|
| 66 |
+
66 3 5"so
|
| 67 |
+
67 5 5"surprised"
|
| 68 |
+
68 2 5"that's
|
| 69 |
+
69 2 5"trepidation"
|
| 70 |
+
70 7 5"umm"
|
| 71 |
+
71 87 5"wave
|
| 72 |
+
72 2 5"well"
|
| 73 |
+
73 13 5"whoa"
|
| 74 |
+
74 19 5"wow"
|
| 75 |
+
75 7 5"you
|
| 76 |
+
76 3 A
|
| 77 |
+
77 2 A-LEVEL-ABOVE
|
| 78 |
+
78 3 A-LEVEL-BELOW
|
| 79 |
+
79 20 A-LOT
|
| 80 |
+
80 5 A-OK
|
| 81 |
+
81 25 ABOUT
|
| 82 |
+
82 5 ABOVE
|
| 83 |
+
83 20 ACCEPT
|
| 84 |
+
84 10 ACCIDENT
|
| 85 |
+
85 2 ACCOMMODATE
|
| 86 |
+
86 17 ACT
|
| 87 |
+
87 17 ACTION
|
| 88 |
+
88 4 ADD-TO
|
| 89 |
+
89 2 ADDICTED
|
| 90 |
+
90 6 ADULT-TALL
|
| 91 |
+
91 3 ADVISE/INFLUENCE
|
| 92 |
+
92 8 AFRAID
|
| 93 |
+
93 11 AGAIN
|
| 94 |
+
94 3 AGAINST
|
| 95 |
+
95 2 AGE-TWENTY-ONE
|
| 96 |
+
96 4 AGREE
|
| 97 |
+
97 3 AIRPLANE
|
| 98 |
+
98 4 ALARM
|
| 99 |
+
99 7 ALL
|
| 100 |
+
100 8 ALL-DAY
|
| 101 |
+
101 12 ALL-NIGHT
|
| 102 |
+
102 3 ALLERGY
|
| 103 |
+
103 9 ALLOW
|
| 104 |
+
104 6 ALMOST
|
| 105 |
+
105 6 ALONE
|
| 106 |
+
106 16 ALSO
|
| 107 |
+
107 14 ALWAYS
|
| 108 |
+
108 13 AMONG
|
| 109 |
+
109 9 ANALYZE
|
| 110 |
+
110 28 AND
|
| 111 |
+
111 7 ANGRY
|
| 112 |
+
112 2 ANIMAL
|
| 113 |
+
113 4 ANSWER
|
| 114 |
+
114 2 ANSWER+AGENT
|
| 115 |
+
115 5 ANY
|
| 116 |
+
116 3 ANY+ONE
|
| 117 |
+
117 6 ANYWAY/NOT-MATTER
|
| 118 |
+
118 7 APPLAUSE
|
| 119 |
+
119 3 APPLE
|
| 120 |
+
120 6 APPLY
|
| 121 |
+
121 2 APPOINTMENT
|
| 122 |
+
122 13 AREA
|
| 123 |
+
123 8 AROUND
|
| 124 |
+
124 80 ARRIVE
|
| 125 |
+
125 3 ARTICLE
|
| 126 |
+
126 16 ASK
|
| 127 |
+
127 3 ATTEMPT
|
| 128 |
+
128 8 ATTENTION-WAVE
|
| 129 |
+
129 14 AUNT
|
| 130 |
+
130 2 AVERAGE
|
| 131 |
+
131 2 B
|
| 132 |
+
132 10 BABY
|
| 133 |
+
133 2 BACK
|
| 134 |
+
134 1 BACKWARD_2
|
| 135 |
+
135 11 BAD
|
| 136 |
+
136 2 BAKING-SPRINKLES
|
| 137 |
+
137 2 BALANCE
|
| 138 |
+
138 7 BALD
|
| 139 |
+
139 4 BASEBALL
|
| 140 |
+
140 4 BASKETBALL
|
| 141 |
+
141 5 BAWL-OUT
|
| 142 |
+
142 2 BCL:C"grab
|
| 143 |
+
143 2 BCL:crvd-5"holding
|
| 144 |
+
144 2 BCL:crvd-5"swashbuckler
|
| 145 |
+
145 3 BEAT
|
| 146 |
+
146 13 BEAUTIFUL
|
| 147 |
+
147 7 BECAUSE
|
| 148 |
+
148 12 BECOME
|
| 149 |
+
149 2 BED
|
| 150 |
+
150 12 BEFORE
|
| 151 |
+
151 5 BELIEVE
|
| 152 |
+
152 22 BELONG
|
| 153 |
+
153 8 BELOW_2
|
| 154 |
+
154 11 BETTER
|
| 155 |
+
155 9 BETWEEN/SHARE
|
| 156 |
+
156 24 BICYCLE
|
| 157 |
+
157 24 BIG
|
| 158 |
+
158 2 BILL/OWE
|
| 159 |
+
159 6 BIRTHDAY
|
| 160 |
+
160 7 BIRTHDAY_3
|
| 161 |
+
161 6 BLACK
|
| 162 |
+
162 2 BLAME
|
| 163 |
+
163 3 BLUE
|
| 164 |
+
164 3 BLUE+BERRY
|
| 165 |
+
165 4 BLUE+fs-BERRY
|
| 166 |
+
166 2 BODY
|
| 167 |
+
167 3 BOMB
|
| 168 |
+
168 49 BOOK
|
| 169 |
+
169 3 BOOK-PAGE
|
| 170 |
+
170 13 BORE
|
| 171 |
+
171 16 BORN
|
| 172 |
+
172 7 BOSS
|
| 173 |
+
173 2 BOTH
|
| 174 |
+
174 3 BOTHER
|
| 175 |
+
175 10 BOX/ROOM
|
| 176 |
+
176 16 BOY
|
| 177 |
+
177 2 BOY+SCOUT
|
| 178 |
+
178 1 BPCL:1"going
|
| 179 |
+
179 7 BPCL:1"voice
|
| 180 |
+
180 1 BPCL:bent-B"going
|
| 181 |
+
181 1 BPCL:bent-B"gradually
|
| 182 |
+
182 4 BRACELET
|
| 183 |
+
183 5 BRAVE/RECOVER
|
| 184 |
+
184 34 BREAK
|
| 185 |
+
185 30 BREAK-DOWN
|
| 186 |
+
186 9 BRING/CARRY
|
| 187 |
+
187 7 BROTHER
|
| 188 |
+
188 2 BURP
|
| 189 |
+
189 2 BUSY/BUSINESS
|
| 190 |
+
190 42 BUT
|
| 191 |
+
191 10 BUTTER
|
| 192 |
+
192 60 BUY
|
| 193 |
+
193 2 Bible"
|
| 194 |
+
194 7 CALL-BY-PHONE
|
| 195 |
+
195 13 CAMP
|
| 196 |
+
196 42 CAN
|
| 197 |
+
197 30 CANCEL/CRITICIZE
|
| 198 |
+
198 33 CANNOT
|
| 199 |
+
199 97 CAR
|
| 200 |
+
200 7 CARE
|
| 201 |
+
201 8 CAT
|
| 202 |
+
202 4 CELEBRATE
|
| 203 |
+
203 4 CHANGE
|
| 204 |
+
204 11 CHARACTER
|
| 205 |
+
205 3 CHASE
|
| 206 |
+
206 19 CHAT
|
| 207 |
+
207 2 CHECK
|
| 208 |
+
208 20 CHEESE
|
| 209 |
+
209 14 CHILD
|
| 210 |
+
210 14 CHOCOLATE
|
| 211 |
+
211 2 CHOOSE
|
| 212 |
+
212 2 CHURCH
|
| 213 |
+
213 6 CITY/COMMUNITY
|
| 214 |
+
214 28 CLASS
|
| 215 |
+
215 12 CLASS_2+BOX/ROOM
|
| 216 |
+
216 5 CLEAR
|
| 217 |
+
217 4 CLEVER
|
| 218 |
+
218 8 CLOSE-DOOR
|
| 219 |
+
219 2 COAT
|
| 220 |
+
220 13 COLD
|
| 221 |
+
221 2 COLLAR
|
| 222 |
+
222 7 COLLEGE
|
| 223 |
+
223 3 COLOR
|
| 224 |
+
224 9 COME
|
| 225 |
+
225 10 COMMUNICATE
|
| 226 |
+
226 17 COMMUTE
|
| 227 |
+
227 4 COMPARE
|
| 228 |
+
228 5 COMPETITION
|
| 229 |
+
229 3 COMPUTER
|
| 230 |
+
230 2 COMPUTER_5
|
| 231 |
+
231 6 CONCEPT
|
| 232 |
+
232 2 CONFRONT
|
| 233 |
+
233 3 CONTACT
|
| 234 |
+
234 9 CONTINUE
|
| 235 |
+
235 3 COOK/KITCHEN
|
| 236 |
+
236 6 COOKIE
|
| 237 |
+
237 13 COOPERATE/UNITE
|
| 238 |
+
238 14 CORRECT
|
| 239 |
+
239 8 COUGH
|
| 240 |
+
240 2 COUNTRY
|
| 241 |
+
241 11 COURT
|
| 242 |
+
242 2 COW
|
| 243 |
+
243 12 CRASH
|
| 244 |
+
244 5 CROWDED
|
| 245 |
+
245 31 CULTURE
|
| 246 |
+
246 2 CURRENT-TOPIC
|
| 247 |
+
247 9 DANCE
|
| 248 |
+
248 2 DANGER
|
| 249 |
+
249 2 DATE/DESSERT
|
| 250 |
+
250 2 DCL"flat
|
| 251 |
+
251 5 DCL"round
|
| 252 |
+
252 4 DCL:1"point
|
| 253 |
+
253 3 DCL:4"many
|
| 254 |
+
254 2 DCL:4"people
|
| 255 |
+
255 7 DCL:5"emit
|
| 256 |
+
256 3 DCL:5"extremely
|
| 257 |
+
257 6 DCL:5"hair
|
| 258 |
+
258 2 DCL:5-C-L"nails
|
| 259 |
+
259 3 DCL:A"tear
|
| 260 |
+
260 3 DCL:B"pathway
|
| 261 |
+
261 2 DCL:C"group
|
| 262 |
+
262 3 DCL:F/9"peel
|
| 263 |
+
263 2 DCL:L-X"tube
|
| 264 |
+
264 8 DCL:M"humming"
|
| 265 |
+
265 2 DCL:S"heavy
|
| 266 |
+
266 2 DCL:S-5"throw
|
| 267 |
+
267 2 DCL:U-L"horse
|
| 268 |
+
268 3 DCL:baby-O"writing
|
| 269 |
+
269 2 DCL:bent-B-L"close
|
| 270 |
+
270 3 DCL:crvd-5"clouds
|
| 271 |
+
271 9 DCL:crvd-5"group
|
| 272 |
+
272 1 DCL:crvd-5"reach
|
| 273 |
+
273 4 DCL:crvd-B"above
|
| 274 |
+
274 2 DCL:crvd-B"curve
|
| 275 |
+
275 7 DCL:crvd-B"small
|
| 276 |
+
276 2 DCL:fanned-O"throat
|
| 277 |
+
277 2 DCL:fanned-flat-O"throat"
|
| 278 |
+
278 8 DCL:flat-O"rip
|
| 279 |
+
279 81 DEAF
|
| 280 |
+
280 23 DECIDE
|
| 281 |
+
281 2 DECORATE
|
| 282 |
+
282 5 DEEP
|
| 283 |
+
283 3 DELETE
|
| 284 |
+
284 3 DELIBERATE
|
| 285 |
+
285 4 DELICIOUS
|
| 286 |
+
286 50 DEPART
|
| 287 |
+
287 4 DEVELOP
|
| 288 |
+
288 51 DIFFERENT
|
| 289 |
+
289 9 DINNER
|
| 290 |
+
290 20 DIRECT
|
| 291 |
+
291 17 DISCUSS
|
| 292 |
+
292 4 DISGUST
|
| 293 |
+
293 2 DISTRIBUTE
|
| 294 |
+
294 2 DO
|
| 295 |
+
295 41 DO-DO
|
| 296 |
+
296 5 DOCTOR
|
| 297 |
+
297 11 DOG
|
| 298 |
+
298 7 DOLLAR
|
| 299 |
+
299 2 DORM
|
| 300 |
+
300 4 DOUBT
|
| 301 |
+
301 17 DRESS/CLOTHES
|
| 302 |
+
302 8 DRINK
|
| 303 |
+
303 34 DRIVE
|
| 304 |
+
304 4 DROP
|
| 305 |
+
305 11 DRUNK
|
| 306 |
+
306 7 DRY-CEREAL
|
| 307 |
+
307 12 DURING/WHILE
|
| 308 |
+
308 7 DYE
|
| 309 |
+
309 3 EACH
|
| 310 |
+
310 9 EACH+ONE
|
| 311 |
+
311 5 EASY
|
| 312 |
+
312 31 EAT
|
| 313 |
+
313 11 EAT+NIGHT
|
| 314 |
+
314 2 ECONOMIC
|
| 315 |
+
315 2 EIGHT
|
| 316 |
+
316 2 EMERGENCY
|
| 317 |
+
317 9 EMPTY/EARLY
|
| 318 |
+
318 2 EMPTY/EARLY+(1h)MOST
|
| 319 |
+
319 2 END
|
| 320 |
+
320 17 ENJOY
|
| 321 |
+
321 3 ENOUGH
|
| 322 |
+
322 21 ENTER
|
| 323 |
+
323 2 ENVIRONMENT
|
| 324 |
+
324 5 EQUAL
|
| 325 |
+
325 2 EVERY+ONE
|
| 326 |
+
326 5 EVERY-MONTH/RENT
|
| 327 |
+
327 13 EVERY-YEAR
|
| 328 |
+
328 10 EVERYDAY
|
| 329 |
+
329 2 EXACT
|
| 330 |
+
330 2 EXHAUST
|
| 331 |
+
331 7 EXPENSIVE
|
| 332 |
+
332 34 EXPERIENCE
|
| 333 |
+
333 11 EXPERT
|
| 334 |
+
334 5 EXPRESS
|
| 335 |
+
335 14 FACE
|
| 336 |
+
336 3 FACE+SAME
|
| 337 |
+
337 9 FAIL
|
| 338 |
+
338 32 FAMILY
|
| 339 |
+
339 5 FAMOUS
|
| 340 |
+
340 14 FARM
|
| 341 |
+
341 8 FAST
|
| 342 |
+
342 8 FAST_3
|
| 343 |
+
343 60 FATHER
|
| 344 |
+
344 20 FAVORITE/PREFER
|
| 345 |
+
345 18 FEEL
|
| 346 |
+
346 3 FIGHT
|
| 347 |
+
347 6 FINALLY
|
| 348 |
+
348 23 FIND/FIND-OUT
|
| 349 |
+
349 2 FIND/FIND-OUT+#OUT
|
| 350 |
+
350 37 FINE
|
| 351 |
+
351 124 FINISH
|
| 352 |
+
352 17 FIRE/BURN
|
| 353 |
+
353 3 FIRED
|
| 354 |
+
354 10 FIREWORKS
|
| 355 |
+
355 5 FIRST
|
| 356 |
+
356 3 FIRST-AND-SECOND-IN-LIST
|
| 357 |
+
357 13 FIRST-IN-LIST
|
| 358 |
+
358 6 FISH
|
| 359 |
+
359 12 FISHING
|
| 360 |
+
360 2 FLAT-TIRE
|
| 361 |
+
361 2 FLAT/FLOOR
|
| 362 |
+
362 2 FLAT/LEVEL
|
| 363 |
+
363 2 FLIP-FLOP
|
| 364 |
+
364 2 FLOW
|
| 365 |
+
365 15 FLOWER
|
| 366 |
+
366 3 FLY-BY-PLANE
|
| 367 |
+
367 8 FOCUS/NARROW
|
| 368 |
+
368 3 FOLLOW
|
| 369 |
+
369 4 FOOTBALL
|
| 370 |
+
370 73 FOR
|
| 371 |
+
371 5 FOR-FOR
|
| 372 |
+
372 13 FORGET-IT
|
| 373 |
+
373 2 FORMERLY
|
| 374 |
+
374 2 FREE
|
| 375 |
+
375 2 FREQUENTLY
|
| 376 |
+
376 2 FRESHMAN
|
| 377 |
+
377 2 FRIDAY
|
| 378 |
+
378 241 FRIEND
|
| 379 |
+
379 14 FRISBEE
|
| 380 |
+
380 24 FROM
|
| 381 |
+
381 2 FROM-NOW-ON
|
| 382 |
+
382 3 FULL
|
| 383 |
+
383 9 FUNNY
|
| 384 |
+
384 163 FUTURE
|
| 385 |
+
385 14 GAME
|
| 386 |
+
386 2 GARAGE/SUBMARINE
|
| 387 |
+
387 3 GATE
|
| 388 |
+
388 2 GENERAL
|
| 389 |
+
389 5 GESTURE
|
| 390 |
+
390 19 GET
|
| 391 |
+
391 3 GET-TICKET
|
| 392 |
+
392 3 GET-UP
|
| 393 |
+
393 15 GIFT
|
| 394 |
+
394 3 GIRL
|
| 395 |
+
395 3 GIRL+CORRECT
|
| 396 |
+
396 5 GIRL+FRIEND
|
| 397 |
+
397 16 GIVE
|
| 398 |
+
398 3 GLASSES_2
|
| 399 |
+
399 60 GO
|
| 400 |
+
400 141 GO-OUT
|
| 401 |
+
401 2 GOLD/ns-CALIFORNIA
|
| 402 |
+
402 7 GONE
|
| 403 |
+
403 51 GOOD/THANK-YOU
|
| 404 |
+
404 8 GRAB-CHANCE
|
| 405 |
+
405 7 GRADUATE
|
| 406 |
+
406 6 GRASS
|
| 407 |
+
407 7 GREAT
|
| 408 |
+
408 4 GRIEF
|
| 409 |
+
409 2 GROUP
|
| 410 |
+
410 71 GROUP/TOGETHER
|
| 411 |
+
411 6 GROW
|
| 412 |
+
412 11 GROW-UP
|
| 413 |
+
413 21 GUARANTEE
|
| 414 |
+
414 4 GUILTY
|
| 415 |
+
415 2 GUITAR
|
| 416 |
+
416 2 HABIT
|
| 417 |
+
417 7 HAIR
|
| 418 |
+
418 2 HAIR+DYE
|
| 419 |
+
419 4 HAIR_2+DYE
|
| 420 |
+
420 2 HAMBURGER
|
| 421 |
+
421 3 HANDSOME/ns-HAWAII_2
|
| 422 |
+
422 23 HAPPEN
|
| 423 |
+
423 16 HAPPY
|
| 424 |
+
424 7 HARD
|
| 425 |
+
425 2 HATE
|
| 426 |
+
426 134 HAVE
|
| 427 |
+
427 6 HEADBAND
|
| 428 |
+
428 5 HEADBAND_2
|
| 429 |
+
429 22 HEAR
|
| 430 |
+
430 2 HEAR+(1h)RUMBLE
|
| 431 |
+
431 3 HEAR+NOISE
|
| 432 |
+
432 14 HEAR/LISTEN
|
| 433 |
+
433 18 HEARING
|
| 434 |
+
434 4 HEAVY
|
| 435 |
+
435 10 HELP
|
| 436 |
+
436 21 HERE
|
| 437 |
+
437 9 HIGH
|
| 438 |
+
438 2 HISTORY
|
| 439 |
+
439 7 HIT
|
| 440 |
+
440 67 HOME
|
| 441 |
+
441 5 HOME+WORK
|
| 442 |
+
442 22 HOMEWORK
|
| 443 |
+
443 6 HONEST
|
| 444 |
+
444 8 HOPE
|
| 445 |
+
445 19 HORSE
|
| 446 |
+
446 7 HOSPITAL
|
| 447 |
+
447 13 HOT
|
| 448 |
+
448 16 HOUSE
|
| 449 |
+
449 38 HOW
|
| 450 |
+
450 9 HOW-MANY
|
| 451 |
+
451 4 HUNGRY/WISH
|
| 452 |
+
452 2 HURRICANE
|
| 453 |
+
453 3 HURRY
|
| 454 |
+
454 7 HUSBAND
|
| 455 |
+
455 4 ICE-CREAM
|
| 456 |
+
456 4 ICL:F/9"flip
|
| 457 |
+
457 3 ICL:S"swinging
|
| 458 |
+
458 2 ICL:X"spray
|
| 459 |
+
459 11 IDEA
|
| 460 |
+
460 15 IDENTIFY
|
| 461 |
+
461 40 IF
|
| 462 |
+
462 3 ILLEGAL
|
| 463 |
+
463 2 IMAGINE
|
| 464 |
+
464 6 IMPORTANT
|
| 465 |
+
465 5 IMPOSSIBLE
|
| 466 |
+
466 70 IN
|
| 467 |
+
467 20 INCLUDE/INVOLVE
|
| 468 |
+
468 2 INCREASE
|
| 469 |
+
469 28 INFORM
|
| 470 |
+
470 2 INFREQUENTLY
|
| 471 |
+
471 9 INHALE
|
| 472 |
+
472 2 INNOCENT
|
| 473 |
+
473 4 INSTITUTE
|
| 474 |
+
474 2 INSURANCE/INFECTION
|
| 475 |
+
475 6 INTERCOURSE+fs-UP
|
| 476 |
+
476 2 INTERNATIONAL
|
| 477 |
+
477 15 INTERNET
|
| 478 |
+
478 23 INTERPRET
|
| 479 |
+
479 4 INTERRUPT
|
| 480 |
+
480 3 INTERVIEW
|
| 481 |
+
481 7 INTRODUCE
|
| 482 |
+
482 10 INVITE/HIRE
|
| 483 |
+
483 1313 IX
|
| 484 |
+
484 812 IX-1p
|
| 485 |
+
485 15 IX-1p-pl
|
| 486 |
+
486 6 IX-1p-pl-2
|
| 487 |
+
487 12 IX-honorific
|
| 488 |
+
488 68 IX-pl
|
| 489 |
+
489 31 IX-pl-2
|
| 490 |
+
490 22 JOIN
|
| 491 |
+
491 2 KEEP
|
| 492 |
+
492 12 KEY
|
| 493 |
+
493 2 KICK-OFF
|
| 494 |
+
494 23 KID
|
| 495 |
+
495 24 KIND
|
| 496 |
+
496 7 KING
|
| 497 |
+
497 39 KISS-FIST
|
| 498 |
+
498 42 KNOW
|
| 499 |
+
499 6 KNOW+(1h)NEG
|
| 500 |
+
500 3 KNOW-NOTHING
|
| 501 |
+
501 7 KNOW-THAT
|
| 502 |
+
502 3 KOWTOW
|
| 503 |
+
503 8 LANGUAGE
|
| 504 |
+
504 7 LAPTOP
|
| 505 |
+
505 11 LAST
|
| 506 |
+
506 3 LAST-WEEK
|
| 507 |
+
507 3 LAST-YEAR
|
| 508 |
+
508 7 LATE
|
| 509 |
+
509 6 LATER_2
|
| 510 |
+
510 6 LAUGH
|
| 511 |
+
511 3 LAUGH-HARD
|
| 512 |
+
512 17 LEARN
|
| 513 |
+
513 2 LEARN+AGENT
|
| 514 |
+
514 6 LEAVE
|
| 515 |
+
515 3 LEAVE-THERE
|
| 516 |
+
516 6 LECTURE
|
| 517 |
+
517 2 LEND
|
| 518 |
+
518 3 LESS
|
| 519 |
+
519 16 LETTER/MAIL
|
| 520 |
+
520 11 LIBRARY
|
| 521 |
+
521 2 LICENSE
|
| 522 |
+
522 9 LIE
|
| 523 |
+
523 7 LIE-DOWN
|
| 524 |
+
524 3 LIGHT
|
| 525 |
+
525 2 LIGHT-FLASH
|
| 526 |
+
526 63 LIKE
|
| 527 |
+
527 3 LINGUISTICS
|
| 528 |
+
528 4 LIST
|
| 529 |
+
529 8 LIST-ORDER
|
| 530 |
+
530 4 LIST-ORDER-MIDDLE
|
| 531 |
+
531 3 LITTLE-BIT
|
| 532 |
+
532 23 LIVE
|
| 533 |
+
533 3 LONG
|
| 534 |
+
534 17 LONG-AGO
|
| 535 |
+
535 7 LONG-LIST
|
| 536 |
+
536 112 LOOK
|
| 537 |
+
537 3 LOOK-BY-EYE
|
| 538 |
+
538 2 LOSE
|
| 539 |
+
539 9 LOUD
|
| 540 |
+
540 9 LOUSY
|
| 541 |
+
541 27 LOVE
|
| 542 |
+
542 2 MAD
|
| 543 |
+
543 5 MAGAZINE
|
| 544 |
+
544 11 MAJOR
|
| 545 |
+
545 69 MAKE
|
| 546 |
+
546 2 MAKE+REALLY
|
| 547 |
+
547 23 MAN
|
| 548 |
+
548 17 MANAGE/CONTROL
|
| 549 |
+
549 34 MANY
|
| 550 |
+
550 4 MARRY
|
| 551 |
+
551 10 MATCH
|
| 552 |
+
552 29 MAYBE
|
| 553 |
+
553 55 MEAN
|
| 554 |
+
554 21 MEET
|
| 555 |
+
555 3 MEETING
|
| 556 |
+
556 2 MEMORIZE
|
| 557 |
+
557 4 MESSED-UP
|
| 558 |
+
558 6 MILK
|
| 559 |
+
559 3 MIND
|
| 560 |
+
560 2 MINOR
|
| 561 |
+
561 4 MINUTE
|
| 562 |
+
562 5 MISMATCH
|
| 563 |
+
563 10 MISS/ASSUME
|
| 564 |
+
564 2 MISUNDERSTAND
|
| 565 |
+
565 3 MONDAY
|
| 566 |
+
566 12 MONEY
|
| 567 |
+
567 2 MONEY_2
|
| 568 |
+
568 4 MONSTER
|
| 569 |
+
569 22 MORE
|
| 570 |
+
570 3 MORMON
|
| 571 |
+
571 4 MORNING
|
| 572 |
+
572 2 MOST
|
| 573 |
+
573 105 MOTHER
|
| 574 |
+
574 28 MOTHER+FATHER
|
| 575 |
+
575 2 MOUSE/FICTION
|
| 576 |
+
576 19 MOVE
|
| 577 |
+
577 1 MOVE-AROUND
|
| 578 |
+
578 12 MOVE-AWAY
|
| 579 |
+
579 46 MOVIE
|
| 580 |
+
580 3 MOVING-ON-TO-NEXT-TOPIC
|
| 581 |
+
581 11 MOW
|
| 582 |
+
582 5 MUSIC
|
| 583 |
+
583 112 MUST
|
| 584 |
+
584 2 MUTE
|
| 585 |
+
585 2 Mary
|
| 586 |
+
586 3 NAB
|
| 587 |
+
587 25 NAME
|
| 588 |
+
588 4 NEAR
|
| 589 |
+
589 3 NEAT
|
| 590 |
+
590 2 NEGATIVE
|
| 591 |
+
591 2 NEGLECT
|
| 592 |
+
592 15 NEVER
|
| 593 |
+
593 18 NEW
|
| 594 |
+
594 4 NEXT
|
| 595 |
+
595 10 NEXT-TO
|
| 596 |
+
596 2 NEXT-TOPIC
|
| 597 |
+
597 8 NEXT-WEEK
|
| 598 |
+
598 39 NICE/CLEAN
|
| 599 |
+
599 24 NIGHT
|
| 600 |
+
600 2 NINE
|
| 601 |
+
601 2 NINETEEN
|
| 602 |
+
602 44 NOISE
|
| 603 |
+
603 3 NOISE+RUMBLE
|
| 604 |
+
604 4 NONE
|
| 605 |
+
605 83 NONE/NOTHING
|
| 606 |
+
606 3 NONE/NOTHING+ONE
|
| 607 |
+
607 283 NOT
|
| 608 |
+
608 2 NOT+MUST
|
| 609 |
+
609 6 NOT-MIND
|
| 610 |
+
610 32 NOT-YET
|
| 611 |
+
611 3 NOTHING
|
| 612 |
+
612 2 NOTHING-AT-ALL
|
| 613 |
+
613 5 NOTICE
|
| 614 |
+
614 89 NOW
|
| 615 |
+
615 2 NOW-WEEK
|
| 616 |
+
616 2 NURSE
|
| 617 |
+
617 4 NUT
|
| 618 |
+
618 12 OF-COURSE
|
| 619 |
+
619 21 OFTEN
|
| 620 |
+
620 38 OH-I-SEE
|
| 621 |
+
621 9 OLD
|
| 622 |
+
622 24 ON
|
| 623 |
+
623 2 ON-TIME
|
| 624 |
+
624 24 ONE
|
| 625 |
+
625 2 ONE+HUNDRED
|
| 626 |
+
626 2 ONE-DOLLAR
|
| 627 |
+
627 3 ONE-MONTH
|
| 628 |
+
628 2 ONE-WEEK
|
| 629 |
+
629 11 ONLY
|
| 630 |
+
630 2 OPPORTUNITY
|
| 631 |
+
631 2 OPPOSITE
|
| 632 |
+
632 3 ORANGE
|
| 633 |
+
633 7 ORDER
|
| 634 |
+
634 20 OTHER
|
| 635 |
+
635 7 OUT
|
| 636 |
+
636 3 OVER/AFTER
|
| 637 |
+
637 2 OVERSLEEP
|
| 638 |
+
638 2 PAINT
|
| 639 |
+
639 6 PAPER
|
| 640 |
+
640 4 PAPER-CHECK/CARD
|
| 641 |
+
641 55 PARTY
|
| 642 |
+
642 6 PASS
|
| 643 |
+
643 7 PASS-OUT
|
| 644 |
+
644 12 PAST
|
| 645 |
+
645 26 PAST+NIGHT
|
| 646 |
+
646 17 PAY
|
| 647 |
+
647 12 PAY/BUY
|
| 648 |
+
648 16 PAY/SPEND
|
| 649 |
+
649 1 PCL:crvd-5"people
|
| 650 |
+
650 62 PEOPLE
|
| 651 |
+
651 5 PERMIT
|
| 652 |
+
652 28 PERSON
|
| 653 |
+
653 3 PET-PEEVE
|
| 654 |
+
654 2 PHONE
|
| 655 |
+
655 7 PICK/CHOOSE
|
| 656 |
+
656 12 PIE
|
| 657 |
+
657 27 PINEAPPLE
|
| 658 |
+
658 8 PING-PONG/TENNIS
|
| 659 |
+
659 3 PISS-OFF
|
| 660 |
+
660 20 PIZZA_4
|
| 661 |
+
661 23 PLACE
|
| 662 |
+
662 11 PLAID
|
| 663 |
+
663 12 PLAN
|
| 664 |
+
664 53 PLAY
|
| 665 |
+
665 5 PLUS
|
| 666 |
+
666 3 POINT
|
| 667 |
+
667 5 POLITE
|
| 668 |
+
668 3 POLITICS
|
| 669 |
+
669 3 POP-UP
|
| 670 |
+
670 120 POSS
|
| 671 |
+
671 177 POSS-1p
|
| 672 |
+
672 4 POSS-1p-pl
|
| 673 |
+
673 8 POSS-pl
|
| 674 |
+
674 2 POUND/WEIGH
|
| 675 |
+
675 2 POWER
|
| 676 |
+
676 2 PRACTICE
|
| 677 |
+
677 14 PRESIDENT
|
| 678 |
+
678 3 PRINCIPAL
|
| 679 |
+
679 3 PROBLEM
|
| 680 |
+
680 35 PROCEED
|
| 681 |
+
681 3 PROFESSION
|
| 682 |
+
682 8 PROGRESS
|
| 683 |
+
683 5 PUT
|
| 684 |
+
684 7 PUT-AWAY
|
| 685 |
+
685 88 QMwg
|
| 686 |
+
686 4 QUALITY
|
| 687 |
+
687 2 QUESTION
|
| 688 |
+
688 13 QUIET
|
| 689 |
+
689 19 QUOTE/TOPIC
|
| 690 |
+
690 65 RAIN
|
| 691 |
+
691 9 RANGE
|
| 692 |
+
692 54 READ
|
| 693 |
+
693 10 READY
|
| 694 |
+
694 68 REALLY
|
| 695 |
+
695 26 REALLY+WORK
|
| 696 |
+
696 6 REALLY+WORK/BUSINESS
|
| 697 |
+
697 14 REASON
|
| 698 |
+
698 34 RECENT-PAST
|
| 699 |
+
699 2 RECORD
|
| 700 |
+
700 4 RED
|
| 701 |
+
701 25 REFUSE
|
| 702 |
+
702 3 REGULAR
|
| 703 |
+
703 4 RELATIONSHIP-OFF
|
| 704 |
+
704 5 REMEMBER
|
| 705 |
+
705 6 REMIND
|
| 706 |
+
706 3 REMIND-2p
|
| 707 |
+
707 2 REPLACE
|
| 708 |
+
708 3 REPUBLICAN
|
| 709 |
+
709 6 REQUIRE
|
| 710 |
+
710 6 RESEARCH
|
| 711 |
+
711 3 RESTAURANT
|
| 712 |
+
712 2 RESUME
|
| 713 |
+
713 4 ROAD
|
| 714 |
+
714 3 ROLE
|
| 715 |
+
715 6 ROOMMATE
|
| 716 |
+
716 7 ROWING
|
| 717 |
+
717 3 RULE
|
| 718 |
+
718 7 RUN
|
| 719 |
+
719 2 RUN-MACHINE
|
| 720 |
+
720 4 S"cheering"
|
| 721 |
+
721 5 SAFE
|
| 722 |
+
722 45 SAME
|
| 723 |
+
723 3 SAME-LIST
|
| 724 |
+
724 3 SAME-OLD
|
| 725 |
+
725 11 SAY
|
| 726 |
+
726 53 SCHOOL
|
| 727 |
+
727 2 SCL:1"John
|
| 728 |
+
728 3 SCL:1"mentor
|
| 729 |
+
729 2 SCL:1"person
|
| 730 |
+
730 9 SCL:3"person
|
| 731 |
+
731 2 SCL:5-C"big
|
| 732 |
+
732 3 SCL:U-L"person
|
| 733 |
+
733 2 SCL:V"person
|
| 734 |
+
734 4 SCL:V/2"look
|
| 735 |
+
735 3 SCL:V/2"person
|
| 736 |
+
736 3 SCL:V/2"two
|
| 737 |
+
737 11 SCL:bent-U-L"person
|
| 738 |
+
738 9 SCL:crvd-5"group
|
| 739 |
+
739 2 SCL:crvd-V"cat
|
| 740 |
+
740 2 SCL:crvd-V"horse
|
| 741 |
+
741 15 SCREAM
|
| 742 |
+
742 2 SCREEN/FILTER
|
| 743 |
+
743 4 SEARCH-FOR
|
| 744 |
+
744 2 SECOND
|
| 745 |
+
745 12 SECOND-IN-LIST
|
| 746 |
+
746 29 SEE
|
| 747 |
+
747 9 SEEM
|
| 748 |
+
748 9 SELF
|
| 749 |
+
749 7 SELF-1p
|
| 750 |
+
750 25 SELL
|
| 751 |
+
751 3 SEMESTER
|
| 752 |
+
752 15 SEND
|
| 753 |
+
753 6 SEND/MAIL
|
| 754 |
+
754 3 SERIOUS
|
| 755 |
+
755 6 SERVICE
|
| 756 |
+
756 22 SET-UP
|
| 757 |
+
757 6 SEVEN
|
| 758 |
+
758 2 SHEET-CAKE
|
| 759 |
+
759 3 SHH
|
| 760 |
+
760 9 SHOE
|
| 761 |
+
761 5 SHORT-HEIGHT
|
| 762 |
+
762 10 SHORTS
|
| 763 |
+
763 17 SHOULD
|
| 764 |
+
764 25 SHOW
|
| 765 |
+
765 2 SHUCKS
|
| 766 |
+
766 27 SICK
|
| 767 |
+
767 4 SICK-OF
|
| 768 |
+
768 3 SICK/SILLY
|
| 769 |
+
769 10 SIGN
|
| 770 |
+
770 31 SISTER
|
| 771 |
+
771 9 SIT
|
| 772 |
+
772 7 SITUATION
|
| 773 |
+
773 6 SIX
|
| 774 |
+
774 7 SKI
|
| 775 |
+
775 4 SKILL
|
| 776 |
+
776 4 SLEEP
|
| 777 |
+
777 6 SLOW
|
| 778 |
+
778 15 SMALL
|
| 779 |
+
779 2 SMALL-AMOUNT
|
| 780 |
+
780 35 SNOW
|
| 781 |
+
781 3 SO-SO
|
| 782 |
+
782 10 SOCIAL/INTERACT
|
| 783 |
+
783 15 SOME
|
| 784 |
+
784 22 SOMETHING/ONE
|
| 785 |
+
785 5 SOMETIMES
|
| 786 |
+
786 4 SON
|
| 787 |
+
787 14 SOON
|
| 788 |
+
788 13 SORRY
|
| 789 |
+
789 2 SOUP
|
| 790 |
+
790 3 SOUTH
|
| 791 |
+
791 3 SPAGHETTI
|
| 792 |
+
792 7 SPECIAL/EXCEPT
|
| 793 |
+
793 10 SPEECH/ORAL
|
| 794 |
+
794 3 SPEND
|
| 795 |
+
795 3 SPREAD
|
| 796 |
+
796 2 SPRING
|
| 797 |
+
797 3 STAND
|
| 798 |
+
798 2 STAR
|
| 799 |
+
799 3 STAR+BOMB
|
| 800 |
+
800 37 START
|
| 801 |
+
801 28 STAY
|
| 802 |
+
802 2 STEAL
|
| 803 |
+
803 15 STILL
|
| 804 |
+
804 11 STOP
|
| 805 |
+
805 16 STORY
|
| 806 |
+
806 14 STRANGE
|
| 807 |
+
807 3 STRIPES
|
| 808 |
+
808 2 STRONG
|
| 809 |
+
809 4 STRUGGLE
|
| 810 |
+
810 2 STUCK
|
| 811 |
+
811 22 STUDENT
|
| 812 |
+
812 25 STUDY
|
| 813 |
+
813 4 SUCCEED
|
| 814 |
+
814 4 SUGGEST
|
| 815 |
+
815 3 SUMMER
|
| 816 |
+
816 2 SUMMON
|
| 817 |
+
817 2 SUN
|
| 818 |
+
818 6 SUNBATHE
|
| 819 |
+
819 7 SUNSHINE
|
| 820 |
+
820 4 SUPERIOR
|
| 821 |
+
821 2 SUPPORT
|
| 822 |
+
822 8 SURF-INTERNET
|
| 823 |
+
823 26 SURPRISE
|
| 824 |
+
824 2 SUSPECT
|
| 825 |
+
825 5 SWEETHEART
|
| 826 |
+
826 14 SWIM
|
| 827 |
+
827 4 SYSTEM
|
| 828 |
+
828 5 TABLE
|
| 829 |
+
829 11 TAKE
|
| 830 |
+
830 4 TAKE-BREAK
|
| 831 |
+
831 3 TAKE-NOTES
|
| 832 |
+
832 33 TAKE-UP
|
| 833 |
+
833 49 TALK
|
| 834 |
+
834 2 TALK-OVER
|
| 835 |
+
835 4 TAN
|
| 836 |
+
836 3 TAPE-RECORDING
|
| 837 |
+
837 5 TASTE
|
| 838 |
+
838 3 TEACH
|
| 839 |
+
839 46 TEACH+AGENT
|
| 840 |
+
840 2 TEAM
|
| 841 |
+
841 26 TELL
|
| 842 |
+
842 2 TEN
|
| 843 |
+
843 51 TEND
|
| 844 |
+
844 18 TEST
|
| 845 |
+
845 5 TEXTING
|
| 846 |
+
846 5 THAN
|
| 847 |
+
847 101 THAT
|
| 848 |
+
848 5 THEN
|
| 849 |
+
849 4 THESE
|
| 850 |
+
850 8 THING
|
| 851 |
+
851 27 THINK
|
| 852 |
+
852 1 THINK+HOPE
|
| 853 |
+
853 2 THINK-OVER
|
| 854 |
+
854 6 THIRD-IN-LIST
|
| 855 |
+
855 2 THIRD-PLACE
|
| 856 |
+
856 4 THIRTY
|
| 857 |
+
857 9 THREE
|
| 858 |
+
858 8 THRILL/WHAT'S-UP
|
| 859 |
+
859 12 THROUGH
|
| 860 |
+
860 43 TIME
|
| 861 |
+
861 3 TIME-PERIOD
|
| 862 |
+
862 7 TIRED
|
| 863 |
+
863 52 TO/UNTIL
|
| 864 |
+
864 17 TOGETHER/GO-STEADY
|
| 865 |
+
865 16 TOILET
|
| 866 |
+
866 38 TOMORROW
|
| 867 |
+
867 7 TOOTH/GLASS
|
| 868 |
+
868 4 TOTAL
|
| 869 |
+
869 2 TRACK-IX
|
| 870 |
+
870 2 TRACK-MIDDLE
|
| 871 |
+
871 2 TRACK-RING
|
| 872 |
+
872 2 TRACK-THUMB
|
| 873 |
+
873 2 TRADITION
|
| 874 |
+
874 3 TRAIN
|
| 875 |
+
875 7 TRANSFER
|
| 876 |
+
876 4 TREE
|
| 877 |
+
877 19 TRIP
|
| 878 |
+
878 3 TROPHY
|
| 879 |
+
879 2 TROUBLE
|
| 880 |
+
880 3 TRY
|
| 881 |
+
881 2 TUBING
|
| 882 |
+
882 5 TURKEY
|
| 883 |
+
883 8 TWENTY
|
| 884 |
+
884 2 TWENTY-EIGHT
|
| 885 |
+
885 2 TWICE
|
| 886 |
+
886 16 TWO
|
| 887 |
+
887 7 TYPE
|
| 888 |
+
888 6 UMBRELLA
|
| 889 |
+
889 7 UNCLE
|
| 890 |
+
890 12 UNDERSTAND
|
| 891 |
+
891 2 UP
|
| 892 |
+
892 10 UP-TO-NOW
|
| 893 |
+
893 7 UPSET
|
| 894 |
+
894 28 USE
|
| 895 |
+
895 7 USE-SIGN-LANGUAGE
|
| 896 |
+
896 15 VACATION
|
| 897 |
+
897 9 VARY
|
| 898 |
+
898 8 VEGETABLE
|
| 899 |
+
899 3 VEGETABLE+AGENT
|
| 900 |
+
900 4 VERY
|
| 901 |
+
901 3 VERY-FAST
|
| 902 |
+
902 15 VIDEO-GAME
|
| 903 |
+
903 3 VIDEOTAPE
|
| 904 |
+
904 3 VISIT
|
| 905 |
+
905 26 VISUALIZE
|
| 906 |
+
906 59 VOICE
|
| 907 |
+
907 15 VOICE-RANGE
|
| 908 |
+
908 4 VOICE_2
|
| 909 |
+
909 16 VOLUNTEER/SHIRT
|
| 910 |
+
910 23 VOMIT/HATE
|
| 911 |
+
911 8 VOTE
|
| 912 |
+
912 5 WAIT
|
| 913 |
+
913 4 WALK
|
| 914 |
+
914 62 WANT
|
| 915 |
+
915 24 WANT+NEG
|
| 916 |
+
916 12 WARM
|
| 917 |
+
917 7 WARN
|
| 918 |
+
918 4 WATCH-TV
|
| 919 |
+
919 8 WATER
|
| 920 |
+
920 2 WATER+DCL:crvd-L"water
|
| 921 |
+
921 2 WATER+TUBING
|
| 922 |
+
922 12 WEATHER
|
| 923 |
+
923 11 WEDDING
|
| 924 |
+
924 2 WEEKEND
|
| 925 |
+
925 43 WHEN
|
| 926 |
+
926 69 WHERE
|
| 927 |
+
927 15 WHICH
|
| 928 |
+
928 140 WHO
|
| 929 |
+
929 191 WHY
|
| 930 |
+
930 6 WIDE
|
| 931 |
+
931 15 WIFE
|
| 932 |
+
932 16 WIN
|
| 933 |
+
933 8 WINDOW
|
| 934 |
+
934 72 WITH
|
| 935 |
+
935 6 WOMAN
|
| 936 |
+
936 2 WONDER
|
| 937 |
+
937 11 WORD
|
| 938 |
+
938 88 WORK
|
| 939 |
+
939 3 WORK-OUT
|
| 940 |
+
940 8 WORLD
|
| 941 |
+
941 41 WOW
|
| 942 |
+
942 25 WOW/AWFUL
|
| 943 |
+
943 2 WRESTLE
|
| 944 |
+
944 12 WRITE
|
| 945 |
+
945 14 WRONG
|
| 946 |
+
946 13 YEAR
|
| 947 |
+
947 11 YES
|
| 948 |
+
948 20 YESTERDAY
|
| 949 |
+
949 2 YOUNG
|
| 950 |
+
950 2 ZOOM
|
| 951 |
+
951 11 a
|
| 952 |
+
952 9 all
|
| 953 |
+
953 12 and
|
| 954 |
+
954 3 approaching
|
| 955 |
+
955 1 around
|
| 956 |
+
956 3 around"
|
| 957 |
+
957 2 at
|
| 958 |
+
958 2 back
|
| 959 |
+
959 1 below
|
| 960 |
+
960 4 big
|
| 961 |
+
961 2 book"
|
| 962 |
+
962 4 bowl"
|
| 963 |
+
963 1 bucket
|
| 964 |
+
964 7 bucket"
|
| 965 |
+
965 4 car"
|
| 966 |
+
966 3 chalkboard"
|
| 967 |
+
967 2 circle"
|
| 968 |
+
968 2 coming
|
| 969 |
+
969 3 coming"
|
| 970 |
+
970 7 control"
|
| 971 |
+
971 2 course"
|
| 972 |
+
972 3 cup"
|
| 973 |
+
973 4 deal"
|
| 974 |
+
974 2 do"
|
| 975 |
+
975 2 doll"
|
| 976 |
+
976 13 don't
|
| 977 |
+
977 1 down
|
| 978 |
+
978 4 down"
|
| 979 |
+
979 6 dyed
|
| 980 |
+
980 2 each
|
| 981 |
+
981 7 ear"
|
| 982 |
+
982 3 embarrassed"
|
| 983 |
+
983 5 envelope"
|
| 984 |
+
984 3 fast"
|
| 985 |
+
985 2 fish
|
| 986 |
+
986 2 fish"
|
| 987 |
+
987 6 flat"
|
| 988 |
+
988 2 flip
|
| 989 |
+
989 2 football"
|
| 990 |
+
990 2 for
|
| 991 |
+
991 2 forth"
|
| 992 |
+
992 7 from
|
| 993 |
+
993 5 fs-AT
|
| 994 |
+
994 3 fs-AUDIO
|
| 995 |
+
995 3 fs-AUDIOVOCAL
|
| 996 |
+
996 4 fs-BAGEL
|
| 997 |
+
997 2 fs-BE
|
| 998 |
+
998 28 fs-BEACH
|
| 999 |
+
999 4 fs-BONFIRE
|
| 1000 |
+
1000 6 fs-BRIDE
|
| 1001 |
+
1001 3 fs-BUBBLES
|
| 1002 |
+
1002 2 fs-BURP
|
| 1003 |
+
1003 4 fs-BY
|
| 1004 |
+
1004 2 fs-CANCER
|
| 1005 |
+
1005 3 fs-CARE
|
| 1006 |
+
1006 3 fs-CAREER
|
| 1007 |
+
1007 2 fs-CAUCUS
|
| 1008 |
+
1008 5 fs-CEREAL
|
| 1009 |
+
1009 2 fs-CLASS
|
| 1010 |
+
1010 3 fs-CLUB
|
| 1011 |
+
1011 4 fs-CODA
|
| 1012 |
+
1012 3 fs-COLLIDED
|
| 1013 |
+
1013 19 fs-CREAM
|
| 1014 |
+
1014 7 fs-CREAM+CHEESE
|
| 1015 |
+
1015 2 fs-CREAM+fs-CHEESE
|
| 1016 |
+
1016 4 fs-DAY
|
| 1017 |
+
1017 7 fs-DISORDER
|
| 1018 |
+
1018 2 fs-DVD
|
| 1019 |
+
1019 2 fs-ELECTION
|
| 1020 |
+
1020 10 fs-EVEN
|
| 1021 |
+
1021 2 fs-EXAM
|
| 1022 |
+
1022 2 fs-EXCESS
|
| 1023 |
+
1023 3 fs-FIELD
|
| 1024 |
+
1024 3 fs-FUN
|
| 1025 |
+
1025 2 fs-GLOBE
|
| 1026 |
+
1026 5 fs-GROOM
|
| 1027 |
+
1027 12 fs-GRUNT
|
| 1028 |
+
1028 3 fs-HEGEMONY
|
| 1029 |
+
1029 3 fs-HIT
|
| 1030 |
+
1030 2 fs-HORROR
|
| 1031 |
+
1031 2 fs-HUMAN
|
| 1032 |
+
1032 2 fs-IPOD
|
| 1033 |
+
1033 2 fs-KEY
|
| 1034 |
+
1034 4 fs-LAKE
|
| 1035 |
+
1035 36 fs-LATE
|
| 1036 |
+
1036 2 fs-LINK
|
| 1037 |
+
1037 3 fs-LIT
|
| 1038 |
+
1038 1 fs-LOCKER+BOX/ROOM
|
| 1039 |
+
1039 6 fs-LOTTERY
|
| 1040 |
+
1040 8 fs-LOX
|
| 1041 |
+
1041 3 fs-MALL
|
| 1042 |
+
1042 2 fs-MARATHON
|
| 1043 |
+
1043 4 fs-MENTOR
|
| 1044 |
+
1044 2 fs-MODEL
|
| 1045 |
+
1045 3 fs-MPH
|
| 1046 |
+
1046 2 fs-MUTE
|
| 1047 |
+
1047 4 fs-NASAL
|
| 1048 |
+
1048 3 fs-NOISE
|
| 1049 |
+
1049 2 fs-NOISY
|
| 1050 |
+
1050 2 fs-OCEAN
|
| 1051 |
+
1051 39 fs-OF
|
| 1052 |
+
1052 2 fs-OH
|
| 1053 |
+
1053 2 fs-OR
|
| 1054 |
+
1054 14 fs-ORIENTATION
|
| 1055 |
+
1055 2 fs-ORIENTED
|
| 1056 |
+
1056 2 fs-OWN
|
| 1057 |
+
1057 15 fs-PARK
|
| 1058 |
+
1058 2 fs-PC
|
| 1059 |
+
1059 2 fs-PISS
|
| 1060 |
+
1060 3 fs-PITCHED
|
| 1061 |
+
1061 3 fs-POP
|
| 1062 |
+
1062 2 fs-PROCTOR
|
| 1063 |
+
1063 2 fs-PUBLIC
|
| 1064 |
+
1064 6 fs-PUPPIES
|
| 1065 |
+
1065 2 fs-QUALITY
|
| 1066 |
+
1066 9 fs-RANGE
|
| 1067 |
+
1067 12 fs-RENT
|
| 1068 |
+
1068 2 fs-SANCTUARY
|
| 1069 |
+
1069 5 fs-SENSORY
|
| 1070 |
+
1070 2 fs-SMASHED
|
| 1071 |
+
1071 5 fs-SO
|
| 1072 |
+
1072 3 fs-SOUND
|
| 1073 |
+
1073 14 fs-SPEECH
|
| 1074 |
+
1074 3 fs-SPINACH
|
| 1075 |
+
1075 2 fs-STATUS
|
| 1076 |
+
1076 2 fs-STORM
|
| 1077 |
+
1077 3 fs-SUN
|
| 1078 |
+
1078 2 fs-SUSHI
|
| 1079 |
+
1079 2 fs-SYNTAX
|
| 1080 |
+
1080 3 fs-TACTILE
|
| 1081 |
+
1081 2 fs-TAX
|
| 1082 |
+
1082 2 fs-TEMPO
|
| 1083 |
+
1083 4 fs-TESTIMONIES
|
| 1084 |
+
1084 3 fs-TOO
|
| 1085 |
+
1085 2 fs-TRIP
|
| 1086 |
+
1086 6 fs-TRUCK
|
| 1087 |
+
1087 2 fs-TRY
|
| 1088 |
+
1088 3 fs-VOCAL
|
| 1089 |
+
1089 2 fs-WAS
|
| 1090 |
+
1090 2 fs-WASTE
|
| 1091 |
+
1091 5 galloping"
|
| 1092 |
+
1092 4 gesture"
|
| 1093 |
+
1093 24 go
|
| 1094 |
+
1094 2 growing-up"
|
| 1095 |
+
1095 1 grumble"
|
| 1096 |
+
1096 2 hair"
|
| 1097 |
+
1097 2 hey"
|
| 1098 |
+
1098 2 house"
|
| 1099 |
+
1099 5 in
|
| 1100 |
+
1100 7 in"
|
| 1101 |
+
1101 1 increasing
|
| 1102 |
+
1102 1 into
|
| 1103 |
+
1103 3 is"
|
| 1104 |
+
1104 5 it
|
| 1105 |
+
1105 4 it"
|
| 1106 |
+
1106 2 know
|
| 1107 |
+
1107 21 know"
|
| 1108 |
+
1108 3 land"
|
| 1109 |
+
1109 2 language"
|
| 1110 |
+
1110 2 levitating"
|
| 1111 |
+
1111 3 lifting"
|
| 1112 |
+
1112 2 like"
|
| 1113 |
+
1113 2 look
|
| 1114 |
+
1114 7 loop
|
| 1115 |
+
1115 4 lotion"
|
| 1116 |
+
1116 2 loudly"
|
| 1117 |
+
1117 2 man"
|
| 1118 |
+
1118 2 me"
|
| 1119 |
+
1119 4 more"
|
| 1120 |
+
1120 7 mouth
|
| 1121 |
+
1121 4 moving
|
| 1122 |
+
1122 6 my
|
| 1123 |
+
1123 2 natural
|
| 1124 |
+
1124 2 next
|
| 1125 |
+
1125 89 no"
|
| 1126 |
+
1126 1 noises"
|
| 1127 |
+
1127 2 ns-#AA
|
| 1128 |
+
1128 4 ns-#FLA
|
| 1129 |
+
1129 2 ns-#IBM
|
| 1130 |
+
1130 3 ns-#RIT
|
| 1131 |
+
1131 12 ns-#SD
|
| 1132 |
+
1132 2 ns-#TENN
|
| 1133 |
+
1133 30 ns-BOSTON
|
| 1134 |
+
1134 2 ns-BROOKLINE
|
| 1135 |
+
1135 5 ns-CHICAGO
|
| 1136 |
+
1136 7 ns-FRANCE
|
| 1137 |
+
1137 3 ns-GALLAUDET
|
| 1138 |
+
1138 2 ns-INDIA
|
| 1139 |
+
1139 2 ns-IRELAND
|
| 1140 |
+
1140 3 ns-MCDONALD
|
| 1141 |
+
1141 8 ns-NEW-YORK
|
| 1142 |
+
1142 3 ns-PHILADELPHIA
|
| 1143 |
+
1143 2 ns-PUERTO-RICO
|
| 1144 |
+
1144 5 ns-ROCHESTER
|
| 1145 |
+
1145 2 ns-fs-ALEC-BALDWIN
|
| 1146 |
+
1146 2 ns-fs-AMY
|
| 1147 |
+
1147 3 ns-fs-ASIA
|
| 1148 |
+
1148 2 ns-fs-BARACK-OBAMA
|
| 1149 |
+
1149 3 ns-fs-BAUMAN
|
| 1150 |
+
1150 2 ns-fs-BETH
|
| 1151 |
+
1151 7 ns-fs-BILL
|
| 1152 |
+
1152 72 ns-fs-BOB
|
| 1153 |
+
1153 2 ns-fs-BOSTON
|
| 1154 |
+
1154 3 ns-fs-BU
|
| 1155 |
+
1155 2 ns-fs-DEAN
|
| 1156 |
+
1156 8 ns-fs-DONNA
|
| 1157 |
+
1157 3 ns-fs-FEDEX
|
| 1158 |
+
1158 2 ns-fs-HARRY
|
| 1159 |
+
1159 13 ns-fs-JACK
|
| 1160 |
+
1160 3 ns-fs-JAMES
|
| 1161 |
+
1161 2 ns-fs-JEN
|
| 1162 |
+
1162 5 ns-fs-JESSICA
|
| 1163 |
+
1163 3 ns-fs-JIM
|
| 1164 |
+
1164 3 ns-fs-JOE
|
| 1165 |
+
1165 90 ns-fs-JOHN
|
| 1166 |
+
1166 2 ns-fs-LIZ
|
| 1167 |
+
1167 4 ns-fs-MAC
|
| 1168 |
+
1168 80 ns-fs-MARY
|
| 1169 |
+
1169 2 ns-fs-MITT-ROMNEY
|
| 1170 |
+
1170 2 ns-fs-NETFLIX
|
| 1171 |
+
1171 2 ns-fs-NEWTON
|
| 1172 |
+
1172 11 ns-fs-OBAMA
|
| 1173 |
+
1173 2 ns-fs-PAUL
|
| 1174 |
+
1174 3 ns-fs-PETE
|
| 1175 |
+
1175 3 ns-fs-PHIL
|
| 1176 |
+
1176 3 ns-fs-RICK-PERRY
|
| 1177 |
+
1177 2 ns-fs-SALLY
|
| 1178 |
+
1178 2 ns-fs-SARAH-JESSICA-PARKER
|
| 1179 |
+
1179 2 ns-fs-SARAH-PALIN
|
| 1180 |
+
1180 2 ns-fs-SAT
|
| 1181 |
+
1181 5 ns-fs-SUE
|
| 1182 |
+
1182 2 ns-nat-AUSTRALIA
|
| 1183 |
+
1183 26 of
|
| 1184 |
+
1184 3 off
|
| 1185 |
+
1185 4 off"
|
| 1186 |
+
1186 15 on
|
| 1187 |
+
1187 3 open
|
| 1188 |
+
1188 2 other"
|
| 1189 |
+
1189 2 out
|
| 1190 |
+
1190 9 out"
|
| 1191 |
+
1191 4 over
|
| 1192 |
+
1192 7 over"
|
| 1193 |
+
1193 7 pages"
|
| 1194 |
+
1194 5 paper
|
| 1195 |
+
1195 4 paper"
|
| 1196 |
+
1196 451 part:indef
|
| 1197 |
+
1197 7 passed
|
| 1198 |
+
1198 2 pathway"
|
| 1199 |
+
1199 7 people
|
| 1200 |
+
1200 2 popcorn
|
| 1201 |
+
1201 1 popcorn"
|
| 1202 |
+
1202 7 puppies"
|
| 1203 |
+
1203 8 range"
|
| 1204 |
+
1204 3 raquet"
|
| 1205 |
+
1205 2 rolling
|
| 1206 |
+
1206 5 running"
|
| 1207 |
+
1207 12 see"
|
| 1208 |
+
1208 2 set"
|
| 1209 |
+
1209 1 shoot"
|
| 1210 |
+
1210 2 sign
|
| 1211 |
+
1211 2 silly
|
| 1212 |
+
1212 2 sit
|
| 1213 |
+
1213 2 skipping
|
| 1214 |
+
1214 3 slowly"
|
| 1215 |
+
1215 2 staring"
|
| 1216 |
+
1216 2 string"
|
| 1217 |
+
1217 3 styrofoam
|
| 1218 |
+
1218 2 table"
|
| 1219 |
+
1219 2 tanning"
|
| 1220 |
+
1220 3 tennis
|
| 1221 |
+
1221 7 test"
|
| 1222 |
+
1222 21 the
|
| 1223 |
+
1223 2 them
|
| 1224 |
+
1224 2 there"
|
| 1225 |
+
1225 3 things"
|
| 1226 |
+
1226 17 to
|
| 1227 |
+
1227 25 together"
|
| 1228 |
+
1228 3 toilet
|
| 1229 |
+
1229 2 tract
|
| 1230 |
+
1230 2 tubing"
|
| 1231 |
+
1231 5 up
|
| 1232 |
+
1232 6 voice
|
| 1233 |
+
1233 1 voice"
|
| 1234 |
+
1234 2 walk
|
| 1235 |
+
1235 20 walking"
|
| 1236 |
+
1236 3 waste
|
| 1237 |
+
1237 5 waste"
|
| 1238 |
+
1238 2 water"
|
| 1239 |
+
1239 3 way
|
| 1240 |
+
1240 2 well"
|
| 1241 |
+
1241 2 what
|
| 1242 |
+
1242 2 with
|
| 1243 |
+
1243 2 words"
|
plugins/SignX/smkd/configs/youtubeasl.yaml
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_root: youtubeasl
|
| 2 |
+
dict_path: youtubeasl/gloss_dict.npy
|
| 3 |
+
evaluation_dir: ./evaluation/slr_eval
|
| 4 |
+
evaluation_prefix: youtubeasl-groundtruth
|
plugins/SignX/smkd/dataset/dataloader_video.py
CHANGED
|
@@ -27,7 +27,9 @@ sys.path.append("..")
|
|
| 27 |
|
| 28 |
class BaseFeeder(data.Dataset):
|
| 29 |
def __init__(self, prefix, gloss_dict, drop_ratio=1, num_gloss=-1, mode="train", transform_mode=True,
|
| 30 |
-
datatype="lmdb", skip_ids=None, c2d_type=None
|
|
|
|
|
|
|
| 31 |
self.mode = mode
|
| 32 |
self.ng = num_gloss
|
| 33 |
self.prefix = prefix
|
|
@@ -35,6 +37,13 @@ class BaseFeeder(data.Dataset):
|
|
| 35 |
self.data_type = datatype
|
| 36 |
self.transform_mode = "train" if transform_mode else "test"
|
| 37 |
self.c2d_type = c2d_type # 用于确定归一化方式
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
self.inputs_list = np.load(f"{prefix}/{mode}_info.npy", allow_pickle=True).item()
|
| 39 |
self.skip_ids = skip_ids if isinstance(skip_ids, set) else set(skip_ids or [])
|
| 40 |
self.sample_indices = self._build_sample_indices()
|
|
@@ -48,14 +57,37 @@ class BaseFeeder(data.Dataset):
|
|
| 48 |
print("")
|
| 49 |
|
| 50 |
def __getitem__(self, idx):
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
input_data, label = self.normalize(input_data, label)
|
| 55 |
-
|
|
|
|
| 56 |
return input_data, torch.LongTensor(label), self.inputs_list[real_idx]['original_info']
|
| 57 |
-
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
def read_video(self, index, num_glosses=-1):
|
| 61 |
# load file info
|
|
@@ -86,6 +118,12 @@ class BaseFeeder(data.Dataset):
|
|
| 86 |
|
| 87 |
# load next frame
|
| 88 |
success, img = vidcap.read()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
|
| 90 |
for phase in fi['label'].split(" "):
|
| 91 |
if phase == '':
|
|
@@ -94,14 +132,36 @@ class BaseFeeder(data.Dataset):
|
|
| 94 |
label_list.append(self.dict[phase][0])
|
| 95 |
|
| 96 |
if len(img_features) == 0:
|
|
|
|
|
|
|
| 97 |
img_features = [np.zeros((256, 256, 3))]
|
| 98 |
if len(label_list) == 0:
|
| 99 |
label_list = [0]
|
| 100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
return img_features, label_list, fi
|
| 102 |
|
| 103 |
def normalize(self, video, label, file_id=None):
|
| 104 |
video, label = self.data_aug(video, label, file_id)
|
|
|
|
|
|
|
| 105 |
|
| 106 |
# 根据backbone类型选择归一化方式
|
| 107 |
if self.c2d_type and ('dino' in self.c2d_type.lower() or 'vit' in self.c2d_type.lower()):
|
|
@@ -116,15 +176,38 @@ class BaseFeeder(data.Dataset):
|
|
| 116 |
|
| 117 |
return video, label
|
| 118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
def transform(self):
|
| 120 |
if self.transform_mode == "train":
|
| 121 |
print("Apply training transform.")
|
| 122 |
-
|
| 123 |
video_augmentation.RandomCrop(224),
|
| 124 |
video_augmentation.RandomHorizontalFlip(0.5),
|
| 125 |
video_augmentation.ToTensor(),
|
| 126 |
-
|
| 127 |
-
|
|
|
|
|
|
|
| 128 |
else:
|
| 129 |
print("Apply testing transform.")
|
| 130 |
return video_augmentation.Compose([
|
|
|
|
| 27 |
|
| 28 |
class BaseFeeder(data.Dataset):
|
| 29 |
def __init__(self, prefix, gloss_dict, drop_ratio=1, num_gloss=-1, mode="train", transform_mode=True,
|
| 30 |
+
datatype="lmdb", skip_ids=None, c2d_type=None, max_frames=-1, ctc_length_guard=True,
|
| 31 |
+
skip_on_decode_failure=False, min_frames=0, skip_on_black_frames=False, temporal_rescale=0.2,
|
| 32 |
+
ctc_length_guard_post=True):
|
| 33 |
self.mode = mode
|
| 34 |
self.ng = num_gloss
|
| 35 |
self.prefix = prefix
|
|
|
|
| 37 |
self.data_type = datatype
|
| 38 |
self.transform_mode = "train" if transform_mode else "test"
|
| 39 |
self.c2d_type = c2d_type # 用于确定归一化方式
|
| 40 |
+
self.max_frames = max_frames
|
| 41 |
+
self.ctc_length_guard = ctc_length_guard
|
| 42 |
+
self.skip_on_decode_failure = skip_on_decode_failure
|
| 43 |
+
self.min_frames = min_frames
|
| 44 |
+
self.skip_on_black_frames = skip_on_black_frames
|
| 45 |
+
self.temporal_rescale = temporal_rescale
|
| 46 |
+
self.ctc_length_guard_post = ctc_length_guard_post
|
| 47 |
self.inputs_list = np.load(f"{prefix}/{mode}_info.npy", allow_pickle=True).item()
|
| 48 |
self.skip_ids = skip_ids if isinstance(skip_ids, set) else set(skip_ids or [])
|
| 49 |
self.sample_indices = self._build_sample_indices()
|
|
|
|
| 57 |
print("")
|
| 58 |
|
| 59 |
def __getitem__(self, idx):
|
| 60 |
+
if self.data_type != "video":
|
| 61 |
+
raise ValueError(f"Not supported: {self.data_type}")
|
| 62 |
+
|
| 63 |
+
retries = 20 if self.skip_on_decode_failure else 1
|
| 64 |
+
last_err = None
|
| 65 |
+
skipped_ids = []
|
| 66 |
+
for attempt in range(retries):
|
| 67 |
+
if attempt == 0:
|
| 68 |
+
real_idx = self.sample_indices[idx % len(self.sample_indices)]
|
| 69 |
+
else:
|
| 70 |
+
real_idx = self.sample_indices[np.random.randint(0, len(self.sample_indices))]
|
| 71 |
+
try:
|
| 72 |
+
input_data, label, fi = self.read_video(real_idx)
|
| 73 |
+
except ValueError as e:
|
| 74 |
+
if self.skip_on_decode_failure and str(e).startswith("decode_failed:"):
|
| 75 |
+
last_err = e
|
| 76 |
+
sid = str(e).split("decode_failed:", 1)[-1]
|
| 77 |
+
if sid:
|
| 78 |
+
skipped_ids.append(sid)
|
| 79 |
+
continue
|
| 80 |
+
raise
|
| 81 |
input_data, label = self.normalize(input_data, label)
|
| 82 |
+
if skipped_ids:
|
| 83 |
+
print(f"[BaseFeeder] Skipped {len(skipped_ids)} decode-failed sample(s): {', '.join(skipped_ids)}")
|
| 84 |
return input_data, torch.LongTensor(label), self.inputs_list[real_idx]['original_info']
|
| 85 |
+
|
| 86 |
+
if last_err is not None:
|
| 87 |
+
if skipped_ids:
|
| 88 |
+
print(f"[BaseFeeder] Skipped {len(skipped_ids)} decode-failed sample(s) and exhausted retries: {', '.join(skipped_ids)}")
|
| 89 |
+
raise last_err
|
| 90 |
+
raise ValueError("Failed to load sample")
|
| 91 |
|
| 92 |
def read_video(self, index, num_glosses=-1):
|
| 93 |
# load file info
|
|
|
|
| 118 |
|
| 119 |
# load next frame
|
| 120 |
success, img = vidcap.read()
|
| 121 |
+
vidcap.release()
|
| 122 |
+
|
| 123 |
+
# Uniformly sample to a fixed maximum length for stability.
|
| 124 |
+
if self.max_frames is not None and self.max_frames > 0 and len(img_features) > self.max_frames:
|
| 125 |
+
idx = np.linspace(0, len(img_features) - 1, self.max_frames, dtype=int)
|
| 126 |
+
img_features = [img_features[i] for i in idx]
|
| 127 |
|
| 128 |
for phase in fi['label'].split(" "):
|
| 129 |
if phase == '':
|
|
|
|
| 132 |
label_list.append(self.dict[phase][0])
|
| 133 |
|
| 134 |
if len(img_features) == 0:
|
| 135 |
+
if self.skip_on_decode_failure:
|
| 136 |
+
raise ValueError(f"decode_failed:{fi.get('fileid','unknown')}")
|
| 137 |
img_features = [np.zeros((256, 256, 3))]
|
| 138 |
if len(label_list) == 0:
|
| 139 |
label_list = [0]
|
| 140 |
|
| 141 |
+
# Skip extremely short clips if requested.
|
| 142 |
+
if self.min_frames and len(img_features) < self.min_frames:
|
| 143 |
+
if self.skip_on_decode_failure:
|
| 144 |
+
raise ValueError(f"decode_failed:{fi.get('fileid','unknown')}")
|
| 145 |
+
|
| 146 |
+
# Skip all-black clips if requested.
|
| 147 |
+
if self.skip_on_black_frames:
|
| 148 |
+
try:
|
| 149 |
+
frame_mean = float(np.mean(img_features[0]))
|
| 150 |
+
except Exception:
|
| 151 |
+
frame_mean = 0.0
|
| 152 |
+
if frame_mean < 1.0: # near-black frame
|
| 153 |
+
if self.skip_on_decode_failure:
|
| 154 |
+
raise ValueError(f"decode_failed:{fi.get('fileid','unknown')}")
|
| 155 |
+
|
| 156 |
+
if self.ctc_length_guard and not self.ctc_length_guard_post:
|
| 157 |
+
img_features = self._ensure_ctc_length(img_features, label_list)
|
| 158 |
+
|
| 159 |
return img_features, label_list, fi
|
| 160 |
|
| 161 |
def normalize(self, video, label, file_id=None):
|
| 162 |
video, label = self.data_aug(video, label, file_id)
|
| 163 |
+
if self.ctc_length_guard and self.ctc_length_guard_post:
|
| 164 |
+
video = self._ensure_ctc_length(video, label)
|
| 165 |
|
| 166 |
# 根据backbone类型选择归一化方式
|
| 167 |
if self.c2d_type and ('dino' in self.c2d_type.lower() or 'vit' in self.c2d_type.lower()):
|
|
|
|
| 176 |
|
| 177 |
return video, label
|
| 178 |
|
| 179 |
+
def _ensure_ctc_length(self, video, label):
|
| 180 |
+
# Ensure temporal length is long enough for CTC after TemporalConv (conv_type=2).
|
| 181 |
+
# Roughly require input_len >= 4 * label_len + 12.
|
| 182 |
+
if not label:
|
| 183 |
+
return video
|
| 184 |
+
min_required = 4 * len(label) + 12
|
| 185 |
+
if min_required <= 0:
|
| 186 |
+
return video
|
| 187 |
+
if isinstance(video, torch.Tensor):
|
| 188 |
+
t = video.shape[0]
|
| 189 |
+
if t == 0 or t >= min_required:
|
| 190 |
+
return video
|
| 191 |
+
idx = torch.linspace(0, t - 1, steps=min_required, device=video.device)
|
| 192 |
+
idx = torch.clamp(idx.round().long(), 0, t - 1)
|
| 193 |
+
return video.index_select(0, idx)
|
| 194 |
+
t = len(video)
|
| 195 |
+
if t == 0 or t >= min_required:
|
| 196 |
+
return video
|
| 197 |
+
idx = np.linspace(0, t - 1, min_required, dtype=int)
|
| 198 |
+
return [video[i] for i in idx]
|
| 199 |
+
|
| 200 |
def transform(self):
|
| 201 |
if self.transform_mode == "train":
|
| 202 |
print("Apply training transform.")
|
| 203 |
+
transforms = [
|
| 204 |
video_augmentation.RandomCrop(224),
|
| 205 |
video_augmentation.RandomHorizontalFlip(0.5),
|
| 206 |
video_augmentation.ToTensor(),
|
| 207 |
+
]
|
| 208 |
+
if self.temporal_rescale and self.temporal_rescale > 0:
|
| 209 |
+
transforms.append(video_augmentation.TemporalRescale(self.temporal_rescale))
|
| 210 |
+
return video_augmentation.Compose(transforms)
|
| 211 |
else:
|
| 212 |
print("Apply testing transform.")
|
| 213 |
return video_augmentation.Compose([
|
plugins/SignX/smkd/evaluation/slr_eval/wer_calculation.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import os
|
|
|
|
| 2 |
from .python_wer_evaluation import wer_calculation
|
| 3 |
|
| 4 |
|
|
@@ -36,10 +37,12 @@ def evaluate(prefix="./", mode="dev", evaluate_dir=None, dataset_dir=None, evalu
|
|
| 36 |
f"{sclite_path} -h {prefix}out.{output_file} ctm"
|
| 37 |
f" -r {prefix}tmp.stm stm -f 0 -o sgml sum rsum pra"
|
| 38 |
)
|
| 39 |
-
ret =
|
| 40 |
f"{sclite_path} -h {prefix}out.{output_file} ctm "
|
| 41 |
-
f"-r {prefix}tmp.stm stm -f 0 -o dtl stdout |grep Error"
|
| 42 |
-
|
|
|
|
|
|
|
| 43 |
return float(ret.split("=")[1].split("%")[0])
|
| 44 |
|
| 45 |
|
|
|
|
| 1 |
import os
|
| 2 |
+
import subprocess
|
| 3 |
from .python_wer_evaluation import wer_calculation
|
| 4 |
|
| 5 |
|
|
|
|
| 37 |
f"{sclite_path} -h {prefix}out.{output_file} ctm"
|
| 38 |
f" -r {prefix}tmp.stm stm -f 0 -o sgml sum rsum pra"
|
| 39 |
)
|
| 40 |
+
ret = subprocess.check_output(
|
| 41 |
f"{sclite_path} -h {prefix}out.{output_file} ctm "
|
| 42 |
+
f"-r {prefix}tmp.stm stm -f 0 -o dtl stdout |grep Error",
|
| 43 |
+
shell=True,
|
| 44 |
+
text=True
|
| 45 |
+
).splitlines()[0]
|
| 46 |
return float(ret.split("=")[1].split("%")[0])
|
| 47 |
|
| 48 |
|
plugins/SignX/smkd/seq_scripts.py
CHANGED
|
@@ -208,11 +208,11 @@ def seq_feature_generation(loader, model, device, mode, recoder, is_master=True)
|
|
| 208 |
|
| 209 |
|
| 210 |
def write2file(path, info, output):
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
|
|
|
| 208 |
|
| 209 |
|
| 210 |
def write2file(path, info, output):
|
| 211 |
+
with open(path, "w") as filereader:
|
| 212 |
+
for sample_idx, sample in enumerate(output):
|
| 213 |
+
for word_idx, word in enumerate(sample):
|
| 214 |
+
filereader.writelines(
|
| 215 |
+
"{} 1 {:.2f} {:.2f} {}\n".format(info[sample_idx],
|
| 216 |
+
word_idx * 1.0 / 100,
|
| 217 |
+
(word_idx + 1) * 1.0 / 100,
|
| 218 |
+
word[0]))
|
plugins/SignX/training_yutubeasl/ENVIRONMENT_SETUP.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 环境设置说明
|
| 2 |
+
|
| 3 |
+
## 为什么需要两个环境?
|
| 4 |
+
|
| 5 |
+
SLTUNET 项目由**两个独立组件**组成,使用不同的深度学习框架:
|
| 6 |
+
|
| 7 |
+
1. **SMKD** (步骤2-3) - 从视频提取特征
|
| 8 |
+
- 框架:**PyTorch**
|
| 9 |
+
- 文件:`smkd/` 目录下的代码
|
| 10 |
+
- 用途:训练 ResNet34 提取 1024 维特征
|
| 11 |
+
|
| 12 |
+
2. **SLTUNET** (步骤4) - 翻译模型
|
| 13 |
+
- 框架:**TensorFlow 1.15**
|
| 14 |
+
- 文件:根目录下的 `main.py`, `sltunet.py` 等
|
| 15 |
+
- 用途:sign-to-gloss 翻译
|
| 16 |
+
|
| 17 |
+
**问题:** TensorFlow 1.15 和现代 PyTorch 的 CUDA 依赖冲突,无法在同一环境中共存。
|
| 18 |
+
|
| 19 |
+
## 解决方案:两个 Conda 环境
|
| 20 |
+
|
| 21 |
+
### 环境1:smkd_pytorch (用于步骤 2-3)
|
| 22 |
+
|
| 23 |
+
```bash
|
| 24 |
+
# 创建环境
|
| 25 |
+
conda create -n smkd_pytorch python=3.8 -y
|
| 26 |
+
conda activate smkd_pytorch
|
| 27 |
+
|
| 28 |
+
# 安装 PyTorch (CUDA 11.8)
|
| 29 |
+
pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 \
|
| 30 |
+
--index-url https://download.pytorch.org/whl/cu118
|
| 31 |
+
|
| 32 |
+
# 安装其他依赖
|
| 33 |
+
pip install pyyaml tqdm h5py opencv-python pillow numpy
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
### 环境2:slt_tf1 (用于步骤 1, 4) - 已存在
|
| 37 |
+
|
| 38 |
+
```bash
|
| 39 |
+
# 你已经创建了这个环境
|
| 40 |
+
conda activate slt_tf1
|
| 41 |
+
# 包含 TensorFlow 1.15
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
## 训练流程(使用正确的环境)
|
| 45 |
+
|
| 46 |
+
### 步骤 1:数据预处理 (任意环境)
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
conda activate slt_tf1 # 或 signx-slt
|
| 50 |
+
cd training_yutubeasl/scripts
|
| 51 |
+
python 1_preprocess.py
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
### 步骤 2:训练 SMKD (⚠️ 需要 PyTorch)
|
| 55 |
+
|
| 56 |
+
```bash
|
| 57 |
+
conda activate signx-slt # ← 使用 PyTorch 环境
|
| 58 |
+
cd training_yutubeasl/scripts
|
| 59 |
+
bash 2_train_smkd.sh
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
### 步骤 3:提取特征 (⚠️ 需要 PyTorch)
|
| 63 |
+
|
| 64 |
+
```bash
|
| 65 |
+
conda activate signx-slt # ← 保持 PyTorch 环境
|
| 66 |
+
bash 3_extract_features.sh
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
### 步骤 4:训练 SLTUNET (⚠️ 需要 TensorFlow)
|
| 70 |
+
|
| 71 |
+
```bash
|
| 72 |
+
conda activate slt_tf1 # ← 切换到 TensorFlow 环境
|
| 73 |
+
bash 4_train_sltunet.sh
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
## 快速设置脚本
|
| 77 |
+
|
| 78 |
+
运行这个脚本自动创建 PyTorch 环境:
|
| 79 |
+
|
| 80 |
+
```bash
|
| 81 |
+
conda create -n smkd_pytorch python=3.8 -y && \
|
| 82 |
+
conda run -n smkd_pytorch pip install \
|
| 83 |
+
torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 \
|
| 84 |
+
--index-url https://download.pytorch.org/whl/cu118 && \
|
| 85 |
+
conda run -n smkd_pytorch pip install \
|
| 86 |
+
pyyaml tqdm h5py opencv-python pillow numpy
|
| 87 |
+
|
| 88 |
+
echo "✓ smkd_pytorch 环境创建完成"
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
## 为什么 README.md 没说需要 PyTorch?
|
| 92 |
+
|
| 93 |
+
README.md 只描述了 SLTUNET 主模型的要求(TensorFlow 1.15)。
|
| 94 |
+
|
| 95 |
+
SMKD 是一个**独立的 PyTorch 项目**,被集成到这个 repo 中用于特征提取。原作者可能假设用户会查看 `smkd/` 目录下的代码来了解其依赖。
|
| 96 |
+
|
| 97 |
+
## 总结
|
| 98 |
+
|
| 99 |
+
| 步骤 | 环境 | 框架 | 用途 |
|
| 100 |
+
|------|------|------|------|
|
| 101 |
+
| 1. 预处理 | 任意 | - | 生成元数据 |
|
| 102 |
+
| 2. 训练SMKD | `smkd_pytorch` | PyTorch | 特征提取器 |
|
| 103 |
+
| 3. 提取特征 | `smkd_pytorch` | PyTorch | 生成.h5文件 |
|
| 104 |
+
| 4. 训练SLTUNET | `slt_tf1` | TensorFlow 1.15 | 翻译模型 |
|
| 105 |
+
|
| 106 |
+
**现在你需要创建 `smkd_pytorch` 环境,然后重新运行步骤2!**
|
plugins/SignX/training_yutubeasl/QUICK_START.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 🚀 YouTubeASL 训练 - 快速开始
|
| 2 |
+
|
| 3 |
+
## 一键运行(使用你现有的环境)
|
| 4 |
+
|
| 5 |
+
### 步骤1:数据预处理 ✅ (已完成)
|
| 6 |
+
|
| 7 |
+
已经生成:
|
| 8 |
+
- ✅ 1686 训练样本
|
| 9 |
+
- ✅ 210 验证样本
|
| 10 |
+
- ✅ 212 测试样本
|
| 11 |
+
- ✅ 1243 gloss 词汇
|
| 12 |
+
|
| 13 |
+
### 步骤2:训练 SMKD (几小时)
|
| 14 |
+
|
| 15 |
+
```bash
|
| 16 |
+
# 使用 signx-slt 环境(已有 PyTorch 2.4.1)
|
| 17 |
+
conda activate signx-slt
|
| 18 |
+
|
| 19 |
+
cd ~/code/Sign-X/output/huggingface_youtubeasl_repo/slt_new_new/training_yutubeasl/scripts
|
| 20 |
+
|
| 21 |
+
bash 2_train_smkd.sh
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
### 步骤3:提取特征 (1小时)
|
| 25 |
+
|
| 26 |
+
```bash
|
| 27 |
+
# 保持在 signx-slt 环境
|
| 28 |
+
bash 3_extract_features.sh
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
### 步骤4:训练 SLTUNET (1天)
|
| 32 |
+
|
| 33 |
+
```bash
|
| 34 |
+
# 切换到 TensorFlow 环境
|
| 35 |
+
conda activate slt_tf1
|
| 36 |
+
|
| 37 |
+
# 先准备文本数据(见下文)
|
| 38 |
+
# 然后运行
|
| 39 |
+
bash 4_train_sltunet.sh
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
## 为什么需要两个环境?
|
| 43 |
+
|
| 44 |
+
- **SMKD (步骤2-3)**: 使用 PyTorch → 用 `signx-slt` 环境
|
| 45 |
+
- **SLTUNET (步骤4)**: 使用 TensorFlow 1.15 → 用 `slt_tf1` 环境
|
| 46 |
+
|
| 47 |
+
详细说明见 `ENVIRONMENT_SETUP.md`
|
| 48 |
+
|
| 49 |
+
## 现在开始训练!
|
| 50 |
+
|
| 51 |
+
```bash
|
| 52 |
+
conda activate signx-slt
|
| 53 |
+
cd ~/code/Sign-X/output/huggingface_youtubeasl_repo/slt_new_new/training_yutubeasl/scripts
|
| 54 |
+
bash 2_train_smkd.sh
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
训练大约需要几小时,请耐心等待。你可以用 `nvidia-smi` 监控 GPU 使用情况。
|
| 58 |
+
|
| 59 |
+
## 需要帮助?
|
| 60 |
+
|
| 61 |
+
查看 `docs/QUICKSTART.md` 获取详细说明。
|
plugins/SignX/training_yutubeasl/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YouTubeASL Training Scripts and Documentation
|
| 2 |
+
|
| 3 |
+
This directory contains all scripts and documentation for training SLTUNET on the YouTubeASL dataset.
|
| 4 |
+
|
| 5 |
+
## Directory Structure
|
| 6 |
+
|
| 7 |
+
```
|
| 8 |
+
training_yutubeasl/
|
| 9 |
+
├── README.md # This file
|
| 10 |
+
├── scripts/
|
| 11 |
+
│ ├── 1_preprocess.py # Step 1: Data preprocessing
|
| 12 |
+
│ ├── 2_train_smkd.sh # Step 2: SMKD feature extraction training
|
| 13 |
+
│ ├── 3_extract_features.sh # Step 3: Extract features from trained SMKD
|
| 14 |
+
│ └── 4_train_sltunet.sh # Step 4: Train SLTUNET model
|
| 15 |
+
├── configs/
|
| 16 |
+
│ ├── youtubeasl_smkd.yaml # SMKD training config
|
| 17 |
+
│ └── youtubeasl_dataset.yaml # Dataset config for SMKD
|
| 18 |
+
└── docs/
|
| 19 |
+
├── QUICKSTART.md # Quick start guide (Chinese)
|
| 20 |
+
└── TUTORIAL.md # Detailed tutorial (English)
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
## Quick Start
|
| 24 |
+
|
| 25 |
+
```bash
|
| 26 |
+
cd training_yutubeasl/scripts
|
| 27 |
+
|
| 28 |
+
# Step 1: Preprocess data
|
| 29 |
+
python 1_preprocess.py
|
| 30 |
+
|
| 31 |
+
# Step 2: Train SMKD
|
| 32 |
+
bash 2_train_smkd.sh
|
| 33 |
+
|
| 34 |
+
# Step 3: Extract features
|
| 35 |
+
bash 3_extract_features.sh
|
| 36 |
+
|
| 37 |
+
# Step 4: Train SLTUNET
|
| 38 |
+
bash 4_train_sltunet.sh
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
See `docs/QUICKSTART.md` for detailed instructions.
|
plugins/SignX/training_yutubeasl/START_HERE.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 🎯 从这里开始 - YouTubeASL训练
|
| 2 |
+
|
| 3 |
+
## 📂 文件夹已整理完成!
|
| 4 |
+
|
| 5 |
+
所有YouTubeASL训练相关的文件都已经整理到这个文件夹中。
|
| 6 |
+
|
| 7 |
+
```
|
| 8 |
+
training_yutubeasl/ ← 你在这里
|
| 9 |
+
├── START_HERE.md ← 📍 本文件(快速导航)
|
| 10 |
+
├── run_all.sh ← 🚀 一键运行完整pipeline
|
| 11 |
+
├── README.md ← 📖 目录说明
|
| 12 |
+
│
|
| 13 |
+
├── scripts/ ← 📜 训练脚本(按顺序)
|
| 14 |
+
│ ├── 1_preprocess.py
|
| 15 |
+
│ ├── 2_train_smkd.sh
|
| 16 |
+
│ ├── 3_extract_features.sh
|
| 17 |
+
│ └── 4_train_sltunet.sh
|
| 18 |
+
│
|
| 19 |
+
├── configs/ ← ⚙️ 配置文件
|
| 20 |
+
│ ├── youtubeasl_smkd.yaml
|
| 21 |
+
│ └── youtubeasl_dataset.yaml
|
| 22 |
+
│
|
| 23 |
+
└── docs/ ← 📚 文档
|
| 24 |
+
├── QUICKSTART.md ← ⭐ 快速开始(中文)
|
| 25 |
+
└── TUTORIAL.md ← 📖 详细教程(英文)
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
## 🚀 三种使用方式
|
| 29 |
+
|
| 30 |
+
### 方式1:一键运行(最简单)
|
| 31 |
+
|
| 32 |
+
```bash
|
| 33 |
+
cd /research/cbim/vast/sf895/code/Sign-X/output/huggingface_youtubeasl_repo/slt_new_new/training_yutubeasl
|
| 34 |
+
bash run_all.sh
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
### 方式2:分步运行(推荐调试)
|
| 38 |
+
|
| 39 |
+
```bash
|
| 40 |
+
cd scripts
|
| 41 |
+
|
| 42 |
+
# 步骤1
|
| 43 |
+
python 1_preprocess.py
|
| 44 |
+
|
| 45 |
+
# 步骤2
|
| 46 |
+
bash 2_train_smkd.sh
|
| 47 |
+
|
| 48 |
+
# 步骤3
|
| 49 |
+
bash 3_extract_features.sh
|
| 50 |
+
|
| 51 |
+
# 步骤4(需要先准备文本数据)
|
| 52 |
+
bash 4_train_sltunet.sh
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
### 方式3:手动运行(完全控制)
|
| 56 |
+
|
| 57 |
+
查看 `docs/TUTORIAL.md` 获取每一步的详细命令。
|
| 58 |
+
|
| 59 |
+
## 📖 下一步阅读什么?
|
| 60 |
+
|
| 61 |
+
1. **新手?** → 先看 `docs/QUICKSTART.md`
|
| 62 |
+
2. **想了解细节?** → 看 `docs/TUTORIAL.md`
|
| 63 |
+
3. **遇到问题?** → `docs/QUICKSTART.md` 有故障排查
|
| 64 |
+
4. **想调参数?** → 看 `configs/` 文件夹
|
| 65 |
+
|
| 66 |
+
## ✅ 已经为你做的事情
|
| 67 |
+
|
| 68 |
+
- ✅ 整理了所有训练脚本到 `scripts/`
|
| 69 |
+
- ✅ 整理了所有配置文件到 `configs/`
|
| 70 |
+
- ✅ 整理了所有文档到 `docs/`
|
| 71 |
+
- ✅ 创建了主入口脚本 `run_all.sh`
|
| 72 |
+
- ✅ 更新了所有路径引用(无需修改)
|
| 73 |
+
- ✅ 添加了详细的中文说明
|
| 74 |
+
|
| 75 |
+
## 🎓 训练流程概览
|
| 76 |
+
|
| 77 |
+
```
|
| 78 |
+
原始数据
|
| 79 |
+
↓
|
| 80 |
+
[1_preprocess.py] → 生成训练元数据
|
| 81 |
+
↓
|
| 82 |
+
[2_train_smkd.sh] → 训练特征提取器(几小时)
|
| 83 |
+
↓
|
| 84 |
+
[3_extract_features.sh] → 提取1024维特征
|
| 85 |
+
↓
|
| 86 |
+
[准备文本数据] → BPE分词(手动)
|
| 87 |
+
↓
|
| 88 |
+
[4_train_sltunet.sh] → 训练翻译模型(1天)
|
| 89 |
+
↓
|
| 90 |
+
完成!
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
## ⚡ 快速测试
|
| 94 |
+
|
| 95 |
+
想快速测试是否一切正常?
|
| 96 |
+
|
| 97 |
+
```bash
|
| 98 |
+
cd scripts
|
| 99 |
+
python 1_preprocess.py --help # 应该显示帮助信息
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
## 🆘 需要帮助?
|
| 103 |
+
|
| 104 |
+
- 查看 `docs/QUICKSTART.md` 的 "常见问题" 部分
|
| 105 |
+
- 检查 `configs/` 中的参数设置
|
| 106 |
+
- 确保GPU可用:`nvidia-smi`
|
| 107 |
+
|
| 108 |
+
## 🎉 准备好了吗?
|
| 109 |
+
|
| 110 |
+
```bash
|
| 111 |
+
# 开始吧!
|
| 112 |
+
bash run_all.sh
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
祝训练顺利!🚀
|
plugins/SignX/training_yutubeasl/configs/youtubeasl_dataset.yaml
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
dataset_root: youtubeasl
|
| 2 |
+
dict_path: youtubeasl/gloss_dict.npy
|
| 3 |
+
evaluation_dir: ./evaluation/slr_eval
|
| 4 |
+
evaluation_prefix: youtubeasl-groundtruth
|
plugins/SignX/training_yutubeasl/configs/youtubeasl_smkd.yaml
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
feeder: dataset.dataloader_video.BaseFeeder
|
| 2 |
+
phase: train
|
| 3 |
+
dataset: youtubeasl
|
| 4 |
+
num_epoch: 120
|
| 5 |
+
work_dir: ./work_dir/youtubeasl_baseline/
|
| 6 |
+
batch_size: 2
|
| 7 |
+
random_seed: 0
|
| 8 |
+
test_batch_size: 8
|
| 9 |
+
num_worker: 4
|
| 10 |
+
device: 0
|
| 11 |
+
log_interval: 50
|
| 12 |
+
eval_interval: 1
|
| 13 |
+
save_interval: 1
|
| 14 |
+
evaluate_tool: sclite
|
| 15 |
+
num_feature_aug: 10
|
| 16 |
+
loss_weights:
|
| 17 |
+
SeqCTC: 1.0
|
| 18 |
+
ConvCTC: 1.0
|
| 19 |
+
Dist: 10.0
|
| 20 |
+
|
| 21 |
+
optimizer_args:
|
| 22 |
+
optimizer: Adam
|
| 23 |
+
base_lr: 0.0001
|
| 24 |
+
step: [ 20, 35]
|
| 25 |
+
learning_ratio: 1
|
| 26 |
+
weight_decay: 0.0001
|
| 27 |
+
start_epoch: 0
|
| 28 |
+
nesterov: False
|
| 29 |
+
|
| 30 |
+
feeder_args:
|
| 31 |
+
mode: 'train'
|
| 32 |
+
datatype: 'video'
|
| 33 |
+
num_gloss: -1
|
| 34 |
+
drop_ratio: 1.0
|
| 35 |
+
ctc_length_guard: true
|
| 36 |
+
ctc_length_guard_post: true
|
| 37 |
+
max_frames: -1
|
| 38 |
+
skip_on_decode_failure: true
|
| 39 |
+
min_frames: 5
|
| 40 |
+
skip_on_black_frames: true
|
| 41 |
+
temporal_rescale: 0.2
|
| 42 |
+
|
| 43 |
+
model: slr_network.SLRModel
|
| 44 |
+
decode_mode: max
|
| 45 |
+
model_args:
|
| 46 |
+
num_classes: 1296
|
| 47 |
+
c2d_type: resnet34
|
| 48 |
+
conv_type: 2
|
| 49 |
+
use_bn: 1
|
| 50 |
+
share_classifier: True
|
| 51 |
+
weight_norm: True
|
plugins/SignX/training_yutubeasl/docs/QUICKSTART.md
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YouTubeASL SLTUNET 训练快速开始指南
|
| 2 |
+
|
| 3 |
+
## 概述
|
| 4 |
+
|
| 5 |
+
本项目**完全按照 SLTUNET 原始方法**在 YouTubeASL 数据集上训练手语翻译模型。
|
| 6 |
+
|
| 7 |
+
**不修改任何模型代码**,只做数据预处理适配。
|
| 8 |
+
|
| 9 |
+
## 训练流程
|
| 10 |
+
|
| 11 |
+
### 第一步:数据预处理 (5分钟)
|
| 12 |
+
|
| 13 |
+
```bash
|
| 14 |
+
cd /research/cbim/vast/sf895/code/Sign-X/output/huggingface_youtubeasl_repo/slt_new_new
|
| 15 |
+
|
| 16 |
+
python 1_preprocess.py
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
这将生成:
|
| 20 |
+
- `smkd/youtubeasl/train_info.npy` - 训练集元数据 (~1684 样本)
|
| 21 |
+
- `smkd/youtubeasl/dev_info.npy` - 验证集元数据 (~210 样本)
|
| 22 |
+
- `smkd/youtubeasl/test_info.npy` - 测试集元数据 (~214 样本)
|
| 23 |
+
- `smkd/youtubeasl/gloss_dict.npy` - Gloss 词典
|
| 24 |
+
|
| 25 |
+
### 第二步:训练 SMKD 特征提取器 (几小时)
|
| 26 |
+
|
| 27 |
+
从原始视频帧提取深度特征:
|
| 28 |
+
|
| 29 |
+
```bash
|
| 30 |
+
cd smkd
|
| 31 |
+
python main.py --work-dir work_dir/youtubeasl_smkd --config youtubeasl_smkd.yaml --device 0
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
训练 ResNet34 模型提取 1024 维手语视频特征。
|
| 35 |
+
|
| 36 |
+
**可选参数:**
|
| 37 |
+
- `--device 0,1` - 使用多GPU
|
| 38 |
+
- 修改 `youtubeasl_smkd.yaml` 中的 `batch_size` 根据显存调整
|
| 39 |
+
|
| 40 |
+
### 第三步:提取特征 (1小时)
|
| 41 |
+
|
| 42 |
+
训练完成后,选择最好的 checkpoint 提取特征:
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
# 平均 top-5 checkpoints
|
| 46 |
+
python ckpt_avg.py --path work_dir/youtubeasl_smkd --checkpoints 5 --output avg
|
| 47 |
+
|
| 48 |
+
# 提取特征
|
| 49 |
+
python main.py \
|
| 50 |
+
--load-weights avg/average.pt \
|
| 51 |
+
--phase features \
|
| 52 |
+
--device 0 \
|
| 53 |
+
--num-feature-aug 10 \
|
| 54 |
+
--work-dir work_dir/youtubeasl_smkd \
|
| 55 |
+
--config youtubeasl_smkd.yaml
|
| 56 |
+
|
| 57 |
+
# 合并训练特征
|
| 58 |
+
cd work_dir/youtubeasl_smkd
|
| 59 |
+
python ../../example/sign_feature_cmb.py train*.h5
|
| 60 |
+
cd ../..
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
生成 `train.h5`, `dev.h5`, `test.h5` 文件。
|
| 64 |
+
|
| 65 |
+
### 第四步:准备文本数据 (手动)
|
| 66 |
+
|
| 67 |
+
**注意:这一步需要根据你的需求手动处理**
|
| 68 |
+
|
| 69 |
+
SLTUNET 原本是做 **手语→文本翻译**,但 YouTubeASL 只有 Gloss 标注。
|
| 70 |
+
|
| 71 |
+
你需要决定:
|
| 72 |
+
|
| 73 |
+
**选项 A:只做 Gloss 识别(推荐开始)**
|
| 74 |
+
```bash
|
| 75 |
+
mkdir -p preprocessed-youtubeasl
|
| 76 |
+
cd preprocessed-youtubeasl
|
| 77 |
+
|
| 78 |
+
# 从 smkd/youtubeasl/*_info.npy 提取 gloss 序列
|
| 79 |
+
# 创建 train.gloss, dev.gloss, test.gloss
|
| 80 |
+
|
| 81 |
+
# 学习 BPE
|
| 82 |
+
pip install subword-nmt
|
| 83 |
+
cat train.gloss | subword-nmt learn-bpe -s 1000 > youtubeasl.bpe
|
| 84 |
+
|
| 85 |
+
# 应用 BPE
|
| 86 |
+
for split in train dev test; do
|
| 87 |
+
subword-nmt apply-bpe -c youtubeasl.bpe < ${split}.gloss > ${split}.bpe.gloss
|
| 88 |
+
done
|
| 89 |
+
|
| 90 |
+
# 添加索引(第一列是特征索引)
|
| 91 |
+
awk 'BEGIN{i=0} /.*/{printf "%d %s\n",i,$0; i++}' < train.bpe.gloss > train.bpe.gloss.idx
|
| 92 |
+
awk 'BEGIN{i=0} /.*/{printf "%d %s\n",i,$0; i++}' < dev.bpe.gloss > dev.bpe.gloss.idx
|
| 93 |
+
awk 'BEGIN{i=0} /.*/{printf "%d %s\n",i,$0; i++}' < test.bpe.gloss > test.bpe.gloss.idx
|
| 94 |
+
|
| 95 |
+
# 打乱训练数据
|
| 96 |
+
python ../example/shuffle_corpus.py --corpus train.bpe.gloss.idx train.bpe.gloss.idx
|
| 97 |
+
|
| 98 |
+
# 创建词典
|
| 99 |
+
cut -d ' ' -f 2- < train.bpe.gloss.idx > train.bpe.gloss.noindex
|
| 100 |
+
python ../vocab.py train.bpe.gloss.noindex vocab.youtubeasl
|
| 101 |
+
|
| 102 |
+
cd ..
|
| 103 |
+
```
|
| 104 |
+
|
| 105 |
+
**选项 B:添加英文翻译(需要额外标注)**
|
| 106 |
+
如果你有英文翻译,可以做 Gloss→English 的翻译任务。
|
| 107 |
+
|
| 108 |
+
### 第五步:训练 SLTUNET (1天)
|
| 109 |
+
|
| 110 |
+
```bash
|
| 111 |
+
bash train_sltunet.sh
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
或者手动运行(可以调整参数):
|
| 115 |
+
|
| 116 |
+
```bash
|
| 117 |
+
export CUDA_VISIBLE_DEVICES=0
|
| 118 |
+
|
| 119 |
+
python run.py --mode train --parameters=\
|
| 120 |
+
hidden_size=256,embed_size=256,filter_size=4096,\
|
| 121 |
+
sep_layer=0,num_encoder_layer=6,num_decoder_layer=6,\
|
| 122 |
+
ctc_enable=True,ctc_alpha=0.3,ctc_repeated=True,\
|
| 123 |
+
batch_size=40,eval_batch_size=16,\
|
| 124 |
+
max_len=256,max_img_len=512,\
|
| 125 |
+
img_feature_size=1024,img_aug_size=11,\
|
| 126 |
+
gpus=[0],\
|
| 127 |
+
img_train_file="smkd/work_dir/youtubeasl_smkd/train.h5",\
|
| 128 |
+
src_train_file="preprocessed-youtubeasl/train.bpe.gloss.shuf",\
|
| 129 |
+
tgt_train_file="preprocessed-youtubeasl/train.bpe.gloss.shuf",\
|
| 130 |
+
img_dev_file="smkd/work_dir/youtubeasl_smkd/dev.h5",\
|
| 131 |
+
src_dev_file="preprocessed-youtubeasl/dev.bpe.gloss.idx",\
|
| 132 |
+
tgt_dev_file="preprocessed-youtubeasl/dev.bpe.gloss.idx",\
|
| 133 |
+
output_dir="train_youtubeasl"
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
## 便捷脚本
|
| 137 |
+
|
| 138 |
+
```bash
|
| 139 |
+
# 方式1:分步执行
|
| 140 |
+
bash train_youtubeasl.sh # 预处理 + SMKD训练
|
| 141 |
+
bash extract_features.sh # 提取特征
|
| 142 |
+
# 手动准备 BPE 数据...
|
| 143 |
+
bash train_sltunet.sh # SLTUNET训练
|
| 144 |
+
|
| 145 |
+
# 方式2:单独执行各步骤(见上文)
|
| 146 |
+
```
|
| 147 |
+
|
| 148 |
+
## 文件说明
|
| 149 |
+
|
| 150 |
+
| 文件 | 说明 |
|
| 151 |
+
|------|------|
|
| 152 |
+
| `1_preprocess.py` | YouTubeASL数据预处理脚本 |
|
| 153 |
+
| `train_youtubeasl.sh` | SMKD训练脚本 |
|
| 154 |
+
| `extract_features.sh` | 特征提取脚本 |
|
| 155 |
+
| `train_sltunet.sh` | SLTUNET训练脚本 |
|
| 156 |
+
| `smkd/youtubeasl_smkd.yaml` | SMKD配置文件 |
|
| 157 |
+
| `training_yutubeasl/configs/youtubeasl_dataset.yaml` | 数据集配置文件 |
|
| 158 |
+
| `README_YouTubeASL.md` | 详细文档 |
|
| 159 |
+
|
| 160 |
+
## 预期结果
|
| 161 |
+
|
| 162 |
+
- **数据集大小:** ~2108 样本 (80% train / 10% dev / 10% test)
|
| 163 |
+
- **Gloss 词汇量:** ~几百个独特的 gloss tokens
|
| 164 |
+
- **特征维度:** 1024 (来自 ResNet34)
|
| 165 |
+
- **训练时间:**
|
| 166 |
+
- SMKD: ~10-20 epochs, 几小时
|
| 167 |
+
- SLTUNET: ~5000 steps, ~1天
|
| 168 |
+
|
| 169 |
+
## 故障排查
|
| 170 |
+
|
| 171 |
+
### 问题1:找不到视频��
|
| 172 |
+
确保路径正确:
|
| 173 |
+
```
|
| 174 |
+
YouTubeASL_utterances_results/
|
| 175 |
+
├── 10006709/
|
| 176 |
+
│ └── crop_frame/
|
| 177 |
+
│ ├── 00000001.jpg
|
| 178 |
+
│ ├── 00000002.jpg
|
| 179 |
+
│ └── ...
|
| 180 |
+
├── 10036884/
|
| 181 |
+
└── ...
|
| 182 |
+
```
|
| 183 |
+
|
| 184 |
+
### 问题2:CUDA out of memory
|
| 185 |
+
- 减小 `batch_size`(在 `youtubeasl_smkd.yaml` 或 `train_sltunet.sh`)
|
| 186 |
+
- 减少 `num_feature_aug`
|
| 187 |
+
- 使用多GPU:`--device 0,1`
|
| 188 |
+
|
| 189 |
+
### 问题3:导入错误
|
| 190 |
+
确保在正确的目录和环境:
|
| 191 |
+
```bash
|
| 192 |
+
cd /research/cbim/vast/sf895/code/Sign-X/output/huggingface_youtubeasl_repo/slt_new_new
|
| 193 |
+
conda activate WaveGen # 或你的环境
|
| 194 |
+
```
|
| 195 |
+
|
| 196 |
+
## 下一步
|
| 197 |
+
|
| 198 |
+
训练完成后:
|
| 199 |
+
1. 评估模型性能(Gloss 识别准确率/WER)
|
| 200 |
+
2. 如果效果不好,调整超参数
|
| 201 |
+
3. 考虑添加更多数据或使用预训练模型
|
| 202 |
+
|
| 203 |
+
详细信息请参考 `README_YouTubeASL.md`。
|
plugins/SignX/training_yutubeasl/docs/TUTORIAL.md
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YouTubeASL Training Pipeline for SLTUNET
|
| 2 |
+
|
| 3 |
+
This guide describes how to train SLTUNET on the YouTubeASL dataset, following the exact same pipeline as Phoenix-2014T.
|
| 4 |
+
|
| 5 |
+
## Prerequisites
|
| 6 |
+
|
| 7 |
+
1. Python 3.8
|
| 8 |
+
2. TensorFlow 1.15
|
| 9 |
+
3. PyTorch (for SMKD)
|
| 10 |
+
4. YouTubeASL data located at:
|
| 11 |
+
- `../../YouTubeASL_utterances_results/` (video frames)
|
| 12 |
+
- `../../YouTubeASL_utterances_mapping.txt` (gloss annotations)
|
| 13 |
+
|
| 14 |
+
## Complete Training Pipeline
|
| 15 |
+
|
| 16 |
+
### Step 1: Preprocess YouTubeASL Dataset
|
| 17 |
+
|
| 18 |
+
Generate `{train,dev,test}_info.npy` and `gloss_dict.npy` files:
|
| 19 |
+
|
| 20 |
+
```bash
|
| 21 |
+
python 1_preprocess.py \
|
| 22 |
+
--data-root ../../YouTubeASL_utterances_results \
|
| 23 |
+
--mapping-file ../../YouTubeASL_utterances_mapping.txt \
|
| 24 |
+
--output-dir ./smkd/youtubeasl \
|
| 25 |
+
--train-ratio 0.8 \
|
| 26 |
+
--dev-ratio 0.1
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
**Output:**
|
| 30 |
+
- `smkd/youtubeasl/train_info.npy` - Training set metadata
|
| 31 |
+
- `smkd/youtubeasl/dev_info.npy` - Dev set metadata
|
| 32 |
+
- `smkd/youtubeasl/test_info.npy` - Test set metadata
|
| 33 |
+
- `smkd/youtubeasl/gloss_dict.npy` - Gloss vocabulary
|
| 34 |
+
- `smkd/youtubeasl/youtubeasl-groundtruth-{train,dev,test}.stm` - Evaluation files
|
| 35 |
+
|
| 36 |
+
### Step 2: Pretrain SMKD Embeddings
|
| 37 |
+
|
| 38 |
+
Train a ResNet34 model to extract sign video features:
|
| 39 |
+
|
| 40 |
+
```bash
|
| 41 |
+
cd smkd
|
| 42 |
+
python main.py --work-dir work_dir/youtubeasl_smkd --config youtubeasl_smkd.yaml --device 0
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
This will:
|
| 46 |
+
- Train SMKD model for 40 epochs
|
| 47 |
+
- Save checkpoints in `work_dir/youtubeasl_smkd/`
|
| 48 |
+
- Evaluate on dev set every epoch
|
| 49 |
+
|
| 50 |
+
**Training time:** ~Several hours depending on GPU
|
| 51 |
+
|
| 52 |
+
### Step 3: Checkpoint Averaging
|
| 53 |
+
|
| 54 |
+
After training, select top-5 checkpoints based on dev set WER and average them:
|
| 55 |
+
|
| 56 |
+
```bash
|
| 57 |
+
# Still in smkd directory
|
| 58 |
+
python ckpt_avg.py --path work_dir/youtubeasl_smkd --checkpoints 5 --output avg
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
### Step 4: Extract Sign Features
|
| 62 |
+
|
| 63 |
+
Extract 1024-dim features for all video frames:
|
| 64 |
+
|
| 65 |
+
```bash
|
| 66 |
+
python main.py \
|
| 67 |
+
--load-weights avg/average.pt \
|
| 68 |
+
--phase features \
|
| 69 |
+
--device 0 \
|
| 70 |
+
--num-feature-aug 10 \
|
| 71 |
+
--work-dir work_dir/youtubeasl_smkd \
|
| 72 |
+
--config youtubeasl_smkd.yaml
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
Then combine training features:
|
| 76 |
+
|
| 77 |
+
```bash
|
| 78 |
+
cd work_dir/youtubeasl_smkd
|
| 79 |
+
python ../../example/sign_feature_cmb.py train*.h5
|
| 80 |
+
cd ../../..
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
**Output:** `train.h5`, `dev.h5`, `test.h5` containing sign video features
|
| 84 |
+
|
| 85 |
+
### Step 5: Prepare Text Data (BPE Tokenization)
|
| 86 |
+
|
| 87 |
+
Create `preprocessed-youtubeasl/` directory and prepare BPE files:
|
| 88 |
+
|
| 89 |
+
```bash
|
| 90 |
+
mkdir -p preprocessed-youtubeasl
|
| 91 |
+
cd preprocessed-youtubeasl
|
| 92 |
+
|
| 93 |
+
# Extract glosses from train/dev/test splits
|
| 94 |
+
# Create train.gloss, dev.gloss, test.gloss files
|
| 95 |
+
|
| 96 |
+
# Learn BPE with subword-nmt (install if needed: pip install subword-nmt)
|
| 97 |
+
cat train.gloss | subword-nmt learn-bpe -s 1000 > youtubeasl.bpe
|
| 98 |
+
|
| 99 |
+
# Apply BPE
|
| 100 |
+
for split in train dev test; do
|
| 101 |
+
subword-nmt apply-bpe -c youtubeasl.bpe < ${split}.gloss > ${split}.bpe.gloss
|
| 102 |
+
done
|
| 103 |
+
|
| 104 |
+
# Shuffle training data
|
| 105 |
+
python ../example/shuffle_corpus.py --corpus train.bpe.gloss train.bpe.gloss
|
| 106 |
+
|
| 107 |
+
# Create vocabulary
|
| 108 |
+
python ../vocab.py train.bpe.gloss vocab.youtubeasl
|
| 109 |
+
|
| 110 |
+
cd ..
|
| 111 |
+
```
|
| 112 |
+
|
| 113 |
+
### Step 6: Train SLTUNET Model
|
| 114 |
+
|
| 115 |
+
```bash
|
| 116 |
+
bash train_sltunet.sh
|
| 117 |
+
```
|
| 118 |
+
|
| 119 |
+
This will train the full SLTUNET model with:
|
| 120 |
+
- Multi-task learning (gloss recognition + translation)
|
| 121 |
+
- CTC alignment
|
| 122 |
+
- BPE dropout for regularization
|
| 123 |
+
|
| 124 |
+
**Output:** Model checkpoints in `train_youtubeasl/` directory
|
| 125 |
+
|
| 126 |
+
### Step 7: Evaluation
|
| 127 |
+
|
| 128 |
+
After training, average top-10 checkpoints and evaluate:
|
| 129 |
+
|
| 130 |
+
```bash
|
| 131 |
+
python models/checkpoint_averaging.py \
|
| 132 |
+
--path train_youtubeasl \
|
| 133 |
+
--checkpoints 10 \
|
| 134 |
+
--output avg \
|
| 135 |
+
--gpu 0
|
| 136 |
+
```
|
| 137 |
+
|
| 138 |
+
Then decode on test set (see `example/test.sh` for reference).
|
| 139 |
+
|
| 140 |
+
## Quick Start Scripts
|
| 141 |
+
|
| 142 |
+
We provide three convenience scripts:
|
| 143 |
+
|
| 144 |
+
1. **`train_youtubeasl.sh`** - Run Steps 1-2 (preprocessing + SMKD training)
|
| 145 |
+
2. **`extract_features.sh`** - Run Steps 3-4 (checkpoint averaging + feature extraction)
|
| 146 |
+
3. **`train_sltunet.sh`** - Run Step 6 (SLTUNET training)
|
| 147 |
+
|
| 148 |
+
Run them sequentially:
|
| 149 |
+
|
| 150 |
+
```bash
|
| 151 |
+
bash 2_train_smkd.sh # Wait for completion
|
| 152 |
+
bash 3_extract_features.sh # Wait for completion
|
| 153 |
+
# Prepare BPE data (Step 5)
|
| 154 |
+
bash 4_train_sltunet.sh # Final training
|
| 155 |
+
```
|
| 156 |
+
|
| 157 |
+
## File Structure
|
| 158 |
+
|
| 159 |
+
```
|
| 160 |
+
slt_new_new/
|
| 161 |
+
├── 1_preprocess.py # Data preprocessing script
|
| 162 |
+
├── 2_train_smkd.sh # SMKD training script
|
| 163 |
+
├── 3_extract_features.sh # Feature extraction script
|
| 164 |
+
├── 4_train_sltunet.sh # SLTUNET training script
|
| 165 |
+
├── smkd/
|
| 166 |
+
│ ├── youtubeasl_smkd.yaml # SMKD config for YouTubeASL
|
| 167 |
+
│ ├── configs/
|
| 168 |
+
│ │ └── youtubeasl_dataset.yaml # Dataset config
|
| 169 |
+
│ ├── youtubeasl/ # Preprocessed data (generated)
|
| 170 |
+
│ │ ├── train_info.npy
|
| 171 |
+
│ │ ├── dev_info.npy
|
| 172 |
+
│ │ ├── test_info.npy
|
| 173 |
+
│ │ └── gloss_dict.npy
|
| 174 |
+
│ └── work_dir/
|
| 175 |
+
│ └── youtubeasl_smkd/ # SMKD checkpoints & features
|
| 176 |
+
│ ├── train.h5
|
| 177 |
+
│ ├── dev.h5
|
| 178 |
+
│ └── test.h5
|
| 179 |
+
└── preprocessed-youtubeasl/ # BPE tokenized data (manual)
|
| 180 |
+
├── youtubeasl.bpe
|
| 181 |
+
├── train.bpe.gloss.shuf
|
| 182 |
+
├── dev.bpe.gloss
|
| 183 |
+
├── test.bpe.gloss
|
| 184 |
+
└── vocab.youtubeasl
|
| 185 |
+
```
|
| 186 |
+
|
| 187 |
+
## Notes
|
| 188 |
+
|
| 189 |
+
- The pipeline exactly follows Phoenix-2014T methodology
|
| 190 |
+
- No model modifications - only data preprocessing
|
| 191 |
+
- SMKD extracts 1024-dim features from video frames (256x256 → 224x224 crop)
|
| 192 |
+
- SLTUNET uses these features for sign-to-gloss translation
|
| 193 |
+
- Total training time: ~1-2 days on single GPU (SMKD) + ~1 day (SLTUNET)
|
plugins/SignX/training_yutubeasl/run_all.sh
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Complete YouTubeASL training pipeline with automatic environment switching
|
| 4 |
+
# This will automatically use the correct environment for each step
|
| 5 |
+
|
| 6 |
+
set -e
|
| 7 |
+
|
| 8 |
+
echo "========================================"
|
| 9 |
+
echo " YouTubeASL SLTUNET Training Pipeline "
|
| 10 |
+
echo "========================================"
|
| 11 |
+
echo ""
|
| 12 |
+
echo "This will run the complete pipeline:"
|
| 13 |
+
echo " 1. Data preprocessing"
|
| 14 |
+
echo " 2. SMKD feature extractor training (PyTorch)"
|
| 15 |
+
echo " 3. Feature extraction (PyTorch)"
|
| 16 |
+
echo " 4. SLTUNET training (TensorFlow)"
|
| 17 |
+
echo ""
|
| 18 |
+
echo "Environments will be switched automatically:"
|
| 19 |
+
echo " - Steps 2-3: signx-slt (PyTorch)"
|
| 20 |
+
echo " - Step 4: slt_tf1 (TensorFlow)"
|
| 21 |
+
echo ""
|
| 22 |
+
echo "========================================"
|
| 23 |
+
echo ""
|
| 24 |
+
|
| 25 |
+
# Get conda base
|
| 26 |
+
CONDA_BASE=$(conda info --base)
|
| 27 |
+
source "${CONDA_BASE}/etc/profile.d/conda.sh"
|
| 28 |
+
|
| 29 |
+
cd scripts
|
| 30 |
+
SCRIPTS_DIR=$(pwd)
|
| 31 |
+
|
| 32 |
+
# Step 1: Preprocess (use signx-slt to avoid numpy pickle incompatibility)
|
| 33 |
+
echo ">>> Step 1/4: Preprocessing YouTubeASL dataset..."
|
| 34 |
+
echo "Switching to signx-slt environment for preprocessing..."
|
| 35 |
+
conda activate signx-slt
|
| 36 |
+
python 1_preprocess.py \
|
| 37 |
+
--video-root /common/users/sf895/SignerX-inference/plugins/YouTubeASL \
|
| 38 |
+
--frames-root /common/users/sf895/SignerX-inference/plugins/YouTubeASL/video1000size_frames \
|
| 39 |
+
--manifest-path /common/users/sf895/SignerX-inference/plugins/YouTubeASL/video1000size/manifest_top1000.tsv
|
| 40 |
+
echo "✓ Preprocessing complete"
|
| 41 |
+
echo ""
|
| 42 |
+
|
| 43 |
+
# Step 2: Train SMKD (need PyTorch)
|
| 44 |
+
echo ">>> Step 2/4: Training SMKD feature extractor..."
|
| 45 |
+
echo "Using signx-slt environment (PyTorch)..."
|
| 46 |
+
SMKD_DIR=../../smkd
|
| 47 |
+
SMKD_WORK_DIR="${SMKD_DIR}/work_dir/youtubeasl_smkd"
|
| 48 |
+
BEST_SMKD_CKPT="${SMKD_WORK_DIR}/best_model.pt"
|
| 49 |
+
|
| 50 |
+
# Decide GPU usage (interactive unless SMKD_NUM_GPUS already set)
|
| 51 |
+
if [[ -z "${SMKD_NUM_GPUS:-}" ]]; then
|
| 52 |
+
TOTAL_GPUS=$(nvidia-smi -L 2>/dev/null | wc -l | tr -d ' ')
|
| 53 |
+
if [[ -z "$TOTAL_GPUS" || "$TOTAL_GPUS" -lt 1 ]]; then
|
| 54 |
+
TOTAL_GPUS=1
|
| 55 |
+
fi
|
| 56 |
+
DEFAULT_GPU_COUNT=$TOTAL_GPUS
|
| 57 |
+
read -p "How many GPUs should SMKD training use? (1-${TOTAL_GPUS}, default ${DEFAULT_GPU_COUNT}): " -r USER_GPU_COUNT
|
| 58 |
+
if [[ -n "$USER_GPU_COUNT" ]]; then
|
| 59 |
+
SMKD_NUM_GPUS=$USER_GPU_COUNT
|
| 60 |
+
else
|
| 61 |
+
SMKD_NUM_GPUS=$DEFAULT_GPU_COUNT
|
| 62 |
+
fi
|
| 63 |
+
fi
|
| 64 |
+
export SMKD_NUM_GPUS
|
| 65 |
+
echo "SMKD training will run on ${SMKD_NUM_GPUS} GPU(s). Override by exporting SMKD_NUM_GPUS before running this script."
|
| 66 |
+
|
| 67 |
+
# Choose training mode
|
| 68 |
+
SMKD_MODE="train"
|
| 69 |
+
RESUME_CHECKPOINT=""
|
| 70 |
+
if [[ -f "${BEST_SMKD_CKPT}" ]]; then
|
| 71 |
+
echo ""
|
| 72 |
+
echo "Detected existing SMKD checkpoint at ${BEST_SMKD_CKPT}."
|
| 73 |
+
echo "Choose training mode:"
|
| 74 |
+
echo " 1) Train from scratch (will overwrite existing checkpoints)"
|
| 75 |
+
echo " 2) Continue training from existing checkpoint (resume)"
|
| 76 |
+
echo " 3) Skip training and use existing checkpoint"
|
| 77 |
+
echo ""
|
| 78 |
+
read -p "Enter choice (1/2/3, default 3): " -r SMKD_CHOICE
|
| 79 |
+
|
| 80 |
+
case "${SMKD_CHOICE}" in
|
| 81 |
+
1)
|
| 82 |
+
SMKD_MODE="train"
|
| 83 |
+
echo "Will train from scratch (existing checkpoints will be overwritten)."
|
| 84 |
+
;;
|
| 85 |
+
2)
|
| 86 |
+
SMKD_MODE="resume"
|
| 87 |
+
echo ""
|
| 88 |
+
echo "Available checkpoints in ${SMKD_WORK_DIR}:"
|
| 89 |
+
ls -lh "${SMKD_WORK_DIR}"/*.pt 2>/dev/null | awk '{print " " $9 " (" $5 ")"}'
|
| 90 |
+
echo ""
|
| 91 |
+
read -p "Enter checkpoint path (default: ${BEST_SMKD_CKPT}): " -r USER_CHECKPOINT
|
| 92 |
+
if [[ -n "${USER_CHECKPOINT}" ]]; then
|
| 93 |
+
# Handle relative paths
|
| 94 |
+
if [[ "${USER_CHECKPOINT}" != /* ]]; then
|
| 95 |
+
RESUME_CHECKPOINT="${SMKD_WORK_DIR}/${USER_CHECKPOINT}"
|
| 96 |
+
else
|
| 97 |
+
RESUME_CHECKPOINT="${USER_CHECKPOINT}"
|
| 98 |
+
fi
|
| 99 |
+
else
|
| 100 |
+
RESUME_CHECKPOINT="${BEST_SMKD_CKPT}"
|
| 101 |
+
fi
|
| 102 |
+
|
| 103 |
+
# Convert to absolute path
|
| 104 |
+
RESUME_CHECKPOINT=$(cd "$(dirname "${RESUME_CHECKPOINT}")" && pwd)/$(basename "${RESUME_CHECKPOINT}")
|
| 105 |
+
|
| 106 |
+
if [[ ! -f "${RESUME_CHECKPOINT}" ]]; then
|
| 107 |
+
echo "ERROR: Checkpoint not found: ${RESUME_CHECKPOINT}"
|
| 108 |
+
exit 1
|
| 109 |
+
fi
|
| 110 |
+
echo "Will continue training from ${RESUME_CHECKPOINT}."
|
| 111 |
+
;;
|
| 112 |
+
3|"")
|
| 113 |
+
SMKD_MODE="skip"
|
| 114 |
+
echo "Skipping SMKD training, will reuse existing checkpoint."
|
| 115 |
+
;;
|
| 116 |
+
*)
|
| 117 |
+
echo "Invalid choice. Defaulting to skip."
|
| 118 |
+
SMKD_MODE="skip"
|
| 119 |
+
;;
|
| 120 |
+
esac
|
| 121 |
+
else
|
| 122 |
+
echo "No existing checkpoint found. Will train from scratch."
|
| 123 |
+
SMKD_MODE="train"
|
| 124 |
+
fi
|
| 125 |
+
|
| 126 |
+
# Check PyTorch
|
| 127 |
+
python -c "import torch; print('Using PyTorch', torch.__version__)" || {
|
| 128 |
+
echo "ERROR: PyTorch not found in signx-slt!"
|
| 129 |
+
exit 1
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
cd "${SMKD_DIR}"
|
| 133 |
+
if [[ "${SMKD_MODE}" != "skip" ]]; then
|
| 134 |
+
echo "Running SMKD training (this may take several hours)..."
|
| 135 |
+
cd "$SCRIPTS_DIR"
|
| 136 |
+
if [[ "${SMKD_MODE}" == "resume" ]]; then
|
| 137 |
+
export SMKD_RESUME_CHECKPOINT="${RESUME_CHECKPOINT}"
|
| 138 |
+
fi
|
| 139 |
+
bash 2_train_smkd.sh
|
| 140 |
+
cd "${SMKD_DIR}"
|
| 141 |
+
else
|
| 142 |
+
echo "SMKD training skipped."
|
| 143 |
+
fi
|
| 144 |
+
echo ""
|
| 145 |
+
|
| 146 |
+
# Step 3: Extract features (stay in PyTorch)
|
| 147 |
+
echo ">>> Step 3/4: Extracting features..."
|
| 148 |
+
echo "Staying in signx-slt environment..."
|
| 149 |
+
|
| 150 |
+
FEATURE_DIR=../smkd/features
|
| 151 |
+
WORK_FEATURE_DIR=../smkd/work_dir/youtubeasl_smkd
|
| 152 |
+
|
| 153 |
+
SKIP_FEATURES="n"
|
| 154 |
+
if [[ -f "${WORK_FEATURE_DIR}/train.h5" && -f "${WORK_FEATURE_DIR}/dev.h5" && -f "${WORK_FEATURE_DIR}/test.h5" ]]; then
|
| 155 |
+
echo "Detected existing merged feature files in ${WORK_FEATURE_DIR}."
|
| 156 |
+
read -p "Skip feature extraction and reuse existing .h5 files? (Y/n) " -n 1 -r
|
| 157 |
+
echo
|
| 158 |
+
if [[ -z $REPLY || $REPLY =~ ^[Yy]$ ]]; then
|
| 159 |
+
SKIP_FEATURES="y"
|
| 160 |
+
echo "Skipping feature extraction; existing files will be used."
|
| 161 |
+
fi
|
| 162 |
+
fi
|
| 163 |
+
|
| 164 |
+
if [[ "${SKIP_FEATURES}" != "y" ]]; then
|
| 165 |
+
# Checkpoint averaging
|
| 166 |
+
echo "Averaging top-5 checkpoints..."
|
| 167 |
+
python ckpt_avg.py \
|
| 168 |
+
--path work_dir/youtubeasl_smkd \
|
| 169 |
+
--checkpoints 5 \
|
| 170 |
+
--output avg
|
| 171 |
+
|
| 172 |
+
# Extract features
|
| 173 |
+
echo "Extracting sign features..."
|
| 174 |
+
python main.py \
|
| 175 |
+
--load-weights avg/average.pt \
|
| 176 |
+
--phase features \
|
| 177 |
+
--device 0 \
|
| 178 |
+
--num-feature-aug 10 \
|
| 179 |
+
--work-dir work_dir/youtubeasl_smkd \
|
| 180 |
+
--config ../training_yutubeasl/configs/youtubeasl_smkd.yaml
|
| 181 |
+
|
| 182 |
+
# Combine training features
|
| 183 |
+
echo "Combining training features..."
|
| 184 |
+
cd features
|
| 185 |
+
python ../training_phoenix/sign_feature_cmb.py train_*.h5
|
| 186 |
+
echo "Copying merged features to work_dir..."
|
| 187 |
+
cp train.h5 ../work_dir/youtubeasl_smkd/train.h5
|
| 188 |
+
cp dev.h5 ../work_dir/youtubeasl_smkd/dev.h5
|
| 189 |
+
cp test.h5 ../work_dir/youtubeasl_smkd/test.h5
|
| 190 |
+
cd ..
|
| 191 |
+
cd "$SCRIPTS_DIR"
|
| 192 |
+
|
| 193 |
+
echo "✓ Feature extraction complete"
|
| 194 |
+
else
|
| 195 |
+
echo "Feature extraction skipped."
|
| 196 |
+
fi
|
| 197 |
+
echo ""
|
| 198 |
+
|
| 199 |
+
# Step 4: Train SLTUNET (need TensorFlow)
|
| 200 |
+
echo ">>> Step 4/4: SLTUNET training"
|
| 201 |
+
echo ""
|
| 202 |
+
echo "⚠️ IMPORTANT: Before running SLTUNET, you need to prepare text data:"
|
| 203 |
+
echo " 1. Create preprocessed-youtubeasl/ directory"
|
| 204 |
+
echo " 2. Extract gloss sequences from *_info.npy files"
|
| 205 |
+
echo " 3. Apply BPE tokenization"
|
| 206 |
+
echo " 4. Create vocabulary file"
|
| 207 |
+
echo ""
|
| 208 |
+
echo "See training_yutubeasl/docs/QUICKSTART.md for detailed instructions"
|
| 209 |
+
echo ""
|
| 210 |
+
read -p "Have you prepared the text data? (y/n) " -n 1 -r
|
| 211 |
+
echo
|
| 212 |
+
if [[ $REPLY =~ ^[Yy]$ ]]
|
| 213 |
+
then
|
| 214 |
+
echo "Switching to slt_tf1 environment (TensorFlow)..."
|
| 215 |
+
conda activate slt_tf1
|
| 216 |
+
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
|
| 217 |
+
|
| 218 |
+
# Check TensorFlow
|
| 219 |
+
python -c "import tensorflow as tf; print('Using TensorFlow', tf.__version__)" || {
|
| 220 |
+
echo "ERROR: TensorFlow not found in slt_tf1!"
|
| 221 |
+
exit 1
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
echo "Starting SLTUNET training..."
|
| 225 |
+
cd "$SCRIPTS_DIR"
|
| 226 |
+
bash 4_train_sltunet.sh
|
| 227 |
+
echo "✓ SLTUNET training complete"
|
| 228 |
+
else
|
| 229 |
+
echo ""
|
| 230 |
+
echo "Please prepare text data first."
|
| 231 |
+
echo "Steps:"
|
| 232 |
+
echo " 1. cd ../../"
|
| 233 |
+
echo " 2. mkdir -p preprocessed-youtubeasl"
|
| 234 |
+
echo " 3. Follow instructions in training_yutubeasl/docs/QUICKSTART.md"
|
| 235 |
+
echo " 4. Then run: conda activate slt_tf1 && bash training_yutubeasl/scripts/4_train_sltunet.sh"
|
| 236 |
+
exit 0
|
| 237 |
+
fi
|
| 238 |
+
|
| 239 |
+
echo ""
|
| 240 |
+
echo "========================================"
|
| 241 |
+
echo " Training Pipeline Complete! "
|
| 242 |
+
echo "========================================"
|
| 243 |
+
echo ""
|
| 244 |
+
echo "Output files:"
|
| 245 |
+
echo " - SMKD checkpoints: smkd/work_dir/youtubeasl_smkd/"
|
| 246 |
+
echo " - Features: smkd/work_dir/youtubeasl_smkd/{train,dev,test}.h5"
|
| 247 |
+
echo " - SLTUNET model: train_youtubeasl/"
|
plugins/SignX/training_yutubeasl/scripts/.nfs000000004234454e00002a55
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Train SLTUNET model on ASLLRP dataset
|
| 4 |
+
# Run this after extract_features.sh completes
|
| 5 |
+
|
| 6 |
+
set -e
|
| 7 |
+
|
| 8 |
+
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
|
| 9 |
+
REPO_ROOT=$(cd "$SCRIPT_DIR/../.." && pwd)
|
| 10 |
+
|
| 11 |
+
# Auto-select available GPUs (skip GPUs with >20% memory usage)
|
| 12 |
+
echo "========================================="
|
| 13 |
+
echo "Auto-selecting available GPUs..."
|
| 14 |
+
echo "========================================="
|
| 15 |
+
eval $(bash "$SCRIPT_DIR/select_gpus.sh")
|
| 16 |
+
|
| 17 |
+
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
|
| 18 |
+
|
| 19 |
+
# Paths
|
| 20 |
+
data=preprocessed-asllrp/
|
| 21 |
+
feature=smkd/work_dir/asllrp_smkd/
|
| 22 |
+
|
| 23 |
+
echo "========================================="
|
| 24 |
+
echo "Training SLTUNET on ASLLRP Dataset"
|
| 25 |
+
echo "========================================="
|
| 26 |
+
|
| 27 |
+
# First, you need to prepare the text data (glosses)
|
| 28 |
+
# Create preprocessed-asllrp directory and prepare BPE tokenization
|
| 29 |
+
|
| 30 |
+
echo ""
|
| 31 |
+
echo "Make sure you have:"
|
| 32 |
+
echo "1. Created $data directory"
|
| 33 |
+
echo "2. Prepared BPE tokenized gloss files"
|
| 34 |
+
echo "3. Extracted SMKD features in $feature"
|
| 35 |
+
echo ""
|
| 36 |
+
|
| 37 |
+
# Train SLTUNET model
|
| 38 |
+
# Create log directory
|
| 39 |
+
LOG_DIR="$REPO_ROOT/checkpoints_asllrp/logs"
|
| 40 |
+
mkdir -p "$LOG_DIR"
|
| 41 |
+
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
|
| 42 |
+
LOG_FILE="$LOG_DIR/training_${TIMESTAMP}.log"
|
| 43 |
+
|
| 44 |
+
echo "Training logs will be saved to: $LOG_FILE"
|
| 45 |
+
echo "You can monitor the log with: tail -f $LOG_FILE"
|
| 46 |
+
echo ""
|
| 47 |
+
|
| 48 |
+
(cd "$REPO_ROOT" && python run.py --mode train --parameters=\
|
| 49 |
+
hidden_size=256,embed_size=256,filter_size=4096,\
|
| 50 |
+
sep_layer=0,num_encoder_layer=6,num_decoder_layer=6,\
|
| 51 |
+
ctc_enable=True,ctc_alpha=0.3,ctc_repeated=True,\
|
| 52 |
+
src_bpe_dropout=0.2,tgt_bpe_dropout=0.2,bpe_dropout_stochastic_rate=0.6,\
|
| 53 |
+
initializer="uniform_unit_scaling",initializer_gain=0.5,\
|
| 54 |
+
dropout=0.3,label_smooth=0.1,attention_dropout=0.3,relu_dropout=0.5,residual_dropout=0.4,\
|
| 55 |
+
max_len=256,max_img_len=512,batch_size=240,eval_batch_size=80,\
|
| 56 |
+
token_size=4800,batch_or_token='token',beam_size=8,remove_bpe=True,decode_alpha=1.0,\
|
| 57 |
+
scope_name="transformer",buffer_size=50000,data_leak_ratio=0.1,\
|
| 58 |
+
img_feature_size=1024,img_aug_size=10,\
|
| 59 |
+
clip_grad_norm=5.0,\
|
| 60 |
+
num_heads=4,\
|
| 61 |
+
process_num=16,\
|
| 62 |
+
lrate=1.0,\
|
| 63 |
+
estop_patience=100,\
|
| 64 |
+
warmup_steps=500,\
|
| 65 |
+
epoches=5000,\
|
| 66 |
+
update_cycle=16,\
|
| 67 |
+
gpus=$GPU_LIST,\
|
| 68 |
+
disp_freq=1,\
|
| 69 |
+
eval_freq=10,\
|
| 70 |
+
save_freq=10,\
|
| 71 |
+
sample_freq=10,\
|
| 72 |
+
checkpoints=1,\
|
| 73 |
+
best_checkpoints=1,\
|
| 74 |
+
max_training_steps=30000,\
|
| 75 |
+
nthreads=8,\
|
| 76 |
+
beta1=0.9,\
|
| 77 |
+
beta2=0.998,\
|
| 78 |
+
random_seed=1234,\
|
| 79 |
+
train_continue=True,\
|
| 80 |
+
src_codes="$data/asllrp.bpe",tgt_codes="$data/asllrp.bpe",\
|
| 81 |
+
src_vocab_file="$data/vocab.asllrp",\
|
| 82 |
+
tgt_vocab_file="$data/vocab.asllrp",\
|
| 83 |
+
img_train_file="$feature/train.h5",\
|
| 84 |
+
src_train_file="$data/train.bpe.gloss.shuf",\
|
| 85 |
+
tgt_train_file="$data/train.bpe.gloss.shuf",\
|
| 86 |
+
img_dev_file="$feature/dev.h5",\
|
| 87 |
+
src_dev_file="$data/dev.bpe.gloss",\
|
| 88 |
+
tgt_dev_file="$data/dev.bpe.gloss",\
|
| 89 |
+
img_test_file="$feature/test.h5",\
|
| 90 |
+
src_test_file="$data/test.bpe.gloss",\
|
| 91 |
+
tgt_test_file="$data/test.bpe.gloss",\
|
| 92 |
+
output_dir="checkpoints_asllrp",\
|
| 93 |
+
test_output="",\
|
| 94 |
+
shared_source_target_embedding=True,\
|
| 95 |
+
collect_attention_weights=False) 2>&1 | tee "$LOG_FILE"
|
plugins/SignX/training_yutubeasl/scripts/1_preprocess.py
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
YouTubeASL Dataset Preprocessing for SMKD
|
| 3 |
+
Generates {mode}_info.npy and gloss_dict.npy in the same format as Phoenix/CSL-Daily.
|
| 4 |
+
"""
|
| 5 |
+
|
| 6 |
+
import argparse
|
| 7 |
+
import csv
|
| 8 |
+
import os
|
| 9 |
+
import random
|
| 10 |
+
import re
|
| 11 |
+
from collections import Counter
|
| 12 |
+
|
| 13 |
+
import numpy as np
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
REQUIRED_COLUMNS = {"VIDEO_NAME", "CLIP_INDEX", "TEXT", "CLIP_PATH"}
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
def _read_manifest(manifest_path, video_root=None):
|
| 20 |
+
samples = []
|
| 21 |
+
skipped = {"missing": 0, "empty": 0, "no_text": 0}
|
| 22 |
+
|
| 23 |
+
with open(manifest_path, "r", encoding="utf-8") as f:
|
| 24 |
+
reader = csv.DictReader(f, delimiter="\t")
|
| 25 |
+
missing = REQUIRED_COLUMNS - set(reader.fieldnames or [])
|
| 26 |
+
if missing:
|
| 27 |
+
raise ValueError(f"Manifest missing required columns: {sorted(missing)}")
|
| 28 |
+
|
| 29 |
+
for row in reader:
|
| 30 |
+
clip_path = (row.get("CLIP_PATH") or "").strip()
|
| 31 |
+
text = (row.get("TEXT") or "").strip()
|
| 32 |
+
if not text:
|
| 33 |
+
skipped["no_text"] += 1
|
| 34 |
+
continue
|
| 35 |
+
|
| 36 |
+
if video_root and clip_path and not os.path.isabs(clip_path):
|
| 37 |
+
clip_path = os.path.join(video_root, clip_path)
|
| 38 |
+
|
| 39 |
+
if not clip_path or not os.path.exists(clip_path):
|
| 40 |
+
skipped["missing"] += 1
|
| 41 |
+
continue
|
| 42 |
+
if os.path.getsize(clip_path) == 0:
|
| 43 |
+
skipped["empty"] += 1
|
| 44 |
+
continue
|
| 45 |
+
|
| 46 |
+
video_name = (row.get("VIDEO_NAME") or "").strip()
|
| 47 |
+
clip_index_raw = (row.get("CLIP_INDEX") or "").strip()
|
| 48 |
+
try:
|
| 49 |
+
clip_index = int(clip_index_raw)
|
| 50 |
+
file_id = f"{video_name}_{clip_index:04d}"
|
| 51 |
+
except ValueError:
|
| 52 |
+
file_id = f"{video_name}_{clip_index_raw}"
|
| 53 |
+
|
| 54 |
+
normalized_text = text.lower()
|
| 55 |
+
normalized_text = re.sub(r"[^\w']+", " ", normalized_text)
|
| 56 |
+
normalized_text = " ".join(normalized_text.split())
|
| 57 |
+
sample = {
|
| 58 |
+
"id": file_id,
|
| 59 |
+
"video_name": video_name,
|
| 60 |
+
"clip_index": clip_index_raw,
|
| 61 |
+
"text": normalized_text,
|
| 62 |
+
"clip_path": clip_path,
|
| 63 |
+
"start": (row.get("START") or "").strip(),
|
| 64 |
+
"end": (row.get("END") or "").strip(),
|
| 65 |
+
}
|
| 66 |
+
samples.append(sample)
|
| 67 |
+
|
| 68 |
+
return samples, skipped
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
def _split_by_video(samples, seed, val_size, test_size):
|
| 72 |
+
groups = {}
|
| 73 |
+
for sample in samples:
|
| 74 |
+
groups.setdefault(sample["video_name"], []).append(sample)
|
| 75 |
+
|
| 76 |
+
rng = random.Random(seed)
|
| 77 |
+
video_names = list(groups.keys())
|
| 78 |
+
rng.shuffle(video_names)
|
| 79 |
+
|
| 80 |
+
train, val, test = [], [], []
|
| 81 |
+
for video_name in video_names:
|
| 82 |
+
group = groups[video_name]
|
| 83 |
+
if len(test) < test_size:
|
| 84 |
+
test.extend(group)
|
| 85 |
+
continue
|
| 86 |
+
if len(val) < val_size:
|
| 87 |
+
val.extend(group)
|
| 88 |
+
continue
|
| 89 |
+
train.extend(group)
|
| 90 |
+
|
| 91 |
+
return train, val, test
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
def preprocess_youtubeasl(
|
| 95 |
+
manifest_path,
|
| 96 |
+
output_dir,
|
| 97 |
+
prefix_for_smkd=None,
|
| 98 |
+
seed=1234,
|
| 99 |
+
val_size=300,
|
| 100 |
+
test_size=100,
|
| 101 |
+
video_root=None,
|
| 102 |
+
frames_root=None,
|
| 103 |
+
min_frames=0,
|
| 104 |
+
max_frames=0,
|
| 105 |
+
evaluation_prefix="youtubeasl-groundtruth",
|
| 106 |
+
):
|
| 107 |
+
print(f"Loading manifest: {manifest_path}")
|
| 108 |
+
samples, skipped = _read_manifest(manifest_path, video_root=video_root)
|
| 109 |
+
|
| 110 |
+
print(f"Total samples: {len(samples)}")
|
| 111 |
+
if any(skipped.values()):
|
| 112 |
+
print(
|
| 113 |
+
"Skipped samples: "
|
| 114 |
+
+ ", ".join(f"{k}={v}" for k, v in skipped.items() if v)
|
| 115 |
+
)
|
| 116 |
+
|
| 117 |
+
train_samples, val_samples, test_samples = _split_by_video(
|
| 118 |
+
samples, seed=seed, val_size=val_size, test_size=test_size
|
| 119 |
+
)
|
| 120 |
+
|
| 121 |
+
if len(val_samples) < val_size or len(test_samples) < test_size:
|
| 122 |
+
print(
|
| 123 |
+
"Warning: requested split sizes not reached. "
|
| 124 |
+
f"val={len(val_samples)} (target {val_size}), "
|
| 125 |
+
f"test={len(test_samples)} (target {test_size})."
|
| 126 |
+
)
|
| 127 |
+
|
| 128 |
+
if len(val_samples) > val_size or len(test_samples) > test_size:
|
| 129 |
+
print(
|
| 130 |
+
"Note: split sizes exceeded targets due to grouping by VIDEO_NAME. "
|
| 131 |
+
f"val={len(val_samples)} (target {val_size}), "
|
| 132 |
+
f"test={len(test_samples)} (target {test_size})."
|
| 133 |
+
)
|
| 134 |
+
|
| 135 |
+
splits = {
|
| 136 |
+
"train": train_samples,
|
| 137 |
+
"dev": val_samples,
|
| 138 |
+
"test": test_samples,
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
print(
|
| 142 |
+
f"Split - Train: {len(train_samples)}, Dev: {len(val_samples)}, Test: {len(test_samples)}"
|
| 143 |
+
)
|
| 144 |
+
|
| 145 |
+
os.makedirs(output_dir, exist_ok=True)
|
| 146 |
+
|
| 147 |
+
if frames_root:
|
| 148 |
+
frames_root = os.path.abspath(frames_root)
|
| 149 |
+
prefix_for_smkd = frames_root
|
| 150 |
+
|
| 151 |
+
kept_by_split = {}
|
| 152 |
+
for mode, samples_list in splits.items():
|
| 153 |
+
info_dict = {"prefix": prefix_for_smkd}
|
| 154 |
+
kept = 0
|
| 155 |
+
kept_samples = []
|
| 156 |
+
|
| 157 |
+
for sample in samples_list:
|
| 158 |
+
frame_count = -1
|
| 159 |
+
if frames_root:
|
| 160 |
+
clip_name = os.path.splitext(os.path.basename(sample["clip_path"]))[0]
|
| 161 |
+
folder_path = os.path.join(sample["video_name"], clip_name, "crop_frame", "*.jpg")
|
| 162 |
+
abs_dir = os.path.join(frames_root, sample["video_name"], clip_name, "crop_frame")
|
| 163 |
+
if not os.path.isdir(abs_dir):
|
| 164 |
+
continue
|
| 165 |
+
frame_count = len([p for p in os.listdir(abs_dir) if p.lower().endswith(".jpg")])
|
| 166 |
+
if min_frames and frame_count < min_frames:
|
| 167 |
+
continue
|
| 168 |
+
if max_frames and frame_count > max_frames:
|
| 169 |
+
continue
|
| 170 |
+
else:
|
| 171 |
+
folder_path = sample["clip_path"]
|
| 172 |
+
|
| 173 |
+
info_dict[kept] = {
|
| 174 |
+
"fileid": sample["id"],
|
| 175 |
+
"folder": folder_path,
|
| 176 |
+
"signer": "Unknown",
|
| 177 |
+
"label": sample["text"],
|
| 178 |
+
"num_frames": frame_count,
|
| 179 |
+
"original_info": (sample, kept, sample["id"]),
|
| 180 |
+
}
|
| 181 |
+
kept += 1
|
| 182 |
+
kept_samples.append(sample)
|
| 183 |
+
|
| 184 |
+
info_path = os.path.join(output_dir, f"{mode}_info.npy")
|
| 185 |
+
np.save(info_path, info_dict)
|
| 186 |
+
print(f"Saved {mode}_info.npy with {kept} samples")
|
| 187 |
+
|
| 188 |
+
kept_by_split[mode] = kept_samples
|
| 189 |
+
|
| 190 |
+
gloss_counter = Counter()
|
| 191 |
+
for kept_samples in kept_by_split.values():
|
| 192 |
+
for sample in kept_samples:
|
| 193 |
+
gloss_counter.update(sample["text"].split())
|
| 194 |
+
|
| 195 |
+
gloss_dict = {}
|
| 196 |
+
for idx, (gloss, count) in enumerate(sorted(gloss_counter.items()), start=1):
|
| 197 |
+
gloss_dict[gloss] = [idx, count]
|
| 198 |
+
|
| 199 |
+
gloss_dict_path = os.path.join(output_dir, "gloss_dict.npy")
|
| 200 |
+
np.save(gloss_dict_path, gloss_dict)
|
| 201 |
+
print(f"Saved gloss_dict.npy with {len(gloss_dict)} glosses")
|
| 202 |
+
|
| 203 |
+
for mode, kept_samples in kept_by_split.items():
|
| 204 |
+
stm_path = os.path.join(output_dir, f"{evaluation_prefix}-{mode}.stm")
|
| 205 |
+
with open(stm_path, "w", encoding="utf-8") as f:
|
| 206 |
+
for sample in kept_samples:
|
| 207 |
+
utt_id = sample["id"]
|
| 208 |
+
gloss = sample["text"]
|
| 209 |
+
signer = "Unknown"
|
| 210 |
+
f.write(f"{utt_id} 1 {signer} 0.0 1.79769e+308 {gloss}\n")
|
| 211 |
+
print(f"Saved {stm_path}")
|
| 212 |
+
|
| 213 |
+
print("\nPreprocessing complete!")
|
| 214 |
+
print(f"Output directory: {output_dir}")
|
| 215 |
+
print("Files generated:")
|
| 216 |
+
print(" - gloss_dict.npy")
|
| 217 |
+
print(" - train_info.npy, dev_info.npy, test_info.npy")
|
| 218 |
+
print(
|
| 219 |
+
f" - {evaluation_prefix}-train.stm, {evaluation_prefix}-dev.stm, {evaluation_prefix}-test.stm"
|
| 220 |
+
)
|
| 221 |
+
|
| 222 |
+
|
| 223 |
+
if __name__ == "__main__":
|
| 224 |
+
parser = argparse.ArgumentParser(
|
| 225 |
+
description="Preprocess YouTubeASL dataset for SMKD (video inputs)."
|
| 226 |
+
)
|
| 227 |
+
parser.add_argument(
|
| 228 |
+
"--manifest-path",
|
| 229 |
+
type=str,
|
| 230 |
+
default="../../../YouTubeASL/video1000size/manifest_top1000.tsv",
|
| 231 |
+
help="Path to manifest_top1000.tsv (relative to scripts/)",
|
| 232 |
+
)
|
| 233 |
+
parser.add_argument(
|
| 234 |
+
"--video-root",
|
| 235 |
+
type=str,
|
| 236 |
+
default="../../../YouTubeASL",
|
| 237 |
+
help="Root for relative CLIP_PATH entries (relative to scripts/)",
|
| 238 |
+
)
|
| 239 |
+
parser.add_argument(
|
| 240 |
+
"--prefix-for-smkd",
|
| 241 |
+
type=str,
|
| 242 |
+
default="",
|
| 243 |
+
help="Prefix stored in info.npy; leave empty to use absolute clip paths",
|
| 244 |
+
)
|
| 245 |
+
parser.add_argument(
|
| 246 |
+
"--output-dir",
|
| 247 |
+
type=str,
|
| 248 |
+
default="../../smkd/youtubeasl",
|
| 249 |
+
help="Output directory for preprocessed files",
|
| 250 |
+
)
|
| 251 |
+
parser.add_argument("--seed", type=int, default=1234, help="Random seed")
|
| 252 |
+
parser.add_argument(
|
| 253 |
+
"--val-size",
|
| 254 |
+
type=int,
|
| 255 |
+
default=300,
|
| 256 |
+
help="Validation split size (by clips)",
|
| 257 |
+
)
|
| 258 |
+
parser.add_argument(
|
| 259 |
+
"--test-size",
|
| 260 |
+
type=int,
|
| 261 |
+
default=100,
|
| 262 |
+
help="Test split size (by clips)",
|
| 263 |
+
)
|
| 264 |
+
parser.add_argument(
|
| 265 |
+
"--frames-root",
|
| 266 |
+
type=str,
|
| 267 |
+
default="../../../YouTubeASL/video1000size_frames",
|
| 268 |
+
help="Root directory containing extracted frames (relative to scripts/).",
|
| 269 |
+
)
|
| 270 |
+
parser.add_argument(
|
| 271 |
+
"--min-frames",
|
| 272 |
+
type=int,
|
| 273 |
+
default=5,
|
| 274 |
+
help="Minimum number of frames required when using extracted frames.",
|
| 275 |
+
)
|
| 276 |
+
parser.add_argument(
|
| 277 |
+
"--evaluation-prefix",
|
| 278 |
+
type=str,
|
| 279 |
+
default="youtubeasl-groundtruth",
|
| 280 |
+
help="Prefix for generated STM files",
|
| 281 |
+
)
|
| 282 |
+
|
| 283 |
+
args = parser.parse_args()
|
| 284 |
+
|
| 285 |
+
prefix_for_smkd = args.prefix_for_smkd if args.prefix_for_smkd else None
|
| 286 |
+
video_root = args.video_root if args.video_root else None
|
| 287 |
+
frames_root = args.frames_root if args.frames_root else None
|
| 288 |
+
min_frames = args.min_frames if args.min_frames else 0
|
| 289 |
+
if frames_root and not prefix_for_smkd:
|
| 290 |
+
prefix_for_smkd = frames_root
|
| 291 |
+
|
| 292 |
+
preprocess_youtubeasl(
|
| 293 |
+
manifest_path=args.manifest_path,
|
| 294 |
+
output_dir=args.output_dir,
|
| 295 |
+
prefix_for_smkd=prefix_for_smkd,
|
| 296 |
+
seed=args.seed,
|
| 297 |
+
val_size=args.val_size,
|
| 298 |
+
test_size=args.test_size,
|
| 299 |
+
video_root=video_root,
|
| 300 |
+
frames_root=frames_root,
|
| 301 |
+
min_frames=min_frames,
|
| 302 |
+
evaluation_prefix=args.evaluation_prefix,
|
| 303 |
+
)
|
plugins/SignX/training_yutubeasl/scripts/2_train_smkd.sh
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Train SMKD feature extractor on YouTubeASL dataset
|
| 4 |
+
# Auto-switches to signx-slt environment (PyTorch)
|
| 5 |
+
|
| 6 |
+
set -e
|
| 7 |
+
|
| 8 |
+
echo "========================================="
|
| 9 |
+
echo "Training SMKD Feature Extractor"
|
| 10 |
+
echo "========================================="
|
| 11 |
+
|
| 12 |
+
SCRIPT_DIR="$(cd -- "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
| 13 |
+
REPO_ROOT="$(cd -- "${SCRIPT_DIR}/../.." && pwd)"
|
| 14 |
+
SMKD_DIR="${REPO_ROOT}/smkd"
|
| 15 |
+
|
| 16 |
+
# Get conda base and activate signx-slt
|
| 17 |
+
CONDA_BASE=$(conda info --base)
|
| 18 |
+
source "${CONDA_BASE}/etc/profile.d/conda.sh"
|
| 19 |
+
|
| 20 |
+
echo "Switching to signx-slt environment (PyTorch)..."
|
| 21 |
+
conda activate signx-slt
|
| 22 |
+
|
| 23 |
+
# Check PyTorch
|
| 24 |
+
python -c "import torch; print('Using PyTorch', torch.__version__)" || {
|
| 25 |
+
echo ""
|
| 26 |
+
echo "ERROR: PyTorch not found in signx-slt environment!"
|
| 27 |
+
echo "Please ensure signx-slt environment has PyTorch installed."
|
| 28 |
+
exit 1
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
echo ""
|
| 32 |
+
echo "✓ Environment ready"
|
| 33 |
+
CFG_PATH="$REPO_ROOT/training_yutubeasl/configs/youtubeasl_smkd.yaml"
|
| 34 |
+
NUM_EPOCHS=$(python - "$CFG_PATH" <<'PY'
|
| 35 |
+
import re, sys
|
| 36 |
+
path = sys.argv[1]
|
| 37 |
+
try:
|
| 38 |
+
text = open(path, 'r', encoding='utf-8').read()
|
| 39 |
+
except Exception:
|
| 40 |
+
print("unknown")
|
| 41 |
+
sys.exit(0)
|
| 42 |
+
m = re.search(r'^\s*num_epoch\s*:\s*(\d+)\s*$', text, re.M)
|
| 43 |
+
print(m.group(1) if m else "unknown")
|
| 44 |
+
PY
|
| 45 |
+
)
|
| 46 |
+
echo "Training time: ~${NUM_EPOCHS} epochs, several hours"
|
| 47 |
+
echo "GPU: Will use device 0"
|
| 48 |
+
echo ""
|
| 49 |
+
|
| 50 |
+
# Navigate to smkd directory
|
| 51 |
+
cd "${SMKD_DIR}"
|
| 52 |
+
|
| 53 |
+
# Decide which GPUs to use (defaults to all visible GPUs on the node)
|
| 54 |
+
TOTAL_GPUS=$(nvidia-smi -L 2>/dev/null | wc -l | tr -d ' ')
|
| 55 |
+
if [ -z "$TOTAL_GPUS" ] || [ "$TOTAL_GPUS" -lt 1 ]; then
|
| 56 |
+
TOTAL_GPUS=1
|
| 57 |
+
fi
|
| 58 |
+
GPU_LIST=${SMKD_GPU_LIST:-$(seq -s, 0 $((TOTAL_GPUS-1)))}
|
| 59 |
+
export CUDA_VISIBLE_DEVICES=${GPU_LIST}
|
| 60 |
+
VISIBLE_GPUS=$(echo "${GPU_LIST}" | awk -F',' '{print NF}')
|
| 61 |
+
NUM_GPUS=${SMKD_NUM_GPUS:-$VISIBLE_GPUS}
|
| 62 |
+
if [ -z "$NUM_GPUS" ] || [ "$NUM_GPUS" -lt 1 ]; then
|
| 63 |
+
NUM_GPUS=1
|
| 64 |
+
fi
|
| 65 |
+
echo "Using CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES}"
|
| 66 |
+
export NCCL_ASYNC_ERROR_HANDLING=1
|
| 67 |
+
export TORCH_NCCL_BLOCKING_WAIT=1
|
| 68 |
+
export NCCL_BLOCKING_WAIT=1
|
| 69 |
+
|
| 70 |
+
COMMON_ARGS="--work-dir work_dir/youtubeasl_smkd --config ../training_yutubeasl/configs/youtubeasl_smkd.yaml --device 0"
|
| 71 |
+
|
| 72 |
+
# Check if resuming from checkpoint
|
| 73 |
+
if [[ -n "${SMKD_RESUME_CHECKPOINT:-}" ]]; then
|
| 74 |
+
echo "Resuming training from checkpoint: ${SMKD_RESUME_CHECKPOINT}"
|
| 75 |
+
COMMON_ARGS="${COMMON_ARGS} --load-checkpoints ${SMKD_RESUME_CHECKPOINT}"
|
| 76 |
+
else
|
| 77 |
+
echo "Training from scratch (no checkpoint)"
|
| 78 |
+
fi
|
| 79 |
+
|
| 80 |
+
if [ "$NUM_GPUS" -gt 1 ]; then
|
| 81 |
+
echo "Launching distributed training on ${NUM_GPUS} GPUs..."
|
| 82 |
+
torchrun --standalone --nproc_per_node=${NUM_GPUS} main.py ${COMMON_ARGS}
|
| 83 |
+
else
|
| 84 |
+
echo "Launching single-GPU training..."
|
| 85 |
+
python main.py ${COMMON_ARGS}
|
| 86 |
+
fi
|
| 87 |
+
|
| 88 |
+
echo ""
|
| 89 |
+
echo "========================================="
|
| 90 |
+
echo "SMKD Training Complete!"
|
| 91 |
+
echo "========================================="
|
| 92 |
+
echo ""
|
| 93 |
+
echo "Checkpoints saved in: smkd/work_dir/youtubeasl_smkd/"
|
| 94 |
+
echo ""
|
| 95 |
+
echo "Next step: bash 3_extract_features.sh"
|
plugins/SignX/training_yutubeasl/scripts/3_extract_features.sh
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Extract SMKD features from trained model
|
| 4 |
+
# Auto-switches to signx-slt environment (PyTorch)
|
| 5 |
+
|
| 6 |
+
set -e
|
| 7 |
+
|
| 8 |
+
echo "========================================="
|
| 9 |
+
echo "Extracting SMKD Features for YouTubeASL"
|
| 10 |
+
echo "========================================="
|
| 11 |
+
|
| 12 |
+
# Get conda base and activate signx-slt
|
| 13 |
+
CONDA_BASE=$(conda info --base)
|
| 14 |
+
source "${CONDA_BASE}/etc/profile.d/conda.sh"
|
| 15 |
+
conda activate signx-slt
|
| 16 |
+
|
| 17 |
+
# Check PyTorch
|
| 18 |
+
python -c "import torch; print('Using PyTorch', torch.__version__)"
|
| 19 |
+
|
| 20 |
+
# Navigate to smkd directory
|
| 21 |
+
cd ../../smkd
|
| 22 |
+
|
| 23 |
+
# Step 1: Checkpoint averaging
|
| 24 |
+
echo ""
|
| 25 |
+
echo "Step 1: Averaging top-5 checkpoints..."
|
| 26 |
+
python ckpt_avg.py \
|
| 27 |
+
--path work_dir/youtubeasl_smkd \
|
| 28 |
+
--checkpoints 5 \
|
| 29 |
+
--output avg
|
| 30 |
+
|
| 31 |
+
# Step 2: Extract sign features
|
| 32 |
+
echo ""
|
| 33 |
+
echo "Step 2: Extracting sign features..."
|
| 34 |
+
python main.py \
|
| 35 |
+
--load-weights avg/average.pt \
|
| 36 |
+
--phase features \
|
| 37 |
+
--device 0 \
|
| 38 |
+
--num-feature-aug 10 \
|
| 39 |
+
--work-dir work_dir/youtubeasl_smkd \
|
| 40 |
+
--config ../training_yutubeasl/configs/youtubeasl_smkd.yaml
|
| 41 |
+
|
| 42 |
+
# Step 3: Combine training features
|
| 43 |
+
echo ""
|
| 44 |
+
echo "Step 3: Combining training features..."
|
| 45 |
+
cd work_dir/youtubeasl_smkd
|
| 46 |
+
python ../../example/sign_feature_cmb.py train*.h5
|
| 47 |
+
|
| 48 |
+
echo ""
|
| 49 |
+
echo "========================================="
|
| 50 |
+
echo "Feature Extraction Complete!"
|
| 51 |
+
echo "========================================="
|
| 52 |
+
echo ""
|
| 53 |
+
echo "Output files:"
|
| 54 |
+
echo " - train.h5, dev.h5, test.h5"
|
| 55 |
+
echo ""
|
| 56 |
+
echo "Next: Prepare text data for SLTUNET (see docs/QUICKSTART.md)"
|
plugins/SignX/training_yutubeasl/scripts/4_train_sltunet.sh
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Train SLTUNET model on YouTubeASL dataset
|
| 4 |
+
# Run this after extract_features.sh completes
|
| 5 |
+
|
| 6 |
+
set -e
|
| 7 |
+
|
| 8 |
+
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
|
| 9 |
+
REPO_ROOT=$(cd "$SCRIPT_DIR/../.." && pwd)
|
| 10 |
+
|
| 11 |
+
# Auto-select a single available GPU (skip GPUs with >20% memory usage)
|
| 12 |
+
echo "========================================="
|
| 13 |
+
echo "Auto-selecting an available GPU..."
|
| 14 |
+
echo "========================================="
|
| 15 |
+
eval $(bash "$SCRIPT_DIR/select_gpus.sh")
|
| 16 |
+
|
| 17 |
+
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
|
| 18 |
+
|
| 19 |
+
# Paths
|
| 20 |
+
data=preprocessed-youtubeasl/
|
| 21 |
+
feature=smkd/work_dir/youtubeasl_smkd/
|
| 22 |
+
|
| 23 |
+
echo "========================================="
|
| 24 |
+
echo "Training SLTUNET on YouTubeASL Dataset"
|
| 25 |
+
echo "========================================="
|
| 26 |
+
|
| 27 |
+
# First, you need to prepare the text data (glosses)
|
| 28 |
+
# Create preprocessed-youtubeasl directory and prepare BPE tokenization
|
| 29 |
+
|
| 30 |
+
echo ""
|
| 31 |
+
echo "Make sure you have:"
|
| 32 |
+
echo "1. Created $data directory"
|
| 33 |
+
echo "2. Prepared BPE tokenized gloss files"
|
| 34 |
+
echo "3. Extracted SMKD features in $feature"
|
| 35 |
+
echo ""
|
| 36 |
+
|
| 37 |
+
# Train SLTUNET model
|
| 38 |
+
# Create log directory
|
| 39 |
+
LOG_DIR="$REPO_ROOT/checkpoints_youtubeasl/logs"
|
| 40 |
+
mkdir -p "$LOG_DIR"
|
| 41 |
+
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
|
| 42 |
+
LOG_FILE="$LOG_DIR/training_${TIMESTAMP}.log"
|
| 43 |
+
|
| 44 |
+
echo "Training logs will be saved to: $LOG_FILE"
|
| 45 |
+
echo "You can monitor the log with: tail -f $LOG_FILE"
|
| 46 |
+
echo ""
|
| 47 |
+
|
| 48 |
+
(cd "$REPO_ROOT" && python run.py --mode train --parameters=\
|
| 49 |
+
hidden_size=256,embed_size=256,filter_size=4096,\
|
| 50 |
+
sep_layer=0,num_encoder_layer=6,num_decoder_layer=6,\
|
| 51 |
+
ctc_enable=True,ctc_alpha=0.3,ctc_repeated=True,\
|
| 52 |
+
src_bpe_dropout=0.2,tgt_bpe_dropout=0.2,bpe_dropout_stochastic_rate=0.6,\
|
| 53 |
+
initializer="uniform_unit_scaling",initializer_gain=0.5,\
|
| 54 |
+
dropout=0.3,label_smooth=0.1,attention_dropout=0.3,relu_dropout=0.5,residual_dropout=0.4,\
|
| 55 |
+
max_len=256,max_img_len=512,batch_size=80,eval_batch_size=32,\
|
| 56 |
+
token_size=1600,batch_or_token='token',beam_size=8,remove_bpe=True,decode_alpha=1.0,\
|
| 57 |
+
scope_name="transformer",buffer_size=50000,data_leak_ratio=0.1,\
|
| 58 |
+
img_feature_size=1024,img_aug_size=10,\
|
| 59 |
+
clip_grad_norm=0.0,\
|
| 60 |
+
num_heads=4,\
|
| 61 |
+
process_num=2,\
|
| 62 |
+
lrate=1.0,\
|
| 63 |
+
estop_patience=100,\
|
| 64 |
+
warmup_steps=4000,\
|
| 65 |
+
epoches=5000,\
|
| 66 |
+
update_cycle=16,\
|
| 67 |
+
gpus=$GPU_LIST,\
|
| 68 |
+
disp_freq=1,\
|
| 69 |
+
eval_freq=100,\
|
| 70 |
+
save_freq=10,\
|
| 71 |
+
sample_freq=10,\
|
| 72 |
+
checkpoints=1,\
|
| 73 |
+
best_checkpoints=1,\
|
| 74 |
+
max_training_steps=30000,\
|
| 75 |
+
nthreads=8,\
|
| 76 |
+
beta1=0.9,\
|
| 77 |
+
beta2=0.998,\
|
| 78 |
+
random_seed=1234,\
|
| 79 |
+
train_continue=True,\
|
| 80 |
+
src_codes="$data/youtubeasl.bpe",tgt_codes="$data/youtubeasl.bpe",\
|
| 81 |
+
src_vocab_file="$data/vocab.youtubeasl",\
|
| 82 |
+
tgt_vocab_file="$data/vocab.youtubeasl",\
|
| 83 |
+
img_train_file="$feature/train.h5",\
|
| 84 |
+
src_train_file="$data/train.bpe.gloss.shuf",\
|
| 85 |
+
tgt_train_file="$data/train.bpe.gloss.shuf",\
|
| 86 |
+
img_dev_file="$feature/dev.h5",\
|
| 87 |
+
src_dev_file="$data/dev.bpe.gloss",\
|
| 88 |
+
tgt_dev_file="$data/dev.bpe.gloss",\
|
| 89 |
+
img_test_file="$feature/test.h5",\
|
| 90 |
+
src_test_file="$data/test.bpe.gloss",\
|
| 91 |
+
tgt_test_file="$data/test.bpe.gloss",\
|
| 92 |
+
output_dir="checkpoints_youtubeasl",\
|
| 93 |
+
test_output="",\
|
| 94 |
+
shared_source_target_embedding=True,\
|
| 95 |
+
collect_attention_weights=False) 2>&1 | tee "$LOG_FILE"
|
plugins/SignX/training_yutubeasl/scripts/prepare_youtubeasl_text.py
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
Prepare YouTubeASL gloss text data for SLTUNET training.
|
| 4 |
+
|
| 5 |
+
Steps:
|
| 6 |
+
1. Load *_info.npy files produced during preprocessing to collect gloss sequences.
|
| 7 |
+
2. Learn BPE merge rules on the training glosses.
|
| 8 |
+
3. Apply BPE to train/dev/test splits.
|
| 9 |
+
4. Add feature indices, shuffle the training split, and build vocabulary files.
|
| 10 |
+
"""
|
| 11 |
+
|
| 12 |
+
import argparse
|
| 13 |
+
import collections
|
| 14 |
+
import io
|
| 15 |
+
import os
|
| 16 |
+
import random
|
| 17 |
+
import sys
|
| 18 |
+
from pathlib import Path
|
| 19 |
+
|
| 20 |
+
import numpy as np
|
| 21 |
+
|
| 22 |
+
# Ensure project root is on sys.path so we can import helper utilities.
|
| 23 |
+
REPO_ROOT = Path(__file__).resolve().parents[2]
|
| 24 |
+
sys.path.append(str(REPO_ROOT))
|
| 25 |
+
|
| 26 |
+
from utils.apply_bpe import BPE # noqa: E402
|
| 27 |
+
from models.vocab import Vocab # noqa: E402
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
def load_gloss_sequences(info_path):
|
| 31 |
+
"""Return gloss strings in dataset order from *_info.npy."""
|
| 32 |
+
info = np.load(info_path, allow_pickle=True).item()
|
| 33 |
+
glosses = []
|
| 34 |
+
ordered_keys = sorted(
|
| 35 |
+
[k for k in info.keys() if k != "prefix"],
|
| 36 |
+
key=lambda x: int(x) if isinstance(x, (int, np.integer)) else int(x)
|
| 37 |
+
)
|
| 38 |
+
for key in ordered_keys:
|
| 39 |
+
entry = info[key]
|
| 40 |
+
gloss = ' '.join(entry.get('label', '').strip().split())
|
| 41 |
+
if not gloss:
|
| 42 |
+
gloss = "<blank>"
|
| 43 |
+
glosses.append(gloss)
|
| 44 |
+
return glosses
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
def build_initial_vocab(lines):
|
| 48 |
+
"""Create initial word->frequency mapping for BPE."""
|
| 49 |
+
vocab = collections.Counter()
|
| 50 |
+
for line in lines:
|
| 51 |
+
for word in line.strip().split():
|
| 52 |
+
symbols = tuple(list(word) + ['</w>'])
|
| 53 |
+
vocab[symbols] += 1
|
| 54 |
+
return vocab
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
def get_pair_stats(vocab):
|
| 58 |
+
"""Count frequency of symbol pairs in the vocabulary."""
|
| 59 |
+
pairs = collections.Counter()
|
| 60 |
+
for word, freq in vocab.items():
|
| 61 |
+
symbols = list(word)
|
| 62 |
+
for i in range(len(symbols) - 1):
|
| 63 |
+
pairs[(symbols[i], symbols[i + 1])] += freq
|
| 64 |
+
return pairs
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
def merge_vocab(pair, vocab):
|
| 68 |
+
"""Merge all occurrences of the provided pair in the vocabulary."""
|
| 69 |
+
new_vocab = {}
|
| 70 |
+
first, second = pair
|
| 71 |
+
pair_str = first + second
|
| 72 |
+
for word, freq in vocab.items():
|
| 73 |
+
symbols = []
|
| 74 |
+
i = 0
|
| 75 |
+
while i < len(word):
|
| 76 |
+
if (i < len(word) - 1) and word[i] == first and word[i + 1] == second:
|
| 77 |
+
symbols.append(pair_str)
|
| 78 |
+
i += 2
|
| 79 |
+
else:
|
| 80 |
+
symbols.append(word[i])
|
| 81 |
+
i += 1
|
| 82 |
+
new_vocab[tuple(symbols)] = freq
|
| 83 |
+
return new_vocab
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
def learn_bpe_merges(train_lines, num_merges):
|
| 87 |
+
vocab = build_initial_vocab(train_lines)
|
| 88 |
+
merges = []
|
| 89 |
+
for _ in range(num_merges):
|
| 90 |
+
stats = get_pair_stats(vocab)
|
| 91 |
+
if not stats:
|
| 92 |
+
break
|
| 93 |
+
best = stats.most_common(1)[0][0]
|
| 94 |
+
vocab = merge_vocab(best, vocab)
|
| 95 |
+
merges.append(best)
|
| 96 |
+
return merges
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
def write_bpe_codes(merges, output_path):
|
| 100 |
+
with open(output_path, 'w', encoding='utf-8') as writer:
|
| 101 |
+
writer.write("#version: 0.2\n")
|
| 102 |
+
for left, right in merges:
|
| 103 |
+
writer.write(f"{left} {right}\n")
|
| 104 |
+
|
| 105 |
+
|
| 106 |
+
def apply_bpe_to_lines(lines, codes_path):
|
| 107 |
+
with open(codes_path, 'r', encoding='utf-8') as reader:
|
| 108 |
+
bpe = BPE(reader, merges=-1, separator='@@', vocab=None, glossaries=None)
|
| 109 |
+
return [bpe.process_line(line.strip()) for line in lines]
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
def write_indexed_file(lines, path, include_index=True):
|
| 113 |
+
"""Write lines to file, optionally with line indices."""
|
| 114 |
+
with open(path, 'w', encoding='utf-8') as writer:
|
| 115 |
+
for idx, line in enumerate(lines):
|
| 116 |
+
if include_index:
|
| 117 |
+
writer.write(f"{idx} {line.strip()}\n")
|
| 118 |
+
else:
|
| 119 |
+
writer.write(f"{line.strip()}\n")
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
def main():
|
| 123 |
+
parser = argparse.ArgumentParser(description="Prepare YouTubeASL gloss text/BPE data.")
|
| 124 |
+
parser.add_argument("--num-merges", type=int, default=1000,
|
| 125 |
+
help="Number of BPE merges to learn (default: 1000)")
|
| 126 |
+
parser.add_argument("--seed", type=int, default=1234, help="Random seed for shuffling.")
|
| 127 |
+
parser.add_argument("--output-dir", type=str, default="preprocessed-youtubeasl",
|
| 128 |
+
help="Output directory for BPE/tokenized files (relative to repo root).")
|
| 129 |
+
parser.add_argument("--info-dir", type=str, default="smkd/youtubeasl",
|
| 130 |
+
help="Directory containing *_info.npy files (relative to repo root).")
|
| 131 |
+
parser.add_argument("--dataset-name", type=str, default="youtubeasl",
|
| 132 |
+
help="Dataset name used for BPE/vocab filenames.")
|
| 133 |
+
args = parser.parse_args()
|
| 134 |
+
|
| 135 |
+
output_dir = REPO_ROOT / args.output_dir
|
| 136 |
+
output_dir.mkdir(parents=True, exist_ok=True)
|
| 137 |
+
|
| 138 |
+
info_dir = REPO_ROOT / args.info_dir
|
| 139 |
+
|
| 140 |
+
splits = {}
|
| 141 |
+
for split in ["train", "dev", "test"]:
|
| 142 |
+
glosses = load_gloss_sequences(info_dir / f"{split}_info.npy")
|
| 143 |
+
splits[split] = glosses
|
| 144 |
+
with open(output_dir / f"{split}.gloss", 'w', encoding='utf-8') as writer:
|
| 145 |
+
writer.write("\n".join(glosses) + "\n")
|
| 146 |
+
|
| 147 |
+
merges = learn_bpe_merges(splits["train"], args.num_merges)
|
| 148 |
+
codes_path = output_dir / f"{args.dataset_name}.bpe"
|
| 149 |
+
write_bpe_codes(merges, codes_path)
|
| 150 |
+
|
| 151 |
+
bpe_lines = {split: apply_bpe_to_lines(glosses, codes_path)
|
| 152 |
+
for split, glosses in splits.items()}
|
| 153 |
+
|
| 154 |
+
# Write BPE files: ALL files WITH indices for uniform data loading
|
| 155 |
+
# Indices will be stripped during BLEU evaluation (not in the data files)
|
| 156 |
+
for split, lines in bpe_lines.items():
|
| 157 |
+
bpe_path = output_dir / f"{split}.bpe.gloss"
|
| 158 |
+
write_indexed_file(lines, bpe_path, include_index=True)
|
| 159 |
+
print(f"Generated {split}.bpe.gloss (with indices)")
|
| 160 |
+
|
| 161 |
+
# Shuffle training split (train.bpe.gloss has indices)
|
| 162 |
+
with open(output_dir / "train.bpe.gloss", encoding='utf-8') as reader:
|
| 163 |
+
train_lines = [line.strip() for line in reader if line.strip()]
|
| 164 |
+
rnd = random.Random(args.seed)
|
| 165 |
+
rnd.shuffle(train_lines)
|
| 166 |
+
with open(output_dir / "train.bpe.gloss.shuf", 'w', encoding='utf-8') as writer:
|
| 167 |
+
writer.write("\n".join(train_lines) + "\n")
|
| 168 |
+
print(f"Generated train.bpe.gloss.shuf (shuffled, with indices)")
|
| 169 |
+
|
| 170 |
+
# Build vocabulary from training tokens (skip the first index column)
|
| 171 |
+
vocab_builder = Vocab()
|
| 172 |
+
with open(output_dir / "train.bpe.gloss", 'r', encoding='utf-8') as reader:
|
| 173 |
+
for line in reader:
|
| 174 |
+
parts = line.strip().split()
|
| 175 |
+
tokens = parts[1:] if len(parts) > 1 else [] # Skip index
|
| 176 |
+
for token in tokens:
|
| 177 |
+
vocab_builder.insert(token)
|
| 178 |
+
vocab_builder.sort_vocab()
|
| 179 |
+
vocab_builder.save_vocab(output_dir / f"vocab.{args.dataset_name}")
|
| 180 |
+
|
| 181 |
+
print("Prepared text data in:", output_dir)
|
| 182 |
+
|
| 183 |
+
|
| 184 |
+
if __name__ == "__main__":
|
| 185 |
+
main()
|
plugins/SignX/training_yutubeasl/scripts/select_gpus.sh
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Auto-select available GPUs based on memory usage
|
| 3 |
+
# Usage: source select_gpus.sh
|
| 4 |
+
# Returns: CUDA_VISIBLE_DEVICES and GPU_LIST for training
|
| 5 |
+
|
| 6 |
+
MEMORY_THRESHOLD=20 # Skip GPUs with >20% memory usage
|
| 7 |
+
MAX_GPUS=1 # Maximum number of GPUs to use
|
| 8 |
+
|
| 9 |
+
# Get GPU info: index, memory_used, memory_total
|
| 10 |
+
gpu_info=$(nvidia-smi --query-gpu=index,memory.used,memory.total --format=csv,noheader,nounits)
|
| 11 |
+
|
| 12 |
+
available_gpus=()
|
| 13 |
+
gpu_list=()
|
| 14 |
+
|
| 15 |
+
while IFS=, read -r idx mem_used mem_total; do
|
| 16 |
+
# Trim whitespace
|
| 17 |
+
idx=$(echo $idx | xargs)
|
| 18 |
+
mem_used=$(echo $mem_used | xargs)
|
| 19 |
+
mem_total=$(echo $mem_total | xargs)
|
| 20 |
+
|
| 21 |
+
# Calculate memory usage percentage
|
| 22 |
+
mem_percent=$(awk "BEGIN {printf \"%.2f\", ($mem_used/$mem_total)*100}")
|
| 23 |
+
|
| 24 |
+
# Check if GPU is available (memory usage < threshold)
|
| 25 |
+
if (( $(awk "BEGIN {print ($mem_percent < $MEMORY_THRESHOLD)}") )); then
|
| 26 |
+
available_gpus+=($idx)
|
| 27 |
+
gpu_list+=($idx)
|
| 28 |
+
echo "GPU $idx: ${mem_percent}% memory used - AVAILABLE" >&2
|
| 29 |
+
else
|
| 30 |
+
echo "GPU $idx: ${mem_percent}% memory used - BUSY (skipped)" >&2
|
| 31 |
+
fi
|
| 32 |
+
|
| 33 |
+
# Stop if we have enough GPUs
|
| 34 |
+
if [ ${#available_gpus[@]} -ge $MAX_GPUS ]; then
|
| 35 |
+
break
|
| 36 |
+
fi
|
| 37 |
+
done <<< "$gpu_info"
|
| 38 |
+
|
| 39 |
+
# Export CUDA_VISIBLE_DEVICES
|
| 40 |
+
if [ ${#available_gpus[@]} -eq 0 ]; then
|
| 41 |
+
echo "ERROR: No available GPUs found!" >&2
|
| 42 |
+
exit 1
|
| 43 |
+
fi
|
| 44 |
+
|
| 45 |
+
export CUDA_VISIBLE_DEVICES=$(IFS=,; echo "${available_gpus[*]}")
|
| 46 |
+
export GPU_LIST="[$(IFS=,; echo "${gpu_list[*]}")]"
|
| 47 |
+
export NUM_GPUS=${#available_gpus[@]}
|
| 48 |
+
|
| 49 |
+
echo "" >&2
|
| 50 |
+
echo "Selected GPUs: $CUDA_VISIBLE_DEVICES" >&2
|
| 51 |
+
echo "GPU List for training: $GPU_LIST" >&2
|
| 52 |
+
echo "Number of GPUs: $NUM_GPUS" >&2
|
| 53 |
+
echo "" >&2
|
| 54 |
+
|
| 55 |
+
# Print variables for sourcing
|
| 56 |
+
echo "export CUDA_VISIBLE_DEVICES=$CUDA_VISIBLE_DEVICES"
|
| 57 |
+
echo "export GPU_LIST='$GPU_LIST'"
|
| 58 |
+
echo "export NUM_GPUS=$NUM_GPUS"
|