Generate titan from single image into your Minecraft World!!
その日 人類は思い出した
ヤツらに支配されていた恐怖を…
鳥籠の中に囚われていた屈辱を…
$ git clone https://github.com/takecx/TitanCraft.git
$ cd TitanCraft
$ git submodule update -i
$ cd remove_bg
$ git submodule update -i
$ cd ..
Download FBA_Matting
model from here and place it to ./remove_bg/FBA_Matting/FBA.pth
.
Download PIFu
two models from here and here and place there to ./PIFu/checkpoints/
.
You should create python environment using requirements.txt
.
$ conda create -n TitanCraft python=3.7
$ conda activate TitanCraft
$ pip install -r requirements.txt
Put input image file to ./data/
dir for example.
Run TitanGenerator.py
with some arguments.
$ python TitanGenerator.py (input image) --resize (resize) --kernel_size (morphology kernel size) --iteration (morphology iteration num) --output_dir (output dir) --h_max (height max value) --w_max (width max value)
- input image file path (required)
- '--resize' : preprocessed image size (optional)
--kernel_size
: kernel size of morphology conversion (optional)--iteration
: iteration num of morphology conversion (optional)--output_dir
: Output dir of generated .schematic file (optional)--h_max
: max height of converted schematic (optional)--w_max
: max width(length) of converted schematic (optional)
For example,
- input image file path :
./data/sample.png
--resize
: 256--kernel_size
: 5--iteration
: 3--output_dir
:./output/
--h_max
: 100--w_max
: 150
then, you run
$ python TitanGenerator.py ./data/sample.png --resize 256 --kernel_size 5 --iteration 3 --output_dir ./output/ --h_max 100 --w_max 150
Import generated .schematic
file (saved in ./output/
) to your own Minecraft World using WorldEdit mod.