Giter Club home page Giter Club logo

smokinggan's Introduction

SmokingGAN

An experimental framework for running ML Models inside the Grasshopper / Rhino environment

Attributions

SmokingGAN is a Hackathon project for the 2020 AEC Tech Symposium organized by CORE Studio at Thornton Tomasetti

This project has been a collaborative effort between Mayur Mistry, Sergey Pigach, Charlie Portelli and Sergio Guindon

SmokingGAN borrows heavily from the following open-source projects:

Fast Style Transfer: https://github.com/lengstrom/fast-style-transfer

TF Monodepth 2: https://github.com/FangGet/tf-monodepth2

Description

SmokingGAN is an attempt at incorporating GANs into a Rhino / Grasshopper design workflow. The two major parts of the SmokingGAN are the Flask server exposing pre-trained checkpoints (This hackathon version currently serves A Style GAN and a Depth Map generator, but can be extended to work with any other pretrained checkpoints) and a Grasshopper plugin that accesses the Flask API and also provides functionality for converting images to meshes based on the depth information.

2x2 Rhino

This is the basic architectural diagram showing the main components of the API:

Diagram

Server Setup

We recommend creating an Anaconda environment with Python 3.7 (IMPORTANT: we've ran into serious issues with Tensorflow and Python 3.8)

conda create --name your-env-name python=3.7
conda activate your-env-name

Install the necessary dependencies:

conda install flask numpy imageio marshmallow matplotlib scipy pillow pandas
pip install tensorflow==2.3.1
pip install keras==2.4.3
pip install tf_slim
pip install flask
pip install marshmallow
pip install imageio
pip install matplotlib

Download the following checkpoint files:

Style Transfer - https://drive.google.com/drive/folders/0B9jhaT37ydSyRk9UX0wwX3BpMzQ

Depth Map - https://drive.google.com/drive/folders/0B9jhaT37ydSyRk9UX0wwX3BpMzQ

Place them into Flask/Checkpoints/StyleTransfer and Flask/Checkpoints/DepthMap respectively.

Run the server:

cd GenerativeModeling/Flask
python MainFrame.py

Grasshopper Setup

Open and build the GenerativeModeling solution from the .NET folder

In Rhino's command line type in GrasshopperDeveloperSettings. In the dialog paste the path to the bin folder for the Visual Studio solution. Click ok and launch Grasshopper. You should see the SmokingGAN tab appear in the panel.

Have fun:

Grasshopper Flythrough Rhino Screenshot

smokinggan's People

Contributors

enmerk4r avatar crashnorun avatar mistrymm7 avatar sguindon avatar

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.