Giter VIP home page Giter VIP logo

3d-iwgan's Introduction

Improved Adversarial Systems for 3D Object Generation and Reconstruction:

This is a repository for the paper "Improved Adversarial Systems for 3D Object Generation and Reconstruction". There are three GAN projects held here. The first, held in the folder 3D-Generation, is code for generating 3D objects. The second, held in the folder 3D-reconstruction-Image, is code for producing 3D objects when conditioned on image inputs. The third, held in the folder 3D-reconstruction-Kinect, is code for reconstructing 3D objects, from single perspective depth scans.

Diagram A diagram outlining the 3 Generative Adverserial Networks used in this repo.

Example 3D Generation

AllClasses Example 3D objects generated from a distribution constisting of 10 3D object classes in 12 orientations, rotated for easy viewing.

Comparison
Comparison of 3D-IWGAN's generation ability compared to that of 3D-GAN's.

Reference:

please cite my paper if you use this repo for research https://arxiv.org/abs/1707.09557

New Work:

Please check out my new paper's repo here if you have an interest in 3D generation and reconstruction. Example Reconstruction:

An example reconstruction result from a single image.

3d-iwgan's People

Contributors

alexandermelde avatar edwardsmith1884 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

3d-iwgan's Issues

"rander_graphs" error

Hi,
Thanks for your code,
When I trained 3D-VAE-IWGAN, a error happened around of "rander_graphs":

Traceback (most recent call last):
File "20-VAE-3D-IWGAN.py", line 162, in
track_valid_loss) # this will only work after a 50 iterations to allows for proper averating
File "../scripts/GANutils.py", line 224, in render_graphs
plt.plot(track_d_loss_iter, smoothed_d_loss, color = 'red')
File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 3261, in plot
ret = ax.plot(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/init.py", line 1717, in inner
return func(ax, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/axes/_axes.py", line 1372, in plot
for line in self._get_lines(*args, **kwargs):
File "/usr/local/lib/python2.7/dist-packages/matplotlib/axes/_base.py", line 404, in _grab_next_args
for seg in self._plot_args(this, kwargs):
File "/usr/local/lib/python2.7/dist-packages/matplotlib/axes/_base.py", line 384, in _plot_args
x, y = self._xy_from_xy(x, y)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/axes/_base.py", line 243, in _xy_from_xy
"have shapes {} and {}".format(x.shape, y.shape))
ValueError: x and y must have same first dimension, but have shapes (56,) and (136,)

And I printed the length of "track_d_loss_iter" and "smoothed_d_loss", the length of "track_d_loss_iter" equals to(training set number / batch_size). The length of "smoothed_d_loss" comes from the function "def savitzky_golay(y, window_size, order, deriv=0, rate=1):". I have tried my best to understand the function, however, I could not fix this bug by myself.
And, could you help me:
Thanks!

The problem of Reconstruction of 3D Objects from Single Perspective Depth Scans

Hi, thank you for your code. I have the problem about "Reconstruction of 3D Objects from Single Perspective Depth Scans".
1.In the 3D_generation.sh
# # convert to our format
python convert_shapenet10.py 3DShapeNets
python Kinect_setup.py chair
The data produced by above codes are from ShapeNet . However, the data in the paper show ModelNet, such as ' Example synthetic single perspective kinetic scans created by the authors, produced from the chair class of the ModelNet10 dataset.' in fig8. It's a contradiction.

2.I guess that Kinect-VAE-3D-IWGAN.py aims at fig8, and is it right? Could you share the code that converts Kinect RGB-D images (A Large Dataset of Object Scans dataset [33] ) to voxel representations(fig.10) ?

Thanks very much! Look forward to your reply.

im geting following error while running the code

Traceback (most recent call last):
File "DataSetPrep.py", line 7, in
import scripts.binvox_rw
ImportError: bad magic number in 'scripts': b'\x03\xf3\r\n'

Traceback (most recent call last):
File "/home/student/Desktop/3D-IWGAN-master/scripts/render_pipeline/render_model_views.py", line 30, in
import numpy as np
ModuleNotFoundError: No module named 'numpy'
Read blend: /home/student/Desktop/3D-IWGAN-master/scripts/render_pipeline/blank.blend

About the average precision score

Thanks for your beautiful codes,I'm doing something about the 3d-iwgan recently.I wander to know how to work out the average precision socre,thanks!

Low GPU utilization

Hi,

We are trying to recreate the results on the chairs dataset. Everything works OK, except the GPU utilization is very low (<5%) and the CPU is non stop on 100%. Is this correct? Otherwise with these specs, we are looking for one month of training.

I've included short log from beginning of training process below.

tf-version: 1.12
os: Windows 10,
cpu: i7-7700 CPU @ 3.60 GHz
gpu: GeForce GTX 1080

(3dspacegen) D:\3dspacegen\vae_gan\3D-Reconstruction-Image>python 20-VAE-3D-IWGAN.py -n chair -d data\\voxels\\chair -i data\\overlays\\chair
Using TensorFlow backend.
[2019-03-29 14:12:51,790] [tl_logging] [WARNING]: WARNING: Function: `tensorlayer.activation.leaky_relu` (in file: D:\miniconda\envs\3dspacegen\lib\site-packages\tensorlayer\activation.py) is deprecated and will be removed after 2018-09-30.
Instructions for updating: This API is deprecated. Please use as `tf.nn.leaky_relu`

[2019-03-29 14:12:52,118] [tl_logging] [WARNING]: WARNING: Function: `tensorlayer.layers.utils.set_name_reuse` (in file: D:\miniconda\envs\3dspacegen\lib\site-packages\tensorlayer\layers\utils.py) is deprecated and will be removed after 2018-06-30.
Instructions for updating: TensorLayer relies on TensorFlow to check name reusing

[2019-03-29 14:12:52,118] [tl_logging] [WARNING]: WARNING: this method is DEPRECATED and has no effect, please remove it from your code.
[2019-03-29 14:12:52,352] [tl_logging] [WARNING]: WARNING: this method is DEPRECATED and has no effect, please remove it from your code.
[2019-03-29 14:12:52,539] [tl_logging] [WARNING]: WARNING: this method is DEPRECATED and has no effect, please remove it from your code.
[2019-03-29 14:12:52,711] [tl_logging] [WARNING]: WARNING: this method is DEPRECATED and has no effect, please remove it from your code.
[2019-03-29 14:12:52,852] [tl_logging] [WARNING]: WARNING: this method is DEPRECATED and has no effect, please remove it from your code.
[2019-03-29 14:12:53,820] [tl_logging] [WARNING]: WARNING: this method is DEPRECATED and has no effect, please remove it from your code.
2019-03-29 14:12:55.576779: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
2019-03-29 14:12:55.717923: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-03-29 14:12:55.721467: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988]
2019-03-29 14:12:55.821546: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 0 with properties: 
name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.7335
pciBusID: 0000:01:00.0
totalMemory: 8.00GiB freeMemory: 6.60GiB
2019-03-29 14:12:55.827285: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0
2019-03-29 14:12:56.189054: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-03-29 14:12:56.193933: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988]      0
2019-03-29 14:12:56.196421: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0:   N
2019-03-29 14:12:56.199839: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 8175 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1)
Number of train images: 14482
Epoch: [ 0/1500] [   0/  56] time: 70.5338, d_loss: 9.9828, g_loss: 30.3922, v_loss: 0.9569, r_loss: 0.3035
Epoch: [ 0/1500] [   1/  56] time: 24.3561, d_loss: 9.9533, g_loss: 30.3922, v_loss: 0.8012, r_loss: 0.2749

about data's version

the normal expression of 3d voxel file is .binvox.do you konw how to convert the result of .npy to .binvox?

Render with GPUin DataSetPrep.py

Hello, I rendered pictures of multi views for 3D models with Blender. The versions of Blender is 2.79. And I want to speed the process up via GPU settings in Blender. I removed the annotations of several lines of code in render_model_views.py as follow:

bpy.context.user_preferences.addons['cycles'].preferences.compute_device_type = 'CUDA'
bpy.context.user_preferences.addons['cycles'].preferences.devices[0].use = True
bpy.context.scene.cycles.device = 'GPU'
bpy.ops.render.render(True)

I run the DataSetPrep.py, but when I check the process in GPU card, I can't find blender. And is there any method to solve this problem?
Thank you!

about the module “Path”

When I was converting the dataset according to 3D-Reconstruction-Kinect/3D_generation.sh, I met the problem running this file: convert_shapenet10.py.
Here is the error message:

Traceback (most recent call last):
File "convert_shapenet10.py", line 5, in
from path import Path
ModuleNotFoundError: No module named 'path'

Although I googled it many times, but I still don't know how to solve it, 'cause it seems that there is no such module called "path". Does it matter if not running this file? It seems important..

My version is python 3.6 by the way, with tensorflow 1.13.1 in Windows system

A quick question

Hi Edward,

 I am a student who is attending an AI hackathon together with other students (I am just a beginner). I would like to use your code as our team code base, to accelerate the code and interact with AI at scale. We will surely cite your paper, but we need to get your permission to do so. Also, we are glad to receive other advices or warnings if you have. 

 Thank you very much!

Best Regards,

Weicheng

The version of tensorflow

Could you please provide the tensorflow version you used?
I tried tensorflow 2.0, 1.12, 1.13, but they all failed.

windows environment seems cannot run binox

When running the function binvox(), DataSetPrep.py reports an error saying that some buffers can be used under Linux only. I copied the specific command just to solve the path problem, but now I'm not sure if it can still succeed under Window environment.

Here is the code I write:

command = "binvox -d 100 -pb data/objects/chair/6db2255a51caf84e823e7e244bf84209.obj"
os.system('%s %s' % (command, ''))

And here is part of the error report:

......
Read 6840 faces, 1774 vertices.
Mesh memory use is 17888 KB (17 MB)
Mesh::normalize, bounding box: [-0.224797, -0.421669, -0.147179, 1] - [0.224797, 0.421669, 0.147179, 1]
longest length: 0.843338
normalization transform:
(1) translate [0.224797, 0.421669, 0.147179, 1], (2) scale 1.18576, (3) translate [0, 0, 0]
got mesh bounding box [-0.224797, -0.421669, -0.147179, 1] - [0.224797, 0.421669, 0.147179, 1]

voxel model dimension: 200
Error: sorry, off-screen buffers can be used under Linux only

Questions about Multi-type Joint Training in 2D-3D

     Hi,I had some questions during the joint training.In the process of 2D-3D single-class chair-based dataset training, the default image and voxel have separate file addresses. If we do multi-class joint training, do we need to write the addresses of all six categories of folders, or do we no longer need labels, and directly put the six categories of documents that need training on a single file, that is, the following Those two are the correct instructions for joint training.

one

parser.add_argument('-d','--data', default=['data/voxels/sofa','data/voxels/table','data/voxels/boat','data/voxels/car','data/voxels/plane','data/voxels/chair'], help ='The location for the object voxel models.' )
parser.add_argument('-i','--images', default=['data/overlays/sofa','data/overlays/table','data/overlays/boat','data/overlays/car','data/overlays/plane','data/overlays/chair'], help ='The location for the images.' )

another

parser.add_argument('-d','--data', default=['data/voxels/joint',], help ='The location for the object voxel models.' )
parser.add_argument('-i','--images', default=['data/overlays/joint',], help ='The location for the images.' )

  I don't know which one can be used, or my understanding of joint training is biased. I hope you can help me. Thank you.

Question about 3D-GAN

Hello,

Is the 3D-GAN you implemented the same as the one described in the original paper and have you been able to generate the same results with it?

Indentation Error

Screenshot from 2021-01-26 21-04-47

If u take a look at where the batch_images are defines, it is in the 2nd for loop at line 122 and in line 144 the batch_images are not defined any more. Can you please correct this..

about Voxsize

Hi,
If i use 64 * 64 * 64 size volume as input and set output_size=64, wheather "discriminator" in the models.py should be adjusted or not ? thanks!

problem about Blender

I got some problem of implementation of the code 'DataSetPrep.py'. The Render-process can't work on my computer, and the error information as follows:

'Error: File written by newer Blender binary (270.5), expect loss of data!
Traceback (most recent call last):
File "/home/yves/project_gan/3D_gan/ours/render_pipeline/render_model_views.py", line 23, in
bpy.context.user_preferences.addons['cycles'].preferences.compute_device_type = 'CUDA'
AttributeError: 'NoneType' object has no attribute 'compute_device_type''

Which version of the Blender utilized in this work? and which of the python version?
I set the blender path as ''g_blender_executable_path = '/home/yves/blender-2.70-linux-glibc211-x86_64/blender' #!! MODIFY if necessary'', is it right?

AttributeError: 'module' object has no attribute 'ops'

thanks for your code.

FYI

tl.ops.set_gpu_fraction(sess=sess, gpu_fraction=0.998)
AttributeError: 'module' object has no attribute 'ops'

Apparently ops was replaced with util and the first argument is no longer necessary.

Value passed to parameter 'input_sizes' has DataType float32 not in list of allowed values: int32, int64

When I run you item, I get this error.

Traceback (most recent call last):
File "E:/GAN/7-3D-IWGAN-master/3D-IWGAN-master/3D-Generation/32-3D-Gan.py", line 49, in
net_g , G_train = generator_32(z, is_train=True, reuse = False, sig= True, batch_size=args.batchsize)
File "E:\GAN\7-3D-IWGAN-master\3D-IWGAN-master\scripts\models.py", line 74, in generator_32
net_2 = Deconv(net_1, gf_dim, eighth, '2', batch_size)
File "E:\GAN\7-3D-IWGAN-master\3D-IWGAN-master\scripts\models.py", line 20, in Deconv
act=tf.identity, name='g/net_' + net + '/deconv')
File "D:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\tensorlayer\layers.py", line 1512, in init
self.outputs = act( tf.nn.conv3d_transpose(self.inputs, W, output_shape=output_shape, strides=strides, padding=padding) + b )
File "D:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 2473, in conv3d_transpose
name=name)
File "D:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 2539, in conv3d_transpose_v2
name=name)
File "D:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\ops\gen_nn_ops.py", line 2237, in conv3d_backprop_input_v2
dilations=dilations, name=name)
File "D:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 627, in _apply_op_helper
param_name=input_name)
File "D:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 61, in _SatisfiesTypeConstraint
", ".join(dtypes.as_dtype(x).name for x in allowed_list)))
TypeError: Value passed to parameter 'input_sizes' has DataType float32 not in list of allowed values: int32, int64

I find this error raise becaues 'Conv3DBackpropInputV2' not has float32 dtype, I don't konw why.
Do you have some ideas for this error.

By the why, what tensorflow and tensorlayer version do you used?

About "models.py"

HI,
I was learning your code, thanks for your contributions.
The problem is that, "net_h3" and "MBD" was not found in "models.py", can you help me fix this bug, maybe it was my negligence.
Thank you!

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.