├── .gitignore ├── Graphs.py ├── License.txt ├── README.md ├── _config.yml ├── config_cad.yml ├── config_synthetic.yml ├── data └── cad │ └── .placeholder ├── docs ├── .nojekyll ├── CHANGELIST ├── LICENSE ├── abracadabra.bat ├── abracadabra.sh ├── cayman.template ├── configuration.yaml ├── image.png ├── index.html ├── javascripts │ └── highlight.pack.js ├── stylesheets │ ├── cayman.css │ ├── highlight.css │ └── normalize.css └── task-list.lua ├── environment.yml ├── grouping.py ├── log ├── configs │ └── .placeholder ├── logger │ └── .placeholder └── tensorboard │ └── .placeholder ├── refine_cad.py ├── refine_cad_beamsearch.py ├── src ├── Models │ ├── __init__.py │ ├── loss.py │ └── models.py ├── __init__.py └── utils │ ├── Grouping.py │ ├── __init__.py │ ├── generators │ ├── __init__.py │ ├── mixed_len_generator.py │ └── shapenet_generater.py │ ├── image_utils.py │ ├── learn_utils.py │ ├── read_config.py │ ├── refine.py │ ├── reinforce.py │ └── train_utils.py ├── terminals.txt ├── test_cad.py ├── test_cad_beamsearch.py ├── test_synthetic.py ├── test_synthetic_beamsearch.py ├── train_cad.py ├── train_synthetic.py ├── trained_models └── results │ └── .placeholder ├── visualize_expressions.py ├── visualize_test_result.py └── web_page.md /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hippogriff/CSGNet/1ff8a4f78b6024a65084262ccd9f902a95af4f4b/.gitignore -------------------------------------------------------------------------------- /Graphs.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | class PriorityQueue: 4 | def __init__(self): 5 | self.heapArray = [(0, 0)] 6 | self.currentSize = 0 7 | 8 | def buildHeap(self, alist): 9 | self.currentSize = len(alist) 10 | self.heapArray = [(0, 0)] 11 | for i in alist: 12 | self.heapArray.append(i) 13 | i = len(alist) // 2 14 | while (i > 0): 15 | self.percDown(i) 16 | i = i - 1 17 | 18 | def percDown(self, i): 19 | while (i * 2) <= self.currentSize: 20 | mc = self.minChild(i) 21 | if self.heapArray[i][0] > self.heapArray[mc][0]: 22 | tmp = self.heapArray[i] 23 | self.heapArray[i] = self.heapArray[mc] 24 | self.heapArray[mc] = tmp 25 | i = mc 26 | 27 | def minChild(self, i): 28 | if i * 2 > self.currentSize: 29 | return -1 30 | else: 31 | if i * 2 + 1 > self.currentSize: 32 | return i * 2 33 | else: 34 | if self.heapArray[i * 2][0] < self.heapArray[i * 2 + 1][0]: 35 | return i * 2 36 | else: 37 | return i * 2 + 1 38 | 39 | def percUp(self, i): 40 | while i // 2 > 0: 41 | if self.heapArray[i][0] < self.heapArray[i // 2][0]: 42 | tmp = self.heapArray[i // 2] 43 | self.heapArray[i // 2] = self.heapArray[i] 44 | self.heapArray[i] = tmp 45 | i = i // 2 46 | 47 | def add(self, k): 48 | self.heapArray.append(k) 49 | self.currentSize = self.currentSize + 1 50 | self.percUp(self.currentSize) 51 | 52 | def delMin(self): 53 | retval = self.heapArray[1][1] 54 | self.heapArray[1] = self.heapArray[self.currentSize] 55 | self.currentSize = self.currentSize - 1 56 | self.heapArray.pop() 57 | self.percDown(1) 58 | return retval 59 | 60 | def isEmpty(self): 61 | if self.currentSize == 0: 62 | return True 63 | else: 64 | return False 65 | 66 | def decreaseKey(self, val, amt): 67 | # this is a little wierd, but we need to find the heap thing to decrease by 68 | # looking at its value 69 | done = False 70 | i = 1 71 | myKey = 0 72 | while not done and i <= self.currentSize: 73 | if self.heapArray[i][1] == val: 74 | done = True 75 | myKey = i 76 | else: 77 | i = i + 1 78 | if myKey > 0: 79 | self.heapArray[myKey] = (amt, self.heapArray[myKey][1]) 80 | self.percUp(myKey) 81 | 82 | def __contains__(self, vtx): 83 | for pair in self.heapArray: 84 | if pair[1] == vtx: 85 | return True 86 | return False 87 | 88 | 89 | # class Vertex: 90 | # def __init__(self, key): 91 | # self.id = key 92 | # self.connectedTo = {} 93 | # self.distance = 1e4 94 | # self.pred = None 95 | # self.program = [] 96 | # self.program_selected = False 97 | # 98 | # def addNeighbor(self, nbr, weight=0): 99 | # self.connectedTo[nbr] = weight 100 | # 101 | # def __str__(self): 102 | # return str(self.id) + ' connectedTo: ' + str([x.id for x in self.connectedTo]) 103 | # 104 | # def getConnections(self): 105 | # return self.connectedTo.keys() 106 | # 107 | # def getId(self): 108 | # return self.id 109 | # 110 | # def getWeight(self, nbr): 111 | # return self.connectedTo[nbr] 112 | # 113 | # def getDistance(self): 114 | # return self.distance 115 | # 116 | # def setDistance(self, distance): 117 | # self.distance = distance 118 | # 119 | # def setPred(self, pred): 120 | # self.pred = pred 121 | 122 | 123 | class Node: 124 | def __init__(self, key): 125 | self.id = key 126 | self.connectedTo = {} 127 | self.distance = 1e2 128 | self.pred = None 129 | 130 | # Whether a program is selected or not 131 | self.program_id = None 132 | self.root = False 133 | self.selected = False 134 | self.best_weight = None 135 | 136 | def addNeighbor(self, nbr, weight=0): 137 | self.connectedTo[nbr] = weight 138 | 139 | def __str__(self): 140 | return str(self.id) + ' connectedTo: ' + str([x.id for x in self.connectedTo]) 141 | 142 | def getConnections(self): 143 | return self.connectedTo.keys() 144 | 145 | def getId(self): 146 | return self.id 147 | 148 | def getWeight(self, nbr): 149 | return self.connectedTo[nbr] 150 | 151 | def getDistance(self): 152 | return self.distance 153 | 154 | def setDistance(self, distance): 155 | self.distance = distance 156 | 157 | def setPred(self, pred): 158 | self.pred = pred 159 | 160 | 161 | class Graph: 162 | """ 163 | Creates a directed graph 164 | """ 165 | def __init__(self): 166 | self.vertList = {} 167 | self.numVertices = 0 168 | 169 | def addVertex(self, key): 170 | self.numVertices = self.numVertices + 1 171 | newVertex = Node(key) 172 | self.vertList[key] = newVertex 173 | return newVertex 174 | 175 | def getVertex(self, n): 176 | if n in self.vertList: 177 | return self.vertList[n] 178 | else: 179 | return None 180 | 181 | def __contains__(self, n): 182 | return n in self.vertList 183 | 184 | def addEdge(self, f, t, weights): 185 | if f not in self.vertList: 186 | nv = self.addVertex(f) 187 | if t not in self.vertList: 188 | nv = self.addVertex(t) 189 | 190 | self.vertList[f].addNeighbor(self.vertList[t], weights) 191 | self.vertList[t].addNeighbor(self.vertList[f], weights) 192 | 193 | def getVertices(self): 194 | return self.vertList.keys() 195 | 196 | def vertex_keys(self): 197 | self.vertex2keys = {} 198 | for k, v in self.vertList.items(): 199 | self.vertex2keys[v] = k 200 | 201 | def getIndex(self, vertex): 202 | for k, v in self.vertList.items(): 203 | if v == vertex: 204 | return k 205 | return None 206 | 207 | def getEdgesWeight(self, vertex1, vertex2): 208 | """ 209 | Get the minimum weight from vertex1 to vertex2 210 | :param vertex1: is the vertex that is already selected to be part of the MST 211 | :param program_id1: Program id that is selected for the vertex1 212 | :param vertex2: the vertex not selected yet 213 | :return: 214 | """ 215 | key1 = self.vertex2keys[vertex1] 216 | key2 = self.vertex2keys[vertex2] 217 | program_id1 = vertex1.program_id 218 | if vertex1.root: 219 | # vertex is a root 220 | weight = np.min(vertex1.connectedTo[vertex2]) 221 | program_id = np.argmin(vertex1.connectedTo[vertex2]) 222 | return weight, program_id 223 | 224 | else: 225 | weight = np.min(vertex1.connectedTo[vertex2][program_id1, :]) 226 | program_id = np.argmin(vertex1.connectedTo[vertex2][program_id1, :]) 227 | return weight, program_id 228 | 229 | def __iter__(self): 230 | return iter(self.vertList.values()) 231 | 232 | 233 | def dijkstra(aGraph,start): 234 | pq = PriorityQueue() 235 | start.setDistance(0) 236 | pq.buildHeap([(v.getDistance(),v) for v in aGraph]) 237 | while not pq.isEmpty(): 238 | currentVert = pq.delMin() 239 | for nextVert in currentVert.getConnections(): 240 | newDist = currentVert.getDistance() + currentVert.getWeight(nextVert) 241 | if newDist < nextVert.getDistance(): 242 | nextVert.setDistance( newDist ) 243 | nextVert.setPred(currentVert) 244 | pq.decreaseKey(nextVert, newDist) 245 | 246 | 247 | def steinertree(G,start): 248 | Nodes = [] 249 | pq = PriorityQueue() 250 | for v in G: 251 | v.setDistance(1e2) 252 | v.setPred(None) 253 | start.setDistance(0) 254 | pq.buildHeap([(v.getDistance(),v) for v in G]) 255 | while not pq.isEmpty(): 256 | currentVert = pq.delMin() 257 | currentVert.selected = True 258 | Nodes.append(G.vertex2keys[currentVert]) 259 | for nextVert in currentVert.getConnections(): 260 | if nextVert.selected: 261 | continue 262 | newCost, program_id = G.getEdgesWeight(currentVert, nextVert) 263 | if nextVert in pq and newCost < nextVert.getDistance(): 264 | nextVert.setPred(currentVert) 265 | nextVert.setDistance(newCost) 266 | nextVert.program_id = program_id 267 | nextVert.best_weight = newCost 268 | pq.decreaseKey(nextVert, newCost) 269 | return Nodes 270 | 271 | def prim(G,start): 272 | pq = PriorityQueue() 273 | for v in G: 274 | v.setDistance(1e2) 275 | v.setPred(None) 276 | start.setDistance(0) 277 | pq.buildHeap([(v.getDistance(),v) for v in G]) 278 | while not pq.isEmpty(): 279 | currentVert = pq.delMin() 280 | for nextVert in currentVert.getConnections(): 281 | newCost = currentVert.getWeight(nextVert) 282 | if nextVert in pq and newCost < nextVert.getDistance(): 283 | nextVert.setPred(currentVert) 284 | nextVert.setDistance(newCost) 285 | pq.decreaseKey(nextVert,newCost) 286 | 287 | 288 | # prim(graph, graph.vertList[0]) 289 | # graph.vertex_keys() 290 | # 291 | # new_graph = Graph() 292 | # for k, v in graph.vertList.items(): 293 | # mini_dist = 1e5 294 | # mini_neigh = None 295 | # for neighbour in v.getConnections(): 296 | # if neighbour.getDistance() < mini_dist: 297 | # mini_dist = neighbour.getDistance() 298 | # mini_neigh = neighbour 299 | # neigh_key = graph.getIndex(mini_neigh) 300 | # print (k, neigh_key) 301 | # if not neigh_key == None: 302 | # new_graph.addEdge(k, neigh_key, v.connectedTo[mini_neigh]) -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Gopal Sharma 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CSGNet: Neural Shape Parser for Constructive Solid Geometry 2 | This repository contains code accompaning the paper: [CSGNet: Neural Shape Parser for Constructive Solid Geometry, CVPR 2018](https://arxiv.org/abs/1712.08290). 3 | 4 | Here we only include the code for 2D CSGNet. Code for 3D is available on this [repository](https://github.com/Hippogriff/3DCSGNet). 5 | 6 |  7 | ### Dependency 8 | - Python 3.* 9 | - Please use conda env using environment.yml file. 10 | ```bash 11 | conda env create -f environment.yml -n CSGNet 12 | source activate CSGNet 13 | ``` 14 | 15 | ### Data 16 | - Synthetic Dataset: 17 | 18 | Download the synthetic [dataset](https://www.dropbox.com/s/ud3oe7twjc8l4x3/synthetic.tar.gz?dl=0) and CAD [Dataset](https://www.dropbox.com/s/d6vm7diqfp65kyi/cad.h5?dl=0). Pre-trained model is available [here](https://www.dropbox.com/s/0f778edn3sjfabp/models.tar.gz?dl=0). Synthetic dataset is provided in the form of program expressions, instead of rendered images. Images for training, validation and testing are rendered on the fly. The dataset is split in different program lengths. 19 | ```bash 20 | tar -zxvf synthetic.tar.gz -C data/ 21 | ``` 22 | 23 | - CAD Dataset 24 | 25 | Dataset is provided in H5Py format. 26 | ```bash 27 | mv cad.h5 data/cad/ 28 | ``` 29 | 30 | ### Supervised Learning 31 | - To train, update `config_synthetic.yml` with required arguments. Default arguments are already filled. Then run: 32 | ```python 33 | python train_synthetic.py 34 | ``` 35 | 36 | - To test, update `config_synthetic.yml` with required arguments. Default arguments are already filled. Then run: 37 | ```python 38 | # For top-1 testing 39 | python test_synthetic.py 40 | ``` 41 | ```python 42 | # For beam-search-k testing 43 | python test_synthetic_beamsearch.py 44 | ``` 45 | 46 | ### RL fintuning 47 | - To train a network using RL, fill up configuration in `config_cad.yml` or keep the default values and then run: 48 | ```python 49 | python train_cad.py 50 | ``` 51 | Make sure that you have trained a network used Supervised setting first. 52 | 53 | - To test the network trained using RL, fill up configuration in `config_cad.yml` or keep the default values and then run: 54 | ```python 55 | # for top-1 decoding 56 | python test_cad.py 57 | ``` 58 | ```python 59 | # beam search decoding 60 | python test_cad_beamsearch.py 61 | ``` 62 | For post processing optmization of program expressions (visually guided search), set the flag `REFINE=True` in the script `test_cad_beam_search.py`, although it is little slow. For saving visualization of beam search use `SAVE_VIZ=True` 63 | 64 | - To optmize some expressions for cad dataset: 65 | ``` 66 | # To optmize program expressions from top-1 prediction 67 | python refine_cad.py path/to/exp/to/optmize/exp.txt path/to/directory/to/save/exp/ 68 | ``` 69 | Note that the expression files here should only have 3k expressions corresponding to the 3k test examples from the CAD dataset. 70 | 71 | - To optmize program expressions from top-1 prediction 72 | ``` 73 | python refine_cad_beamsearch.py path/to/exp/to/optmize/exp.txt path/to/directory/to/save/exp/ 74 | ``` 75 | Note that the expression files here should only have 3k x beam_width expressions corresponding to the 3k test examples from the CAD dataset. 76 | 77 | - To visualize generated expressions (programs), look at the script `visualize_expressions.py` 78 | 79 | 80 | ### Cite: 81 | ```bibtex 82 | @InProceedings{Sharma_2018_CVPR, 83 | author = {Sharma, Gopal and Goyal, Rishabh and Liu, Difan and Kalogerakis, Evangelos and Maji, Subhransu}, 84 | title = {CSGNet: Neural Shape Parser for Constructive Solid Geometry}, 85 | booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)}, 86 | month = {June}, 87 | year = {2018} 88 | } 89 | ``` 90 | 91 | ### Contact 92 | To ask questions, please [email](mailto:gopalsharma@cs.umass.edu). 93 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-tactile -------------------------------------------------------------------------------- /config_cad.yml: -------------------------------------------------------------------------------- 1 | comment = "Write some meaningful comments that can be used in future to identify the intents of running this experiment." 2 | 3 | [train] 4 | model_path = cad_3_{} 5 | 6 | # Whether to load a pretrained model or not 7 | preload_model = True 8 | 9 | # path to the pre-trained model 10 | pretrain_model_path = "trained_models/mix_len_cr_percent_equal_batch_3_13_prop_100_hdsz_2048_batch_2000_optim_adam_lr_0.001_wd_0.0_enocoderdrop_0.0_drop_0.2_step_mix_mode_12.pth" 11 | 12 | # Proportion of the dataset to be used while supevised training (N/A for RL), use 100 13 | proportion = 100 14 | 15 | # Number of epochs to run during training 16 | num_epochs = 400 17 | 18 | # batch size, based on the GPU memory 19 | batch_size = 300 20 | 21 | # hidden size of RNN 22 | hidden_size = 2048 23 | 24 | # Output feature size from CNN 25 | input_size = 2048 26 | 27 | # Number of batches to be collected before the network update 28 | num_traj = 10 29 | 30 | # Canvas shape, keep it 64 31 | canvas_shape = 64 32 | 33 | # Learning rate 34 | lr = 0.01 35 | 36 | # Optimizer: RL training: "sgd" or supervised training: "adam" 37 | optim = sgd 38 | 39 | # Epsilon for the RL training, not applicable in Supervised training 40 | epsilon = 1 41 | 42 | # l2 Weight decay 43 | weight_decay = 0.0 44 | 45 | # dropout for Decoder network 46 | dropout = 0.2 47 | 48 | # Encoder dropout 49 | encoder_drop = 0.2 50 | 51 | # Whether to schedule the learning rate or not 52 | lr_sch = True 53 | 54 | # Number of epochs to wait before decaying the learning rate. 55 | patience = 8 56 | 57 | # Mode of training, 1: supervised, 2: RL 58 | mode = 2 -------------------------------------------------------------------------------- /config_synthetic.yml: -------------------------------------------------------------------------------- 1 | comment = "Write some meaningful comments that can be used in future to identify the intents of running this experiment." 2 | 3 | [train] 4 | model_path = temp_{} 5 | 6 | # Whether to load a pretrained model or not 7 | preload_model = True 8 | 9 | # path to the pre-trained model 10 | pretrain_model_path = "trained_models/mix_len_cr_percent_equal_batch_3_13_prop_100_hdsz_2048_batch_2000_optim_adam_lr_0.001_wd_0.0_enocoderdrop_0.0_drop_0.2_step_mix_mode_12.pth" 11 | 12 | # Proportion of the dataset to be used while training, use 100 13 | proportion = 100 14 | 15 | # Number of epochs to run during training 16 | num_epochs = 400 17 | 18 | # batch size, based on the GPU memory 19 | batch_size = 100 20 | 21 | # hidden size of RNN 22 | hidden_size = 2048 23 | 24 | # Output feature size from CNN 25 | input_size = 2048 26 | 27 | # Number of batches to be collected before the network update 28 | num_traj = 1 29 | 30 | # Canvas shape, keep it 64 31 | canvas_shape = 64 32 | 33 | # Learning rate 34 | lr = 0.001 35 | 36 | # Optimizer: RL training -> "sgd" or supervised training -> "adam" 37 | optim = adam 38 | 39 | # Epsilon for the RL training, not applicable in Supervised training 40 | epsilon = 1 41 | 42 | # l2 Weight decay 43 | weight_decay = 0.0 44 | 45 | # dropout for Decoder network 46 | dropout = 0.2 47 | 48 | # Encoder dropout 49 | encoder_drop = 0.2 50 | 51 | # Whether to schedule the learning rate or not 52 | lr_sch = True 53 | 54 | # Number of epochs to wait before decaying the learning rate. 55 | patience = 8 56 | 57 | # Mode of training, 1: supervised, 2: RL 58 | mode = 1 -------------------------------------------------------------------------------- /data/cad/.placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hippogriff/CSGNet/1ff8a4f78b6024a65084262ccd9f902a95af4f4b/data/cad/.placeholder -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hippogriff/CSGNet/1ff8a4f78b6024a65084262ccd9f902a95af4f4b/docs/.nojekyll -------------------------------------------------------------------------------- /docs/CHANGELIST: -------------------------------------------------------------------------------- 1 | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 2 | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 3 | :::::::::::::::::::::::::::::::: CHANGES LIST :::::::::::::::::::::::::::::::: 4 | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 5 | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 6 | 7 | Edited: 2018/03/03 8 | 9 | This document refers to the “Cayman Theme” by Jason Long (@jasonlong), as it 10 | was downloaded from the “master” branch on Dec 12, 2016. 11 | 12 | - https://github.com/jasonlong/cayman-theme 13 | 14 | ============================================================================== 15 | ================================ CAYMAN THEME ================================ 16 | ============================================================================== 17 | 18 | This file resumes the list of changes that the original “Cayman Theme” 19 | underwent during adaptation for inclusion in the “gh-themes-magick” project. 20 | It’s intended to satisfy the Creative Commons clause that changes to the 21 | original work are to be mentioned, and it refers to the changes made during 22 | the first adapatation of the original theme for inclusion into the 23 | “gh-themes-magick” project. 24 | 25 | Further changes might have occured during developement since the time of this 26 | writing – either by the project maintainer or by external contributions. Such 27 | changes shall be considered pertaining to the derivative “gh-themes-magick” 28 | project, not the original theme, and are beyond the scope of this document. 29 | You can check “gh-themes-magick” revision history to learn what has changed 30 | since the date of this document. 31 | 32 | All changes have been carried out by Tristano Ajmone, creator and maintainer 33 | of the “gh-themes-magick” project. 34 | 35 | - https://github.com/tajmone/gh-themes-magick 36 | 37 | ============================================================================== 38 | ============================ ORIGINAL THEME FILES ============================ 39 | ============================================================================== 40 | 41 | This lists the files that have been ported into the project from the original 42 | theme, with a quick resume of the changes on the side: 43 | 44 | /stylesheets/ <== renamed '/css/' folder, 2 files kept (unchanged): 45 | | -- 'highlight.css' added 46 | /cayman.template <== 'index.html' converted to pandoc template: 47 | | -- meta elements added 48 | | -- changed "generated by GitHub Pages" to 49 | | "generated with gh-themes-magick" 50 | 51 | These files retain the original license found on the upstream theme. 52 | 53 | This is a list of the original files and folders that were excluded from this 54 | project: 55 | 56 | /scss/ <== folder with SASS source stylesheets. 57 | /.gitignore 58 | /.scss-lint.yml 59 | /Gruntfile.js 60 | /package.json 61 | /README.md 62 | 63 | ============================================================================== 64 | ========================= GH-THEMES-MAGICK ADDITIONS ========================= 65 | ============================================================================== 66 | 67 | These added files were created by Tristano Ajmone and fall under the same 68 | license of the theme: 69 | 70 | /.nojekyll <== prevents GitHub Pages from using Jekyll. 71 | /configuration.yaml <== website configuration file, the YAML way. 72 | /abracadabra.bat <== batch script to generate/update page contents. 73 | /abracadabra.sh <== shell script to generate/update page contents. 74 | /index.html <== sample theme page generated by gh-theme-magick. 75 | /CHANGELIST <== you're reading it right now! 76 | /LICENSE <== licenses for this theme and its components. 77 | 78 | ============================================================================== 79 | ========================== GH-THEMES-MAGICK CHANGES ========================== 80 | ============================================================================== 81 | 82 | The following styleshhets were edited to accomodate the need of the project: 83 | 84 | /stylesheets/cayman.css 85 | 86 | The changes include: 87 | 88 | - added CSS styles to support GFM Task-Lists. 89 | 90 | ============================================================================== 91 | ================================ HIGHLIGHT.JS ================================ 92 | ============================================================================== 93 | 94 | The following files were taken from the “highlight.js” project/package and 95 | added to the theme: 96 | 97 | /javascripts/highlight.pack.js <== custom build 98 | /stylesheets/highlight.css <== 'docco.css', contents unchanged 99 | 100 | The ‘highlight.css’ file is a renamed adaptation of the “Docco” theme, 101 | coverted from Docco by Simon Madine (@thingsinjars): 102 | 103 | - https://github.com/isagalaev/highlight.js/blob/master/src/styles/docco.css 104 | - http://jashkenas.github.io/docco 105 | - https://github.com/thingsinjars 106 | 107 | “highlight.js” is released under the BSD-3-Clause License. 108 | -------------------------------------------------------------------------------- /docs/LICENSE: -------------------------------------------------------------------------------- 1 | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 2 | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 3 | :::::::::::::::::::::::::::::::::: LICENSES :::::::::::::::::::::::::::::::::: 4 | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 5 | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 6 | 7 | Edited: 2016/12/18 8 | 9 | ============================================================================== 10 | ================================ CAYMAN THEME ================================ 11 | ============================================================================== 12 | 13 | This licenses file applies to the contents of the /cayman/ subfolder of 14 | “gh-themes-magick”, as found in the project’s relative path: 15 | 16 | /gh-themes/cayman/ 17 | 18 | The contents of this folder are a derivative work of a third party theme: 19 | 20 | - “Cayman theme” by Jason Long, CC-BY 4.0: 21 | https://github.com/jasonlong/cayman-theme 22 | 23 | They also include additional files taken from the “highlight.js” 24 | project/package: 25 | 26 | - “highlight.js” (c) 2006, Ivan Sagalaev, BSD-3-Clause License: 27 | https://highlightjs.org 28 | - “Docco” theme, coverted from Docco by Simon Madine (@thingsinjars):: 29 | https://github.com/isagalaev/highlight.js/blob/master/src/styles/docco.css 30 | http://jashkenas.github.io/docco https://github.com/thingsinjars 31 | 32 | And the “task-list.lua” pandoc filter taken from “lua-filters” project: 33 | 34 | - “lua-filters” Copyright (c) 2017-2018 pandoc, MIT License: 35 | https://github.com/pandoc/lua-filters 36 | 37 | Changes for adapation were carried out by Tristano Ajmone, maintainer of the 38 | “gh-themes-magick” project. For more information on the changes introduced in 39 | this derivative work, see the ‘CHANGELIST’ file. 40 | 41 | ============================================================================== 42 | ========================= CAYMAN THEME LICENSE TERMS ========================= 43 | ============================================================================== 44 | 45 | From the Cayman theme repository: 46 | 47 | - https://github.com/jasonlong/cayman-theme/blob/master/README.md 48 | 49 | Quoting: 50 | 51 | “License 52 | 53 | This work is licensed under a Creative Commons Attribution 4.0 International.” 54 | 55 | Creative Commons Attribution 4.0 International License (CC BY 4.0): 56 | 57 | - https://creativecommons.org/licenses/by/4.0/ 58 | 59 | ============================================================================== 60 | ========================= HIGHLIGHT.JS LICENSE TERMS ========================= 61 | ============================================================================== 62 | 63 | Copyright (c) 2006, Ivan Sagalaev All rights reserved. Redistribution and use 64 | in source and binary forms, with or without modification, are permitted 65 | provided that the following conditions are met: 66 | 67 | * Redistributions of source code must retain the above copyright 68 | notice, this list of conditions and the following disclaimer. 69 | * Redistributions in binary form must reproduce the above copyright 70 | notice, this list of conditions and the following disclaimer in the 71 | documentation and/or other materials provided with the distribution. 72 | * Neither the name of highlight.js nor the names of its contributors 73 | may be used to endorse or promote products derived from this software 74 | without specific prior written permission. 75 | 76 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS’’ AND ANY 77 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 78 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 79 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY 80 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 81 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 82 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 83 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 84 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 85 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 86 | 87 | ============================================================================== 88 | ====================== PANDOC LUA-FILTERS LICENSE TERMS ====================== 89 | ============================================================================== 90 | 91 | MIT License 92 | 93 | Copyright (c) 2017-2018 pandoc 94 | 95 | Permission is hereby granted, free of charge, to any person obtaining a copy 96 | of this software and associated documentation files (the “Software”), to deal 97 | in the Software without restriction, including without limitation the rights 98 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 99 | copies of the Software, and to permit persons to whom the Software is 100 | furnished to do so, subject to the following conditions: 101 | 102 | The above copyright notice and this permission notice shall be included in all 103 | copies or substantial portions of the Software. 104 | 105 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 106 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 107 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 108 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 109 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 110 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 111 | SOFTWARE. 112 | -------------------------------------------------------------------------------- /docs/abracadabra.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | ECHO ============================================================================== 3 | ECHO :: Cayman Theme :: updating website. 4 | pandoc --no-highlight ^ 5 | --lua-filter=task-list.lua ^ 6 | --from markdown_github+smart+yaml_metadata_block+auto_identifiers ^ 7 | --to html5 ^ 8 | --template ./cayman.template ^ 9 | --output ./index.html ^ 10 | ../README.md ./configuration.yaml -------------------------------------------------------------------------------- /docs/abracadabra.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo ============================================================================== 3 | echo :: Cayman Theme :: updating website. 4 | pandoc --no-highlight \ 5 | --lua-filter=task-list.lua \ 6 | --from markdown_github+smart+yaml_metadata_block+auto_identifiers \ 7 | --to html5 \ 8 | --template ./cayman.template \ 9 | --output ./index.html \ 10 | ../web_page.md ./configuration.yaml 11 | -------------------------------------------------------------------------------- /docs/cayman.template: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |tags -- wrap it inside a
Gopal Sharma, Rishabh Goyal, Difan Liu, Evangelos Kalogerakis, Subhransu Maji
34 |We present a neural architecture that takes as input a 2D or 3D shape and induces a program to generate it. The instructions in our program are based on constructive solid geometry principles, i.e., a set of boolean operations on shape primitives defined recursively. Bottom-up techniques for this task that rely on primitive detection are inherently slow since the search space over possible primitive combinations is large. In contrast, our model uses a recurrent neural network conditioned on the input shape to produce a sequence of instructions in a top-down manner and is significantly faster. It is also more effective as a shape detector than existing state-of-the-art detection techniques. We also demonstrate that our network can be trained on novel dataset without ground-truth program annotations through policy gradient techniques.
37 | 38 |@InProceedings{Sharma_2018_CVPR,
40 | author = {Sharma, Gopal and Goyal, Rishabh and Liu, Difan and Kalogerakis, Evangelos and Maji, Subhransu},
41 | title = {CSGNet: Neural Shape Parser for Constructive Solid Geometry},
42 | booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
43 | month = {June},
44 | year = {2018}
45 | }
46 |
47 |
51 |
52 | ` tag. 95 | # ------------------------------------------------------------------------------ 96 | # DON'T REMOVE the "..." below: 97 | ... 98 | -------------------------------------------------------------------------------- /docs/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hippogriff/CSGNet/1ff8a4f78b6024a65084262ccd9f902a95af4f4b/docs/image.png -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
55 |