FallingStars123 commited on
Commit
d1ac298
ยท
verified ยท
1 Parent(s): 6c613ca

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +147 -0
README.md ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ {}
3
+ ---
4
+ title: "Smart MC Building Generator"
5
+ emoji: "๐Ÿ—๏ธ"
6
+ colorFrom: "blue"
7
+ colorTo: "purple"
8
+ sdk: "streamlit" # ๆˆ– gradio ๅ–ๅ†ณไบŽไฝ ็š„ web ็•Œ้ข
9
+ app_file: "main.py"
10
+ pinned: false
11
+ ---
12
+
13
+ # Smart MC Building Generator
14
+
15
+ ## Project Overview
16
+ The Smart MC Building Generator is an AI-powered tool that automatically generates Minecraft structures based on user prompts (e.g., "flat roof", "dark oak walls"). It combines data augmentation, 3D generative models, and Minecraft data format conversion to create 10x10x10 structures from single images or text prompts, exporting them as `.schem` files.
17
+
18
+ ---
19
+
20
+ [๐Ÿ‡จ๐Ÿ‡ณ ็ฎ€ไฝ“ไธญๆ–‡](Muti_language_Readme/README.zh.md) | [๐Ÿ‡ฌ๐Ÿ‡ง English](Muti_language_Readme/README.en.md)
21
+
22
+ ---
23
+
24
+ ## Key Features
25
+ 1. **Data Loading & Parsing**
26
+ โ€ข Supports loading and parsing Minecraft `.schem` files.
27
+ 2. **Data Augmentation**
28
+ โ€ข Generates diverse building variants via rotation and mirroring.
29
+ 3. **3D Visualization**
30
+ โ€ข Preview structures as point clouds, colored cubes, or slice views.
31
+ 4. **Prompt-Driven Generation**
32
+ โ€ข Generate buildings from text prompts (e.g., "small house with a flat roof").
33
+ 5. **Export Functionality**
34
+ โ€ข Save generated structures as `.schem` files for direct use in Minecraft.
35
+
36
+ ---
37
+
38
+ ## Dependencies
39
+ โ€ข **Python 3.8+**
40
+ โ€ข **Core Libraries**:
41
+ โ€ข `numpy`
42
+ โ€ข `pyvista`
43
+ โ€ข `nbtlib`
44
+ โ€ข `torch` (for model training)
45
+ โ€ข `flask` (for web interface)
46
+
47
+ **Installation**:
48
+ ```bash
49
+ pip install numpy pyvista nbtlib torch flask
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Usage
55
+
56
+ ### 1. Load & Parse Data
57
+ Place your `.schem` file in the project directory and run:
58
+ ```python
59
+ from main import process_block_data
60
+ process_block_data("WoodHouse_3.schem")
61
+ ```
62
+
63
+ ### 2. Data Augmentation
64
+ Generate rotated/mirrored variants of existing structures:
65
+ ```python
66
+ from main import generate_rotated_and_mirrored_data
67
+ generate_rotated_and_mirrored_data()
68
+ ```
69
+
70
+ ### 3. Visualization
71
+ Preview structures using:
72
+ ```python
73
+ from main import preview_point_cloud, preview_cubes_with_colors, preview_slices
74
+ preview_point_cloud(output_data) # Point cloud view
75
+ preview_cubes_with_colors(output_data) # Colored cubes
76
+ preview_slices(output_data) # Slice view
77
+ ```
78
+
79
+ ### 4. Prompt-Based Generation
80
+ Generate structures from text prompts:
81
+ ```python
82
+ from main import generate_from_prompt
83
+ generate_from_prompt("A small house with a flat roof and dark oak walls")
84
+ ```
85
+
86
+ ### 5. Export to `.schem`
87
+ Save generated structures:
88
+ ```python
89
+ from main import save_as_schem
90
+ save_as_schem(house_data, "generated_house.schem")
91
+ ```
92
+
93
+ ### 6. Web Interface
94
+ Launch the interactive web server:
95
+ ```bash
96
+ python main.py
97
+ ```
98
+ Visit `http://Not_created_yet` to generate buildings via prompts.
99
+
100
+ ---
101
+
102
+ ## File Structure
103
+ ```
104
+ MC_Building_Generator/
105
+ โ”œโ”€โ”€ schem/ # put .schem files
106
+ โ”‚ โ””โ”€โ”€ WoodHouse_3.schem
107
+ โ”œโ”€โ”€ npy/ # put .npy files
108
+ โ”‚ โ””โ”€โ”€ block_data_0.npy
109
+ โ”œโ”€โ”€ main.py # Main entry point
110
+ โ”œโ”€โ”€ block_data.txt # Parsed block data
111
+ โ”œโ”€โ”€ metadata.txt # Metadata (dimensions, block IDs)
112
+ โ””โ”€โ”€ README.md # This document
113
+ ```
114
+ ---
115
+
116
+ ## Examples
117
+ 1. **Load a `.schem` file**:
118
+ ```bash
119
+ python main.py
120
+ ```
121
+ 2. **Generate from a prompt**:
122
+ โ€ข **Prompt**: `A small house with a flat roof and dark oak walls`
123
+ โ€ข **Output**: `generated_house.schem`
124
+
125
+ ---
126
+
127
+ ## Notes
128
+ 1. Ensure `.schem` files follow Minecraft's format specifications.
129
+ 2. Use clear and specific prompts for optimal results.
130
+ 3. Augmented data is saved in `block_data_*.npy` files.
131
+
132
+ ---
133
+
134
+ ## Roadmap
135
+ 1. Support more building types and sizes.
136
+ 2. Optimize generation speed and model accuracy.
137
+ 3. Develop a real-time preview interface.
138
+
139
+ ---
140
+
141
+ ## Contact
142
+ For questions or feedback:
143
+ โ€ข **Email**: [email protected]
144
+ โ€ข **GitHub**: [https://github.com/fallingstars123/MC-AI-BuildingGenerate](https://github.com/fallingstars123/MC-AI-BuildingGenerate)
145
+ โ€ข **Discord**: thomasw2004
146
+
147
+ ---