Skip to content

midstreeeam/3d-voxel-gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

3D-Voxel-Gen

This is a project that focuses on the automatic generation of 3d voxel-based models. window

Quick Start

Install

This project works on Python 3.6 and later versions.

Then clone the repo and do the following

cd 3d-voxel-gen
pip install -r requirements.txt

Preprocess

In order to train the model, data pre-processing is needed.

Currently, the project only accepts the input data in 0.98 version Magical-Voxel’s vox file.

The preprocess.py takes the input of vox file as input and will create output.json file in the home folder. The json file contains transformed 3d-model that can be processed by the neural network.

Training

Google Colab is highly recommend to use when training the data.

Please create your colab and using colab.ipynb to train your neural network.

The generated output.json is the input for the neural network, put is in the home directory of Google Colab to let the program read it. The generated trained model (in h5 file format) will be put in the home folder too.

Generation

The generation code piece can be found in colab.ipynb, put the trained h5 model in ./wei/ to let the program read.

Then, there are provided tools for generation and gif recording. (Both pytorch and tensorflow version are provided). Default seed is the center of the 32x32x32 space, you can modify for add more seed if you like.

About

This repo is not finished yet, might be some bugs when you run the code.

The code of the neural net-work part takes is modified from Growing Neural Cellular Automata, and the 3d part is build on top of hybrid-nca-evocraft, checking their web-page for detailed explanation.

The picture below shows the process of how this repo works.

window