Giter VIP home page Giter VIP logo

Comments (8)

czq142857 avatar czq142857 commented on August 21, 2024
  1. Yes, but you need to change the line
self.data_points = (data_dict['points_'+str(self.sample_vox_size)][:].astype(np.float32)+0.5)/256-0.5

To

self.data_points = (data_dict['points_'+str(self.sample_vox_size)][:].astype(np.float32)+0.5)/self.sample_vox_size-0.5

I haven't tried it myself so let me know if there is a bug.

If you need 256^3 voxels, just use binvox to generate them. You only need to change the shape loader to load binvox files instead of mat files. You can do that using binvox_rw.py:

voxel_model_256 = binvox_rw.read_as_3d_array("example.binvox").data.astype(np.uint8)

Note that you need to make sure the top direction of the shape is pointing Y(j) positive direction. Otherwise, the z-carving in the code does not work.

  1. You can use image files without alpha channels.
img = cv2.imread("example.png")
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
hdf5_file["pixels"][idx,t,:,:] = img

from im-net-pytorch.

lun22u avatar lun22u commented on August 21, 2024

I'm very grateful for your replying.So:
1.If I want to use 256^3 voxel, can I just change command:
binvox -bb -0.5 -0.5 -0.5 0.5 0.5 0.5 -d 64 -e input.obj
to:
binvox -bb -0.5 -0.5 -0.5 0.5 0.5 0.5 -d 256 -e input.obj
2.Considering line 89 in 3_gather_img:
imgo = img[:,:,:3]
which raises error when running code because my png has no alpha channel.How to rewrite this line to get imgo to run line:
img = cv2.cvtColor(imgo, cv2.COLOR_BGR2GRAY)
in your replying?
By the way, Should I use 137x137 png to prepare my training data?
I'm sorry about bothering you again.
Thanks
Zh T

from im-net-pytorch.

czq142857 avatar czq142857 commented on August 21, 2024
  1. Yes. Remember to normalize the shapes first. The shape should be zero-centered and the diagonal of the bounding box needs to be 1.

  2. Make sure your image has 3 channels and just run cv2.cvtColor(img, cv2.COLOR_BGR2GRAY).

  3. The provided code assumes images are 137x137. But during training the images are cropped to 128x128. If you do not want to change the code, use 137x137.

from im-net-pytorch.

lun22u avatar lun22u commented on August 21, 2024

Thank you very much,now I have no problem temporarily.

from im-net-pytorch.

lun22u avatar lun22u commented on August 21, 2024

It works in training (using 256^3binvox and RGB single view image),thank you very much !

from im-net-pytorch.

zhaoyj96 avatar zhaoyj96 commented on August 21, 2024

Hello, lun22u. I want to ask how to get rendering views images used in https://github.com/czq142857/IM-NET/blob/master/point_sampling/3_gather_img.py? Are they generated from https://github.com/czq142857/IM-NET/blob/master/point_sampling/2_test_hdf5.py?

from im-net-pytorch.

lun22u avatar lun22u commented on August 21, 2024

from im-net-pytorch.

zhaoyj96 avatar zhaoyj96 commented on August 21, 2024

Thank you for your reply, lun22u. I have successfully rendered my multi-view images. But there is a problem in normalizing the voxels. Could you tell me how to make the voxel centered and its diagonal of the bounding box to 1.

from im-net-pytorch.

Related Issues (20)

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.