Skip to content

Commit

Permalink
Fix GEOmetrics Image Recon example (#68)
Browse files Browse the repository at this point in the history
* Fix GeoMetrics example

Signed-off-by: Jean-Francois Lafleche <jlafleche@nvidia.com>

* Code style fixes

Signed-off-by: Jean-Francois Lafleche <jlafleche@nvidia.com>

* Improve readability of realin func

Signed-off-by: Jean-Francois Lafleche <jlafleche@nvidia.com>

* Style cleanup

Signed-off-by: Jean-Francois Lafleche <jlafleche@nvidia.com>
  • Loading branch information
Jean-Francois-Lafleche committed Feb 6, 2020
1 parent 1622437 commit dcacac5
Show file tree
Hide file tree
Showing 15 changed files with 1,189 additions and 1,604 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,8 @@ public/
**/.vscode/**

# Results directory for examples
examples/renderers/DIB-R/results/
examples/renderers/DIB-R/results/

# example outputs
cache/
log/
57 changes: 40 additions & 17 deletions examples/ImageRecon/GEOmetrics/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,54 @@
# Example: GeoMetrics
This example allows you to train and test the GEOMetrice algorithm for signle image 3D object reconstruction. For details on the algorithms see: "GEOMetrics: Exploiting Geometric Structure for Graph-Encoded Objects" : https://arxiv.org/abs/1901.11461
This example includes training and testing of the GEOMetrics algorithm for
single image 3D object reconstruction. For details on the algorithms see:
"GEOMetrics: Exploiting Geometric Structure for Graph-Encoded Objects":
https://arxiv.org/abs/1901.11461

Training on a single class takes several days using an NVIDIA RTX 2080Ti
GPU. To obtain more visually pleasing results at the expense of F-Score,
increase the regularizer weights (laplace, edge).

Note: `cache-dir` specifies the location to which intermediate asset
representations will be stored.


### Training the network:

To train the system call
```
python train.py
#### Option 1 : No latent embedding loss (faster to train)
```bash
python train.py --shapenet-root <path/to/ShapeNet> \
--shapenet-images-root <path/to/ShapeNetImages> \
--categories <category list> \
--cache-dir cache/
```


To train the system with the latent encoding loss call first:
#### Option 2 : With latent embedding loss (better results)
```bash
python train_auto_encoder.py --shapenet-root <path/to/ShapeNet> \
--cache-dir cache/
```
python train_auto_encoder.py
```
This will train the mesh encoder. Then call the follwoing to train the image reconstruction algorithm:
```
python train.py -latent_loss
This will train the mesh encoder. Then call the following to train the image
reconstruction algorithm:
```bash
python train.py --shapenet-root <path/to/ShapeNet> \
--shapenet-images-root <path/to/ShapeNetImages> \
--categories <category list> \
--cache-dir cache/ --latent_loss
```

### Evaluating the network:

To evaluate a trained model
To evaluate the auto-encoder
```bash
python eval_auto_encoder.py --shapenet-root <path/to/ShapeNet> \
--categories <category list> \
--cache-dir cache/
```
python eval.py
To evaluate a trained model
(Note, in the Trimesh window, tap `c` to disable backface culling)
```bash
python eval.py --shapenet-root <path/to/ShapeNet> \
--shapenet-images-root <path/to/ShapeNetImages> \
--categories <category list> \
--cache-dir cache/
```




0 comments on commit dcacac5

Please sign in to comment.