Datasets:
init
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- README.md +64 -1
- png_1024x1024/modified_image_01.png +0 -0
- png_1024x1024/modified_image_02.png +0 -0
- png_1024x1024/modified_image_03.png +0 -0
- png_1024x1024/modified_image_04.png +0 -0
- png_1024x1024/modified_image_05.png +0 -0
- png_1024x1024/modified_image_06.png +0 -0
- png_1024x1024/modified_image_07.png +0 -0
- png_1024x1024/modified_image_08.png +0 -0
- png_1024x1024/modified_image_09.png +0 -0
- png_1024x1024/modified_image_10.png +0 -0
- png_1024x1024/modified_image_11.png +0 -0
- png_1024x1024/modified_image_12.png +0 -0
- png_1024x1024/modified_image_13.png +0 -0
- png_1024x1024/modified_image_14.png +0 -0
- png_1024x1024/modified_image_15.png +0 -0
- png_1024x1024/modified_image_16.png +0 -0
- png_1024x1024/modified_image_17.png +0 -0
- png_1024x1024/modified_image_18.png +0 -0
- png_1024x1024/modified_image_19.png +0 -0
- png_1024x1024/modified_image_20.png +0 -0
- png_1024x1024/modified_image_21.png +0 -0
- png_1024x1024/modified_image_22.png +0 -0
- png_1024x1024/modified_image_23.png +0 -0
- png_1024x1024/modified_image_24.png +0 -0
- png_1024x1024/modified_image_25.png +0 -0
- png_1024x1024/modified_image_26.png +0 -0
- png_1024x1024/modified_image_27.png +0 -0
- png_1024x1024/modified_image_28.png +0 -0
- png_1024x1024/modified_image_29.png +0 -0
- png_1024x1024/modified_image_30.png +0 -0
- png_1024x1024/modified_image_31.png +0 -0
- png_1024x1024/modified_image_32.png +0 -0
- png_1024x1024/modified_image_33.png +0 -0
- png_1024x1024/modified_image_34.png +0 -0
- png_1024x1024/modified_image_35.png +0 -0
- png_1024x1024/modified_image_36.png +0 -0
- png_1024x1024/modified_image_37.png +0 -0
- png_1024x1024/modified_image_38.png +0 -0
- png_1024x1024/modified_image_39.png +0 -0
- png_1024x1024/modified_image_41.png +0 -0
- png_1024x1024/modified_image_42.png +0 -0
- png_1024x1024/modified_image_43.png +0 -0
- png_1024x1024/modified_image_44.png +0 -0
- png_1024x1024/modified_image_45.png +0 -0
- png_1024x1024/modified_image_46.png +0 -0
- png_1024x1024/modified_image_47.png +0 -0
- png_1024x1024/modified_image_48.png +0 -0
- png_1024x1024/modified_image_49.png +0 -0
- png_1024x1024/modified_image_50.png +0 -0
README.md
CHANGED
@@ -1,3 +1,66 @@
|
|
1 |
---
|
2 |
-
license:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
license: cc0-1.0
|
3 |
+
task_categories:
|
4 |
+
- text-to-image
|
5 |
+
tags:
|
6 |
+
- art
|
7 |
+
pretty_name: Factorio Blueprint Visualizations Dataset
|
8 |
+
size_categories:
|
9 |
+
- n<1K
|
10 |
---
|
11 |
+
|
12 |
+
## Dataset Description
|
13 |
+
|
14 |
+
This dataset is a collection of visualizations of [Factorio Blueprints](https://wiki.factorio.com/Blueprint) using this Factorio Visualization Tool: https://github.com/piebro/factorio-blueprint-visualizer. The Blueprints are collected from https://www.factorio.school/.
|
15 |
+
|
16 |
+
## Dataset Structure
|
17 |
+
|
18 |
+
* "svg_original": The svg downloaded like this from the website
|
19 |
+
* "svg_rect": The svg reshaped to a rect and a slightly bigger border
|
20 |
+
* "png_1024x1024": The svg_rect images exported as pngs
|
21 |
+
|
22 |
+
## Code Attachments
|
23 |
+
|
24 |
+
Code to create the rectangular svgs:
|
25 |
+
```python
|
26 |
+
import os
|
27 |
+
import xml.etree.ElementTree as ET
|
28 |
+
|
29 |
+
def modify_svg(save_dir, svg_file_path):
|
30 |
+
tree = ET.parse(svg_file_path)
|
31 |
+
root = tree.getroot()
|
32 |
+
|
33 |
+
# Extract current width and height
|
34 |
+
width = float(root.attrib['width'].replace('mm', ''))
|
35 |
+
height = float(root.attrib['height'].replace('mm', ''))
|
36 |
+
|
37 |
+
# Calculate new dimensions
|
38 |
+
new_size = max(width, height) + 200
|
39 |
+
|
40 |
+
# Update width and height
|
41 |
+
root.attrib['width'] = f"{new_size}mm"
|
42 |
+
root.attrib['height'] = f"{new_size}mm"
|
43 |
+
|
44 |
+
# Adjust viewBox for centering content
|
45 |
+
view_box = root.attrib.get('viewBox', '').split(',')
|
46 |
+
if len(view_box) == 4:
|
47 |
+
x, y, vw, vh = map(float, view_box)
|
48 |
+
dx = vw*0.12
|
49 |
+
dy = vh*0.12
|
50 |
+
root.attrib['viewBox'] = f"{x-dx/2}, {y-dy/2}, {vw+dx}, {vh+dy}"
|
51 |
+
|
52 |
+
# Write back to file or a new file
|
53 |
+
tree.write(os.path.join(save_dir, f"modified_{os.path.basename(svg_file_path)}"))
|
54 |
+
|
55 |
+
save_dir = ""
|
56 |
+
original_svg_folder_path = ""
|
57 |
+
for file_name in os.listdir(original_svg_folder_path):
|
58 |
+
if file_name.endswith('.svg'):
|
59 |
+
modify_svg(save_dir, os.path.join(original_svg_folder_path, file_name))
|
60 |
+
```
|
61 |
+
|
62 |
+
Code to create the pngs:
|
63 |
+
```bash
|
64 |
+
mkdir pngs
|
65 |
+
for file in *.svg; do convert "$file" -resize 1024x1024 "pngs/${file%.svg}.png"; done
|
66 |
+
```
|
png_1024x1024/modified_image_01.png
ADDED
png_1024x1024/modified_image_02.png
ADDED
png_1024x1024/modified_image_03.png
ADDED
png_1024x1024/modified_image_04.png
ADDED
png_1024x1024/modified_image_05.png
ADDED
png_1024x1024/modified_image_06.png
ADDED
png_1024x1024/modified_image_07.png
ADDED
png_1024x1024/modified_image_08.png
ADDED
png_1024x1024/modified_image_09.png
ADDED
png_1024x1024/modified_image_10.png
ADDED
png_1024x1024/modified_image_11.png
ADDED
png_1024x1024/modified_image_12.png
ADDED
png_1024x1024/modified_image_13.png
ADDED
png_1024x1024/modified_image_14.png
ADDED
png_1024x1024/modified_image_15.png
ADDED
png_1024x1024/modified_image_16.png
ADDED
png_1024x1024/modified_image_17.png
ADDED
png_1024x1024/modified_image_18.png
ADDED
png_1024x1024/modified_image_19.png
ADDED
png_1024x1024/modified_image_20.png
ADDED
png_1024x1024/modified_image_21.png
ADDED
png_1024x1024/modified_image_22.png
ADDED
png_1024x1024/modified_image_23.png
ADDED
png_1024x1024/modified_image_24.png
ADDED
png_1024x1024/modified_image_25.png
ADDED
png_1024x1024/modified_image_26.png
ADDED
png_1024x1024/modified_image_27.png
ADDED
png_1024x1024/modified_image_28.png
ADDED
png_1024x1024/modified_image_29.png
ADDED
png_1024x1024/modified_image_30.png
ADDED
png_1024x1024/modified_image_31.png
ADDED
png_1024x1024/modified_image_32.png
ADDED
png_1024x1024/modified_image_33.png
ADDED
png_1024x1024/modified_image_34.png
ADDED
png_1024x1024/modified_image_35.png
ADDED
png_1024x1024/modified_image_36.png
ADDED
png_1024x1024/modified_image_37.png
ADDED
png_1024x1024/modified_image_38.png
ADDED
png_1024x1024/modified_image_39.png
ADDED
png_1024x1024/modified_image_41.png
ADDED
png_1024x1024/modified_image_42.png
ADDED
png_1024x1024/modified_image_43.png
ADDED
png_1024x1024/modified_image_44.png
ADDED
png_1024x1024/modified_image_45.png
ADDED
png_1024x1024/modified_image_46.png
ADDED
png_1024x1024/modified_image_47.png
ADDED
png_1024x1024/modified_image_48.png
ADDED
png_1024x1024/modified_image_49.png
ADDED
png_1024x1024/modified_image_50.png
ADDED