File size: 11,332 Bytes
bbfde3f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# πŸ§ͺ Complete Testing Guide - Step by Step

## Overview

Your system has two parts:
1. **Python Backend** (FastAPI) - Analyzes PowerPoints and generates alt text
2. **Angular Frontend** (Web UI) - Upload interface for users

## βœ… Prerequisites Check

Before starting, verify everything is installed:

```bash

# Backend packages installed?

cd "Cycle 2 Testing/Accessibility-Checker-BE/python-server"

python -c "import fastapi; import transformers; print('βœ… Backend ready')"



# Frontend dependencies installed?

cd "Cycle 2 Testing/Accessibility-Checker"

npm list angular 2>/dev/null | head -3

```

---

## πŸš€ Step 1: Start the Python Backend

### Open Terminal 1 (Backend)

```bash

cd "e:\Local Senior Project\Cycle 2 Testing\Accessibility-Checker-BE\python-server"

python server2.py

```

### Expected Output

```

βœ… Local AI vision model loaded (BLIP - 100% FREE, No Costs)

πŸ“š Loading ISO schema validation...

πŸš€ Uvicorn running on http://127.0.0.1:5000

```

**First run will download BLIP model (~1-2GB, takes 5-15 minutes)**

**Wait for this line before proceeding:**
```

Application startup complete

```

---

## πŸš€ Step 2: Start the Angular Frontend

### Open Terminal 2 (Frontend)

```bash

cd "e:\Local Senior Project\Cycle 2 Testing\Accessibility-Checker"

npm start

```

### Expected Output

```

βœ” Compiled successfully

β„Ή Application bundle generation complete

    Initial Chunk Files   | Names         | Raw Size

    vendor.js             |               | 2.5 MB | 

    main.js               |               | 250 KB |

    ...

βœ” Build at: YYYY-MM-DD HH:MM:SS

βœ” Serving from: .\

Application bundle generation complete

```

### Open in Browser

Once you see "Compiled successfully", open:
```

http://localhost:4200

```

You should see the **Accessibility Checker** web interface.

---

## πŸ“„ Step 3: Create or Get a Test PowerPoint

### Option A: Use Existing PowerPoint
- Look in: `Cycle 2 Testing\Accessibility-Checker-BE\test-docs\`
- Should contain sample PowerPoint files

### Option B: Create Simple Test PowerPoint

**For Windows (using PowerPoint):**
1. Open PowerPoint
2. Create a new presentation
3. Add a slide with:
   - A title (e.g., "Test Slide")
   - An image (any image)
   - Leave the image WITHOUT alt text (that's what we're testing)
4. Save as: `test-presentation.pptx`
5. Save to a convenient location (e.g., Desktop)

**For Windows (using LibreOffice):**
```bash

# Install LibreOffice if needed

# Create presentation with libreoffice

```

**No PowerPoint installed?** Download a sample file from Microsoft Office templates or use the test files that might already exist.

---

## πŸ“€ Step 4: Upload PowerPoint to System

### In the Web Browser (localhost:4200)

1. **Look for "Upload" button**
   - Should be prominent on the page
   - Usually labeled: "Upload PowerPoint" or "Choose File"

2. **Click and select your PowerPoint file**
   - Navigate to your `test-presentation.pptx`
   - Select it and upload

3. **Watch the Backend Console**
   - You should see activity:
   ```

   πŸ”§ Starting alt text remediation for: test-presentation.pptx

      AI Mode: LOCAL (100% FREE - No Costs)

   πŸ€– Using FREE local AI (BLIP) for slide 1

     βœ… AI generated alt text for Picture 1: 'A colorful chart showing...'

   βœ… Remediation complete: 1 images processed

      πŸ€– 1 alt texts generated by FREE local AI (no cost)

   ```

---

## πŸ“Š Step 5: View Results

### In Web Browser

After upload completes, you should see:

1. **Accessibility Report**
   - Summary of issues found
   - Number of images without alt text
   - List of missing/bad alt text descriptions

2. **Sample Report Output**
   ```

   FILE ANALYSIS RESULTS

   ━━━━━━━━━━━━━━━━━━━━━━━━━

   

   βœ… Issues Fixed: 1

   ⚠️  Issues Flagged: 0

   

   Image Alt Text Status:

   β€’ Slide 1 - Picture 1: "Bar chart with increasing values"

   ```

3. **Response JSON** (in browser console)
   ```json

   {

     "fileName": "test-presentation.pptx",

     "suggestedFileName": "remediated-test-presentation.pptx",

     "report": {

       "summary": { "fixed": 1, "flagged": 0 },

       "details": {

         "imagesMissingOrBadAlt": []

       }

     }

   }

   ```

---

## πŸ’Ύ Step 6: Download Remediated File

### In Web Browser

1. **Look for "Download" button**
   - Usually appears after upload
   - Text might be: "Download Remediated PowerPoint" or "Download Fixed File"

2. **Click to download**
   - File will save locally as: `remediated-test-presentation.pptx`

3. **Open downloaded file in PowerPoint**
   ```

   Right-click image β†’ Properties β†’ Alt Text

   ```

4. **Verify alt text was added**
   - Should see the AI-generated description
   - Example: "Bar chart with increasing values"

---

## βœ… Verification Checklist

After completing all steps, check:

### Backend Console Should Show
- βœ… `βœ… Local AI vision model loaded`
- βœ… `πŸ€– Using FREE local AI (BLIP) for slide X`
- βœ… `βœ… AI generated alt text for Picture X`
- βœ… `βœ… Remediation complete: X images processed`
- βœ… `πŸ€– X alt texts generated by FREE local AI`

### Downloaded File Should Have
- βœ… Original PowerPoint content preserved
- βœ… New alt text on all previously missing images
- βœ… Alt text is descriptive (not just "image" or "picture")
- βœ… File can be opened normally in PowerPoint

### Cost Should Be
- βœ… **$0.00** - No API charges
- βœ… No internet calls after first model download
- βœ… Everything local and private

---

## πŸ› Troubleshooting

### "Server not responding" / "Cannot connect to localhost:5000"
**Solution:**
1. Check Terminal 1 - is backend still running?
2. Look for errors in backend output
3. Restart backend: `Ctrl+C` then `python server2.py`
4. Wait for "Application startup complete"

### "Frontend not loading" / "Cannot access localhost:4200"
**Solution:**
1. Check Terminal 2 - is frontend still running?
2. Open http://localhost:4200 in browser
3. Check browser console for errors (F12)
4. Restart frontend: `Ctrl+C` then `npm start`

### "Model downloading..." for more than 20 minutes
**This is normal for first run!** Downloading 1-2GB takes time.
```

βœ” First run: 5-15 minutes (downloading BLIP model)

βœ” Subsequent runs: Instant (model cached)

```

### "AI not generating alt text" / Empty descriptions
**Check:**
1. Are images in PowerPoint actually visible?
2. Are images in supported formats (PNG, JPG)?
3. Try `python test_ai_setup.py` to verify AI works
4. Check backend console for error messages

### "Upload button doesn't appear"
**Solution:**
1. Check if frontend has compiled (look for "Compiled successfully")
2. Hard refresh browser: `Ctrl+Shift+R`
3. Open browser DevTools: `F12` β†’ Console
4. Look for JavaScript errors

### "Downloaded file won't open"
**Solution:**
1. Check file size - should be similar to original
2. Try opening with different PowerPoint version
3. Check if file is corrupted - reupload
4. Look at backend logs for errors

---

## πŸ“Š What to Expect: Real Example

### Input PowerPoint
- 3 slides
- 5 images total
- 0 images have alt text

### System Processing
```

πŸ”§ Starting alt text remediation for: sample.pptx

   AI Mode: LOCAL (100% FREE - No Costs)

πŸ€– Using FREE local AI (BLIP) for slide 1

  βœ… AI generated alt text for Picture 1: 'Professional man in business suit'

  βœ… AI generated alt text for Picture 2: 'Bar graph with red and blue columns'

πŸ€– Using FREE local AI (BLIP) for slide 2

  βœ… AI generated alt text for Picture 3: 'Team meeting in conference room'

  βœ… AI generated alt text for Picture 4: 'Laptop displaying code editor'

πŸ€– Using FREE local AI (BLIP) for slide 3

  βœ… AI generated alt text for Picture 5: 'Company logo on blue background'

βœ… Remediation complete: 5 images processed

   πŸ€– 5 alt texts generated by FREE local AI (no cost)

```

### Output PowerPoint
- Same 3 slides, all images
- All 5 images now have descriptive alt text
- File works exactly like original
- **Cost: $0.00** πŸŽ‰

---

## 🎯 Testing Scenarios

### Test 1: Basic Image (Easy)
1. PowerPoint with 1 simple image
2. Expected: Describe what's in image
3. Example: "Logo design with blue colors"

### Test 2: Multiple Images (Medium)
1. PowerPoint with 3-5 images on different slides
2. Expected: Each gets unique description
3. Verify: All descriptions are different

### Test 3: Complex Presentation (Advanced)
1. Real presentation with charts, photos, logos
2. Expected: All get meaningful descriptions
3. Verify: Chart descriptions mention data/trends

---

## πŸ“± What The System Actually Does

### Internally
1. **Receives PowerPoint** β†’ Unzips to XML
2. **Finds images** β†’ Extracts from ZIP
3. **Analyzes images** β†’ Uses local BLIP AI model
4. **Generates descriptions** β†’ Creates alt text
5. **Updates XML** β†’ Adds alt text to image properties
6. **Repackages** β†’ Zips back into PowerPoint
7. **Delivers file** β†’ User downloads fixed PowerPoint

### Data Flow
```

User PowerPoint

    ↓

Backend receives file

    ↓

Extract images from PowerPoint ZIP

    ↓

Send to LOCAL BLIP AI (runs on your computer)

    ↓

AI analyzes images

    ↓

AI generates descriptions

    ↓

Insert descriptions into PowerPoint XML

    ↓

Package back into PowerPoint file

    ↓

User downloads remediated file

```

**Key Point**: Everything runs locally - images never sent to internet!

---

## πŸ’‘ Tips for Best Results

1. **Use clear, simple images** - More likely to get good descriptions
2. **Include variety** - Test with photos, charts, logos
3. **Check backend console** - Understand what AI is doing
4. **Read descriptions carefully** - Verify they're accurate
5. **Edit if needed** - AI descriptions are starting point, not final

---

## πŸš€ Next Steps After Testing

Once you verify everything works:

1. **Test with real presentations** from your team
2. **Collect feedback** - Is AI quality good enough?
3. **Adjust if needed** - Can tweak model in `.env`
4. **Deploy** - Set up on server for team to use
5. **Monitor costs** - Should always be $0 (local AI)

---

## πŸ“ž Still Having Issues?

Check these in order:

1. **Backend running?** Terminal 1 shows "Application startup complete"
2. **Frontend running?** Terminal 2 shows "Compiled successfully"
3. **Both on correct ports?** Backend: 5000, Frontend: 4200
4. **Firewall blocking?** Windows Firewall might block local connections
5. **AI downloaded?** First run takes 5-15 min for BLIP model

If still stuck, check the **console output** - that's where errors appear!

---

## πŸŽ‰ Success Criteria

βœ… Backend starts without errors  
βœ… Frontend loads in browser  
βœ… Can upload PowerPoint file  
βœ… System processes file (backend shows activity)  
βœ… Can download remediated file  
βœ… Downloaded file has alt text  
βœ… Alt text is descriptive (not generic)  
βœ… Cost is $0.00 (local AI only)  

If all boxes checked β†’ **Your system works!** πŸš€