Code Monkey home page Code Monkey logo

terrainauthoring-pytorch's Introduction

TerrainAuthoring-Pytorch

This is the implemetation of the paper Deep Generative Framework for Interactive 3D Terrain Authoring and Manipulation.

Installation

Please install conda. Create a new environment and install all the dependencies using the following command

conda env create --file environment.yml

Experiments

The proposed architecture is composed of VAE and Pix2pix architectures. We have referred the PyTorch-VAE repository for the VAE implementation.

Training the model

The model is trained in two steps. To train the VAE model, set the load_model parameter in train.yml to False. To train the pix2pix model use the following command. The checkpoints will be saved in logs directory.

python train.py --config configs/train.yml

Testing the model

This architecture provides multiple applications. To generate a single output use the following command. The results will be saved in images folder.

python test.py --var single
Terrain Variations

To generate multiple output variations for the same input, use the command

python test.py --var multiple
Terrain Interpolation

The model can be used to smoothly interpolate between the given two terrains.

To interpolate between two terrains, specify the folder location containing the terrains in the test.yml file. Then use the command

python interpolate.py

Use the UI

The given model can be used to render the terrains in an interactive mode.

Use the following command to run the UI.

python ui.py

If there are errors due to incompatibility , uninstall opencv and reinstall it using the command

pip install opencv-python-headless 

terrainauthoring-pytorch's People

Contributors

shanthika avatar kinalmehta avatar

Stargazers

 avatar Adnan Yunus avatar  avatar 李杰穎 (Jay Lee) avatar

Watchers

James Cloos avatar  avatar

terrainauthoring-pytorch's Issues

Request for dataset on TerrainAuthoring-Pytorch

Dear Shanthika,

I hope this message finds you well. I am writing to kindly request access to the [terrain_contour_3k] dataset you used on GitHub. I have reviewed the information you provided and I believe that this dataset would be highly valuable to my research on terrrain generation.

I understand that you may have your own privacy and copyright concerns with respect to sharing your dataset, but I would like to reassure you that I will use it only for the specific purposes outlined in this email. I will also acknowledge your contribution in any publications or presentations that result from my analysis of the data.

Thank you very much for your consideration. Please let me know if there are any conditions or requirements that I need to meet in order to obtain access to the dataset.My email is [email protected] .

Sincerely,
Mingqi Sun

TypeError: save_checkpoint() missing 1 required positional argument: 'filepath'

Hello, Shanthika
I run your code on my machine, i only modified [data_path] of the train.yml file. I modified it to the absolute path of the data on my own computer And i got the following error message. It seems that there is a problem with the path where the checkpoints are saved.

(terrain) smq@He1zi:~/smq/terrain$ python train.py --config configs/train.yml
/home/smq/anaconda3/envs/terrain/lib/python3.7/site-packages/pytorch_lightning/loggers/test_tube.py:105: LightningDeprecationWarning: The TestTubeLogger is deprecated since v1.5 and will be removed in v1.7. We recommend switching to the `pytorch_lightning.loggers.TensorBoardLogger` as an alternative.
  "The TestTubeLogger is deprecated since v1.5 and will be removed in v1.7. We recommend switching to the"
[INFO] Loaded randomly initialized model
GPU available: True, used: True
TPU available: False, using: 0 TPU cores
IPU available: False, using: 0 IPUs
/home/smq/anaconda3/envs/terrain/lib/python3.7/site-packages/pytorch_lightning/trainer/connectors/logger_connector/logger_connector.py:60: LightningDeprecationWarning: Setting `Trainer(flush_logs_every_n_steps=100)` is deprecated in v1.5 and will be removed in v1.7. Please configure flushing in the logger instead.
  f"Setting `Trainer(flush_logs_every_n_steps={flush_logs_every_n_steps})` is deprecated in v1.5 "
======= Training Pix2Pix GAN =======
LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]

  | Name  | Type       | Params
-------------------------------------
0 | model | VanillaVAE | 18.9 M
-------------------------------------
18.9 M    Trainable params
0         Non-trainable params
18.9 M    Total params
75.595    Total estimated model params size (MB)
Epoch 0:   0%|                                                                                                                                | 0/128 [00:00<?, ?it/s]/home/smq/anaconda3/envs/terrain/lib/python3.7/site-packages/pytorch_lightning/loops/optimization/closure.py:36: LightningDeprecationWarning: One of the returned values {'KLD', 'Reconstruction_Loss'} has a `grad_fn`. We will detach it automatically but this behaviour will change in v1.6. Please detach it manually: `return {'loss': ..., 'something': something.detach()}`
  f"One of the returned values {set(extra.keys())} has a `grad_fn`. We will detach it automatically"
Epoch 0: 100%|██████████████████████████████████████████████████████████████████████████████████████████████| 128/128 [00:43<00:00,  2.93it/s, loss=8.68e+05, v_num=0]
Traceback (most recent call last):                                                                                                                                    
  File "train.py", line 89, in <module>
    runner.save_checkpoint()
TypeError: save_checkpoint() missing 1 required positional argument: 'filepath'

What can i do to fix it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.