Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# AI Alt Tag Generator
|
2 |
+
|
3 |
+
**AI-powered alt tag generation for web accessibility** - Making the web accessible for everyone!
|
4 |
+
|
5 |
+
## β¨ Features
|
6 |
+
|
7 |
+
- π **Fast Generation**: 0.5-2 seconds per image
|
8 |
+
- π― **5 Alt Tag Styles**: Short, Medium, Long, Accessibility, SEO
|
9 |
+
- π **89 Languages**: Multilingual support via Google Translate
|
10 |
+
- β‘ **GPU Acceleration**: Automatic CUDA detection and fallback
|
11 |
+
- βΏ **WCAG 2.1 AA**: Compliance-focused alt text generation
|
12 |
+
|
13 |
+
## π Quick Start
|
14 |
+
|
15 |
+
### Installation
|
16 |
+
|
17 |
+
```bash
|
18 |
+
pip install -r requirements.txt
|
19 |
+
```
|
20 |
+
|
21 |
+
### Basic Usage
|
22 |
+
|
23 |
+
```python
|
24 |
+
from alt_tag_generator import AltTagGenerator
|
25 |
+
|
26 |
+
# Initialize generator
|
27 |
+
generator = AltTagGenerator()
|
28 |
+
|
29 |
+
# Generate alt tags for an image
|
30 |
+
results = generator.generate_alt_tags("https://example.com/image.jpg")
|
31 |
+
|
32 |
+
# Display results
|
33 |
+
generator.display_results(results)
|
34 |
+
```
|
35 |
+
|
36 |
+
### Output Example
|
37 |
+
|
38 |
+
```
|
39 |
+
ALT TAG RESULTS
|
40 |
+
==================================================
|
41 |
+
Source: https://example.com/cat.jpg
|
42 |
+
Size: (800, 600)
|
43 |
+
Caption: a cat sitting on a table
|
44 |
+
Device: cuda
|
45 |
+
Time: 1.23s
|
46 |
+
Confidence: 0.85
|
47 |
+
|
48 |
+
ALT TAG VARIATIONS:
|
49 |
+
------------------------------
|
50 |
+
SHORT: cat sitting table
|
51 |
+
MEDIUM: cat sitting on table
|
52 |
+
LONG: cat sitting on a table
|
53 |
+
ACCESSIBILITY: Image shows cat sitting on a table
|
54 |
+
SEO: cat sitting table
|
55 |
+
==================================================
|
56 |
+
```
|
57 |
+
|
58 |
+
## π§ͺ Testing
|
59 |
+
|
60 |
+
Run the built-in demo:
|
61 |
+
|
62 |
+
```python
|
63 |
+
from alt_tag_generator import quick_demo
|
64 |
+
quick_demo()
|
65 |
+
```
|
66 |
+
|
67 |
+
## π Performance
|
68 |
+
|
69 |
+
- **Speed**: 0.5-2 seconds per image
|
70 |
+
- **Memory**: ~1GB GPU VRAM (or 2GB RAM for CPU)
|
71 |
+
- **Model Size**: ~990MB download
|
72 |
+
- **Accuracy**: 85%+ typical confidence
|
73 |
+
- **Languages**: 89 supported languages
|
74 |
+
|
75 |
+
## π οΈ System Requirements
|
76 |
+
|
77 |
+
### Minimum Requirements
|
78 |
+
- Python 3.8+
|
79 |
+
- 4GB RAM
|
80 |
+
- 2GB disk space
|
81 |
+
|
82 |
+
### Recommended Requirements
|
83 |
+
- Python 3.10+
|
84 |
+
- 8GB RAM
|
85 |
+
- NVIDIA GPU with 4GB+ VRAM
|
86 |
+
- 10GB disk space
|
87 |
+
|
88 |
+
## π License
|
89 |
+
|
90 |
+
This project is licensed under the MIT License.
|
91 |
+
|
92 |
+
## π Acknowledgments
|
93 |
+
|
94 |
+
- **Salesforce BLIP**: For the amazing image captioning model
|
95 |
+
- **Hugging Face**: For the transformers library and model hosting
|
96 |
+
- **Accessibility Community**: For guidance on WCAG compliance
|
97 |
+
|
98 |
+
---
|
99 |
+
|
100 |
+
**Made with love for web accessibility by [abhilash88](https://huggingface.co/abhilash88)**
|
101 |
+
|
102 |
+
*"Making the web accessible for everyone, one image at a time."*
|