Spaces:
Runtime error
Runtime error
Commit ·
f5831ec
1
Parent(s): 8c0e97b
task: readme update. taking notes
Browse files- README.md +4 -161
- src/sdg.ipynb +9 -0
README.md
CHANGED
|
@@ -106,24 +106,16 @@ ImagineUI/
|
|
| 106 |
|
| 107 |
### Problem:
|
| 108 |
|
| 109 |
-
I want a tool that can
|
| 110 |
|
| 111 |
### Audience:
|
| 112 |
|
| 113 |
-
This app is for designers and non-designers who want to
|
| 114 |
-
|
| 115 |
-
- Styling a resume using a standardized template
|
| 116 |
-
- Brand designers who want to iterate through ideas
|
| 117 |
-
- Writers who want to present content in a visually engaging way
|
| 118 |
-
- Creators of presentations and educational materials
|
| 119 |
-
- Small business owners creating marketing materials
|
| 120 |
-
|
| 121 |
-
The app will be particularly useful for cross-disciplinary web development teams discussing design concepts with stakeholders, to provide visual reference and preliminary materials for designs.
|
| 122 |
|
| 123 |
|
| 124 |
## Solution
|
| 125 |
|
| 126 |
-
An agentic RAG application
|
| 127 |
|
| 128 |
### Tools
|
| 129 |
|
|
@@ -136,14 +128,13 @@ f: Evaluation
|
|
| 136 |
g: User Interface
|
| 137 |
h: Serving & Inference (optional)
|
| 138 |
|
| 139 |
-
Describe use of agents
|
| 140 |
|
| 141 |
# **Data Collection & Dataset Creation**
|
| 142 |
|
| 143 |
### Dataset Format
|
| 144 |
```json
|
| 145 |
{
|
| 146 |
-
"id": "
|
| 147 |
"html_template": "path/to/template.html",
|
| 148 |
"css_style": "path/to/style.css",
|
| 149 |
"screenshots": {
|
|
@@ -158,151 +149,3 @@ Describe use of agents
|
|
| 158 |
}
|
| 159 |
}
|
| 160 |
```
|
| 161 |
-
|
| 162 |
-
### Data Collection Process
|
| 163 |
-
1. **Web Scraping**
|
| 164 |
-
- Scrape CSS Zen Garden submissions
|
| 165 |
-
- Collect associated screenshots
|
| 166 |
-
- Extract design descriptions
|
| 167 |
-
|
| 168 |
-
2. **Manual Curation**
|
| 169 |
-
- Review and categorize styles
|
| 170 |
-
- Validate HTML/CSS combinations
|
| 171 |
-
- Add detailed annotations
|
| 172 |
-
|
| 173 |
-
3. **Automated Processing**
|
| 174 |
-
- Generate screenshots across viewports
|
| 175 |
-
- Extract color schemes
|
| 176 |
-
- Calculate accessibility scores
|
| 177 |
-
|
| 178 |
-
4. **Quality Assurance**
|
| 179 |
-
- Validate file integrity
|
| 180 |
-
- Check completeness of metadata
|
| 181 |
-
- Verify screenshot quality
|
| 182 |
-
|
| 183 |
-
### Usage Guidelines
|
| 184 |
-
- Dataset is available under MIT License
|
| 185 |
-
- Proper attribution required for CSS Zen Garden content
|
| 186 |
-
- Screenshots may be used for training and testing
|
| 187 |
-
- Metadata can be extended with additional annotations
|
| 188 |
-
|
| 189 |
-
# **Build**
|
| 190 |
-
|
| 191 |
-
## **Problem Worth Solving**
|
| 192 |
-
Designing and styling web pages requires both creative and technical skills. Many developers and designers struggle with:
|
| 193 |
-
- Translating verbal descriptions into CSS styling.
|
| 194 |
-
- Rapidly prototyping and iterating on web layouts.
|
| 195 |
-
- Learning from real-world design patterns without extensive manual effort.
|
| 196 |
-
|
| 197 |
-
An **agentic CSS style creator** can bridge the gap by understanding style requests, generating layouts, and applying creative yet functional CSS designs.
|
| 198 |
-
|
| 199 |
-
## **Potential LLM Solution**
|
| 200 |
-
- **Multi-modal learning**: Utilize a dataset of CSS styles (from CSS Zen Garden) and their corresponding rendered outputs (screenshots).
|
| 201 |
-
- **RAG-enhanced retrieval**: Combine existing UI pattern descriptions with CSS rules for better style understanding.
|
| 202 |
-
- **Agentic workflow**: Allow the model to iteratively improve its design based on user feedback, tweaking layouts and styles dynamically.
|
| 203 |
-
- **Dual input approach**: Users can either submit their own HTML or allow the agent to generate a basic layout.
|
| 204 |
-
|
| 205 |
-
## **Target Audience**
|
| 206 |
-
- **Frontend Developers** who need quick style prototypes.
|
| 207 |
-
- **UI/UX Designers** looking to explore creative styles.
|
| 208 |
-
- **No-Code/Low-Code Builders** who want AI-powered styling.
|
| 209 |
-
- **Beginner Developers** learning CSS through interactive examples.
|
| 210 |
-
|
| 211 |
-
## **Key Metrics**
|
| 212 |
-
1. **Styling Accuracy** – How closely does the CSS match the user's description?
|
| 213 |
-
2. **Creativity & Uniqueness** – Does it produce diverse and visually appealing results?
|
| 214 |
-
3. **Functional Usability** – Are the generated styles accessible and responsive?
|
| 215 |
-
4. **Iteration Success** – Does the model effectively refine the layout based on feedback?
|
| 216 |
-
5. **RAGAS Scores** – To evaluate retrieval quality and grounding accuracy.
|
| 217 |
-
|
| 218 |
-
## **Data Sources for RAG and Fine-Tuning**
|
| 219 |
-
- **CSS Zen Garden Stylesheets** – To learn various aesthetic interpretations.
|
| 220 |
-
- **Screenshots of Zen Garden pages** – For multi-modal association between styles and visuals.
|
| 221 |
-
- **UI Pattern Dataset (with descriptions)** – To enhance textual understanding of design patterns.
|
| 222 |
-
- **Generated CSS & User Feedback Loops** – To improve iteration quality.
|
| 223 |
-
|
| 224 |
-
---
|
| 225 |
-
|
| 226 |
-
# **Share**
|
| 227 |
-
|
| 228 |
-
## **Online Communities to Share Your Project In**
|
| 229 |
-
- **r/web_design & r/frontend on Reddit** – Great for frontend developers and designers.
|
| 230 |
-
- **Twitter/X (Hashtags: #CSS, #AI, #WebDev)** – To engage with the dev community.
|
| 231 |
-
- **Dev.to & Hashnode** – For technical write-ups and project showcases.
|
| 232 |
-
- **CodePen & Frontend Mentor Discords** – Where designers and developers share web experiments.
|
| 233 |
-
- **LinkedIn Web Development Groups** – For professional feedback.
|
| 234 |
-
|
| 235 |
-
### **Best Time to Share**
|
| 236 |
-
- **Reddit**: 12 PM - 3 PM EST (high activity for tech subreddits).
|
| 237 |
-
- **Twitter/X**: 9 AM - 12 PM PST (when devs engage most).
|
| 238 |
-
- **Dev.to / Hashnode**: Post in the morning for better visibility.
|
| 239 |
-
- **LinkedIn**: 8 AM - 10 AM EST (when professionals browse feeds).
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
### CSS Zen Garden Scraping Tools
|
| 243 |
-
|
| 244 |
-
1. **Python-based Tools**
|
| 245 |
-
- **Scrapy**
|
| 246 |
-
- Robust framework for large-scale scraping
|
| 247 |
-
- Handles JavaScript rendering
|
| 248 |
-
- Built-in pipeline for downloading files
|
| 249 |
-
```python
|
| 250 |
-
class ZenGardenSpider(scrapy.Spider):
|
| 251 |
-
name = 'zengarden'
|
| 252 |
-
start_urls = ['http://www.csszengarden.com/']
|
| 253 |
-
|
| 254 |
-
def parse(self, response):
|
| 255 |
-
for design in response.css('.design-selection li'):
|
| 256 |
-
yield {
|
| 257 |
-
'title': design.css('a::text').get(),
|
| 258 |
-
'css_url': design.css('a::attr(href)').get(),
|
| 259 |
-
'designer': design.css('.designer::text').get()
|
| 260 |
-
}
|
| 261 |
-
```
|
| 262 |
-
|
| 263 |
-
- **Beautiful Soup 4**
|
| 264 |
-
- Simpler alternative for static content
|
| 265 |
-
- Good for parsing HTML/CSS structure
|
| 266 |
-
- Easy integration with requests library
|
| 267 |
-
|
| 268 |
-
2. **Browser Automation**
|
| 269 |
-
- **Playwright**
|
| 270 |
-
- Modern alternative to Selenium
|
| 271 |
-
- Better performance
|
| 272 |
-
- Built-in screenshot and PDF generation
|
| 273 |
-
|
| 274 |
-
3. **CSS Processing Tools**
|
| 275 |
-
- **PostCSS**
|
| 276 |
-
- Parses and analyzes CSS
|
| 277 |
-
- Extracts color schemes
|
| 278 |
-
- Identifies design patterns
|
| 279 |
-
- **StyleStats**
|
| 280 |
-
- Generates CSS analytics
|
| 281 |
-
- Measures complexity
|
| 282 |
-
- Reports accessibility metrics
|
| 283 |
-
|
| 284 |
-
### Scraping Process
|
| 285 |
-
|
| 286 |
-
1. **Initial Setup**
|
| 287 |
-
```bash
|
| 288 |
-
pip install scrapy beautifulsoup4 selenium playwright postcss-py
|
| 289 |
-
```
|
| 290 |
-
|
| 291 |
-
2. **Data Collection Steps**
|
| 292 |
-
- Fetch main gallery page
|
| 293 |
-
- Extract design links and metadata
|
| 294 |
-
- Download CSS files
|
| 295 |
-
- Capture screenshots at different viewports
|
| 296 |
-
- Parse and analyze CSS properties
|
| 297 |
-
|
| 298 |
-
3. **Legal Considerations**
|
| 299 |
-
- Respect robots.txt
|
| 300 |
-
- Include appropriate delays between requests
|
| 301 |
-
- Store attribution information
|
| 302 |
-
- Follow CSS Zen Garden's terms of use
|
| 303 |
-
|
| 304 |
-
4. **Data Validation**
|
| 305 |
-
- Verify CSS file integrity
|
| 306 |
-
- Check image quality
|
| 307 |
-
- Validate HTML structure
|
| 308 |
-
- Ensure complete metadata
|
|
|
|
| 106 |
|
| 107 |
### Problem:
|
| 108 |
|
| 109 |
+
I want a tool that can show me examples of a design I'm imagining.
|
| 110 |
|
| 111 |
### Audience:
|
| 112 |
|
| 113 |
+
This app is for designers and non-designers who want to be inspired and see examples of good style design.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
|
| 116 |
## Solution
|
| 117 |
|
| 118 |
+
An agentic RAG application that scrapes designs from CSS Zen Garden and serves the best matches to the user.
|
| 119 |
|
| 120 |
### Tools
|
| 121 |
|
|
|
|
| 128 |
g: User Interface
|
| 129 |
h: Serving & Inference (optional)
|
| 130 |
|
|
|
|
| 131 |
|
| 132 |
# **Data Collection & Dataset Creation**
|
| 133 |
|
| 134 |
### Dataset Format
|
| 135 |
```json
|
| 136 |
{
|
| 137 |
+
"id": "001",
|
| 138 |
"html_template": "path/to/template.html",
|
| 139 |
"css_style": "path/to/style.css",
|
| 140 |
"screenshots": {
|
|
|
|
| 149 |
}
|
| 150 |
}
|
| 151 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/sdg.ipynb
CHANGED
|
@@ -726,6 +726,15 @@
|
|
| 726 |
"\n",
|
| 727 |
"\n"
|
| 728 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 729 |
}
|
| 730 |
],
|
| 731 |
"metadata": {
|
|
|
|
| 726 |
"\n",
|
| 727 |
"\n"
|
| 728 |
]
|
| 729 |
+
},
|
| 730 |
+
{
|
| 731 |
+
"cell_type": "markdown",
|
| 732 |
+
"metadata": {},
|
| 733 |
+
"source": [
|
| 734 |
+
"This isn't ideal, since our RAG use case is to subjectively show examples of good design. Our users won't be asking questions or looking for specific answers.\n",
|
| 735 |
+
"\n",
|
| 736 |
+
"We may still be able to use evaluators to illustrate direction changes, but what we really need is a test data set showing retrievals of designs that fit the description. This likely needs to be manually curated to ensure the returned design fits and represents a good example."
|
| 737 |
+
]
|
| 738 |
}
|
| 739 |
],
|
| 740 |
"metadata": {
|