Upload 2 files
Browse files
README.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Geometric Shapes Dataset
|
| 2 |
+
|
| 3 |
+
This dataset contains procedurally generated images of various geometric shapes with corresponding captions. It's designed for educational purposes and testing of diffusion models.
|
| 4 |
+
|
| 5 |
+
## Dataset Overview
|
| 6 |
+
|
| 7 |
+
- **Content**: 100,000 images of geometric shapes with detailed metadata
|
| 8 |
+
- **Image size**: 512x512 pixels
|
| 9 |
+
- **Format**: PNG images with CSV metadata
|
| 10 |
+
- **Features**: Various shapes, colors, sizes, and descriptive captions
|
| 11 |
+
- **Purpose**: Educational use for training and testing single-step diffusion models
|
| 12 |
+
|
| 13 |
+
## Dataset Creation
|
| 14 |
+
|
| 15 |
+
The dataset was generated using the included Python script (`create_dataset.py`), which was created with the assistance of Claude AI (Anthropic). The script generates a wide variety of geometric shapes with different properties:
|
| 16 |
+
|
| 17 |
+
- **Shapes**: 50+ different shapes including basic shapes (circle, square, triangle) and more complex ones (hypocycloid, lemniscate, star)
|
| 18 |
+
- **Colors**: 30 different colors with their hex values
|
| 19 |
+
- **Sizes**: Randomly scaled from 10% to 100% with corresponding descriptive terms
|
| 20 |
+
- **Captions**: Diverse, randomly generated descriptions of the shapes in various formats
|
| 21 |
+
|
| 22 |
+
## Usage
|
| 23 |
+
|
| 24 |
+
### Using the Dataset
|
| 25 |
+
|
| 26 |
+
This dataset is designed for educational purposes only. It's particularly useful for:
|
| 27 |
+
|
| 28 |
+
- Learning to build diffusion models from scratch
|
| 29 |
+
- Experimenting with simple image-to-text and text-to-image models
|
| 30 |
+
- Testing model performance on synthetic data
|
| 31 |
+
- Educational demonstrations of computer vision concepts
|
| 32 |
+
|
| 33 |
+
### OPTIONAL - If you want to createw youe own images
|
| 34 |
+
|
| 35 |
+
If you want to generate your own version of the dataset or modify the parameters:
|
| 36 |
+
|
| 37 |
+
1. Install the required dependencies:
|
| 38 |
+
```bash
|
| 39 |
+
pip install numpy matplotlib tqdm
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
2. Run the script:
|
| 43 |
+
create a folder "geometric_shapes", and save create_dataset.py the in the folder, and execute it
|
| 44 |
+
```bash
|
| 45 |
+
python create_dataset.py
|
| 46 |
+
```
|
| 47 |
+
```
|
| 48 |
+
Generating Images: 100%|█████████████████████████████████████████████████| 100000/100000 [07:36<00:00, 218.96it/s]
|
| 49 |
+
Generated 100000 images in 456.89 seconds
|
| 50 |
+
Size: 100000 images
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
3. By default, the script will:
|
| 54 |
+
- Generate 100,000 images in the `dataset/images` directory
|
| 55 |
+
- Create a `dataset/metadata.csv` file with image filenames and captions
|
| 56 |
+
- Use 10 CPU cores for parallel processing
|
| 57 |
+
|
| 58 |
+
4. You can modify these parameters in the `__main__` section of the script:
|
| 59 |
+
```python
|
| 60 |
+
generate_images_multiprocess(
|
| 61 |
+
num_images=100000, # Change this number to generate fewer/more images
|
| 62 |
+
max_workers=10, # Change based on your CPU cores
|
| 63 |
+
img_size=(512, 512) # Modify image dimensions
|
| 64 |
+
)
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
5. Ensure your dataset is organized as follows:
|
| 68 |
+
|
| 69 |
+
```
|
| 70 |
+
geometric_shapes/
|
| 71 |
+
├── README.md
|
| 72 |
+
├── create_dataset.py
|
| 73 |
+
├── dataset/
|
| 74 |
+
│ ├── images_001/
|
| 75 |
+
│ │ ├── image1.jpg
|
| 76 |
+
│ │ ├── image2.jpg
|
| 77 |
+
│ │ ├── ...
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
6. Upload Instructions
|
| 81 |
+
|
| 82 |
+
Log in to Hugging Face:
|
| 83 |
+
|
| 84 |
+
```sh
|
| 85 |
+
huggingface-cli login
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
Upload the dataset:
|
| 89 |
+
|
| 90 |
+
```sh
|
| 91 |
+
cd .. && huggingface-cli upload-large-folder anokimchen/geometric_shapes geometric_shapes --repo-type dataset && cd geometric_shapes
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
## License
|
| 95 |
+
|
| 96 |
+
This dataset is provided for educational and research purposes only.
|
| 97 |
+
|
| 98 |
+
## Acknowledgements
|
| 99 |
+
|
| 100 |
+
- Code generated with the assistance of Claude (Anthropic)
|
| 101 |
+
- Dataset created for learning purposes to build and test single-step diffusion models
|
| 102 |
+
|
| 103 |
+
## Citation
|
| 104 |
+
|
| 105 |
+
If you use this dataset in your research or educational projects, please include a reference to this repository.
|