File size: 3,937 Bytes
994eaff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9f048f1
994eaff
 
 
 
 
 
 
 
9f048f1
994eaff
 
9f048f1
994eaff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9f048f1
994eaff
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# Local Machine Setup

This guide is the fastest way to run BridgeLink ASL on a fresh Windows machine
for the class demo, local testing, or VLM comparison work.

## 1. Install system prerequisites

### Python

Use **Python 3.11**. MediaPipe has been much more reliable there than on newer
Python versions.

Check:

```powershell
py -3.11 --version
```

If needed, install with:

```powershell
winget install Python.Python.3.11
```

### FFmpeg

Required for Gradio upload / record clip mode.

Check:

```powershell
ffmpeg -version
```

If needed, install with:

```powershell
winget install --id Gyan.FFmpeg -e
```

Restart the terminal after installing FFmpeg.

## 2. Clone the repo and enter it

```powershell
git clone https://github.com/ofra123/BridgeLink-ASL.git
cd BridgeLink-ASL
```

## 3. Create the virtual environment

```powershell
py -3.11 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
```

## 4. Install project dependencies

### For the CNN demo app and tests

```powershell
pip install -r requirements.txt
python -m pip install -e .
python -m pip install pytest
```

### For the local Qwen VLM comparison

```powershell
python -m pip install -e ".[vlm]"
python -m pip install torchvision
```

## 5. Put the trained model files in `models/`

The local app expects these files in the repo `models/` directory:

```text
models/cnn_landmark_best.pt
models/cnn_landmark_wlasl25_best.pt
models/sign_transformer_best.pt
models/labels.json
```

Recommended usage:

- `cnn_landmark_wlasl25_best.pt`: live demo / Hugging Face Space
- `cnn_landmark_best.pt`: main WLASL-100 report model
- `sign_transformer_best.pt`: optional attention-based extension

## 6. Run the live demo locally

Use the smaller WLASL-25 model for the most stable demo:

```powershell
$env:HF_MODEL_FILENAME="cnn_landmark_wlasl25_best.pt"
python app.py
```

Open:

```text
http://127.0.0.1:7860
```

The app supports:

- **Live Webcam**
- **Upload / Record Clip**

## 7. Run the local VLM comparison

The hybrid evaluation set is already committed here:

```text
data/vlm_eval_wlasl25_cnn/wlasl25_cnn_hybrid_eval.jsonl
```

Run the local Qwen reranker:

```powershell
$env:BRIDGELINK_VLM_PROVIDER="local"
$env:BRIDGELINK_VLM_MODEL_ID="Qwen/Qwen2.5-VL-7B-Instruct"

run_wrapper --mode compare --manifest data\vlm_eval_wlasl25_cnn\wlasl25_cnn_hybrid_eval.jsonl --output outputs\vlm_compare_local_fixed.jsonl
```

Current known result on the committed 36-clip eval set:

```text
CNN top-1: 25.0%
CNN top-5: 58.3%
Qwen rerank: 25.0%
```

## 8. Regenerate presentation visuals

```powershell
python scripts\generate_presentation_visuals.py
```

Outputs go to:

```text
presentation/visuals/
```

## 9. Run the test suite

```powershell
python -m pytest -q
```

At the current tested state, this should pass with:

```text
33 passed, 2 warnings
```

## 10. Common troubleshooting

### `mediapipe has no attribute solutions`

You are probably using the wrong Python version or the wrong environment.
Use Python 3.11 and reinstall into `.venv`.

### Webcam works but the caption buffer stays at `0/32`

Check that:

- camera permission is allowed in the browser
- the app is running at `http://127.0.0.1:7860`
- no other app is locking the webcam

### Upload / record clip throws `ffmpeg not found`

Install FFmpeg and restart the terminal:

```powershell
winget install --id Gyan.FFmpeg -e
```

### VLM run says `Torchvision library was not found`

Install torchvision into `.venv`:

```powershell
python -m pip install torchvision
```

### VLM run is very slow

That is expected on CPU. The 7B model may offload to CPU/disk and take a long
time. Keep the VLM for local comparison, not the live Space demo.

## 11. Recommended local demo flow

1. Activate `.venv`
2. Set `HF_MODEL_FILENAME=cnn_landmark_wlasl25_best.pt`
3. Run `python app.py`
4. Test `computer`, `bed`, `help`, `drink`, `yes`
5. Keep a backup recorded demo clip ready