--- dataset_info: features: - name: text dtype: string - name: description dtype: string - name: input dtype: string - name: output dtype: string - name: png_processed dtype: bool - name: png_data dtype: binary - name: caption dtype: string splits: - name: train num_bytes: 4277825421.633942 num_examples: 161484 - name: test num_bytes: 225171014.366058 num_examples: 8500 download_size: 4082118033 dataset_size: 4502996436.0 configs: - config_name: default data_files: - split: train path: data/train-* - split: test path: data/test-* --- # SVG to PNG Rendered Dataset ## Dataset Summary This dataset is a processed version of the [svgen-500k-instruct](https://huggingface.co/datasets/umuthopeyildirim/svgen-500k-instruct) dataset, where SVG images have been converted to PNG format for easier consumption in computer vision and machine learning pipelines. Each successfully converted image maintains the original SVG's visual representation while providing a standardized raster format. ## Data Fields - `caption`: Image captions generated using Salesforce's BLIP model - `png_processed`: Boolean flag indicating whether the conversion was successful - `png_data`: Base64 encoded PNG data (for successful conversions) or None (for failed conversions) - All original fields from source dataset are preserved ## Dataset Creation ### Source Data - Original Dataset: [svgen-500k-instruct](https://huggingface.co/datasets/umuthopeyildirim/svgen-500k-instruct) - Processing Script: will upload later ### Processing - SVGs are converted to PNGs using CairoSVG - Each PNG is validated to ensure image integrity - Failed conversions are tracked but maintain dataset alignment - Parallel processing is used for efficient conversion - Full binary PNG data is stored as base64 encoded strings for successful conversions - Image captions are generated using Salesforce's BLIP model ### Technical Details - Image Format: PNG - Color Space: RGBA - Conversion Tool: CairoSVG - Validation: PIL/Pillow image verification - Data Storage: Base64 encoded format within HuggingFace Dataset structure - Caption Generation: Salesforce BLIP model ## Usage ### Loading the Dataset ```python from datasets import load_dataset dataset = load_dataset("thesantatitan/svg-rendered") ``` ### Accessing Images ```python # Check if conversion was successful if dataset[0]['png_processed']: # Load PNG data into PIL Image from PIL import Image import io import base64 # Decode base64 data png_bytes = base64.b64decode(dataset[0]['png_data']) image = Image.open(io.BytesIO(png_bytes)) # Access the caption caption = dataset[0]['caption'] print(f"Image caption: {caption}") ``` ## Limitations and Considerations - Not all SVGs may convert successfully due to complexity or formatting issues - PNG format increases storage requirements compared to original SVGs - Some SVG features (like animations) are not preserved in PNG conversion - Dataset size varies based on conversion success rate - Generated captions may not always accurately represent the image content ## Additional Information ### Dataset Size - Original Dataset Size: 500k examples - Storage Requirements: Significantly larger than original due to PNG binary storage ### Citation If you use this dataset, please cite both this dataset and the original svgen-500k-instruct dataset: ```bibtex @misc{svg-rendered, author = {[Your Name]}, title = {SVG to PNG Rendered Dataset}, year = {2024}, publisher = {HuggingFace}, url = {https://huggingface.co/datasets/thesantatitan/svg-rendered} } ``` ### Feedback and Contributions For issues, suggestions, or contributions, please visit the dataset repository on HuggingFace. ### Acknowledgments - Original dataset creators: umuthopeyildirim - CairoSVG library for SVG conversion - HuggingFace for dataset hosting - Salesforce for the BLIP image captioning model