Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use scikit instead of torchmcubes #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

flowtyone
Copy link

Increase usability by using scikit-image instead of the old torchmcubes. This makes the project much easier to install and test.

@mrbid
Copy link

mrbid commented Mar 7, 2024

Increase usability by using scikit-image instead of the old torchmcubes. This makes the project much easier to install and test.

Just out of interest are there any obvious quality benefits over using scikit-image or is this mostly just an installing and testing solution? Speed benefits, wider range of GPU support etc? It would be interesting to actually see a full comparison between the two.

@flowtyone
Copy link
Author

@mrbid speed wasn't impacted in my tests. The issue with torchmcubes is that it lacks prebuilt wheels and has a dependency issue with torch that makes it harder to install

@math-sasso
Copy link

@flowtyone how did you actually solved the problem? If you share a step by step would help a lot. I am struggling a lot to make it work

@flowtyone
Copy link
Author

@math-sasso this PR works, just use my fork branch, it has these changes

@mrbid
Copy link

mrbid commented Mar 28, 2024

flowtyone@341657e

It's quite a minimal and elegant patch. No need to even fork it tbh. This should be merged as an optional function in TripoSR, allowing the user to select which is used - ofc that wont solve the dependency issue, and I don't know if there is a similar ifdef system in Python as there is in C.

@mrbid
Copy link

mrbid commented Apr 4, 2024

I have an error with your fork:

Traceback (most recent call last):
  File "/home/r/Desktop/TripoSR-use-scikit/run.py", line 32, in <module>
    mesh = model.extract_mesh(scene_codes, resolution=256)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/r/Desktop/TripoSR-use-scikit/tsr/system.py", line 172, in extract_mesh
    self.set_marching_cubes_resolution(resolution)
  File "/home/r/Desktop/TripoSR-use-scikit/tsr/system.py", line 169, in set_marching_cubes_resolution
    self.isosurface_helper = MarchingCubeHelper(resolution)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/r/Desktop/TripoSR-use-scikit/tsr/models/isosurface.py", line 20, in __init__
    self.mc_func: Callable = marching_cubes
                             ^^^^^^^^^^^^^^
NameError: name 'marching_cubes' is not defined

I was going to bench it against the original and this modified version by @thatname here: #22 (comment)

@TimCabbage
Copy link

@mrbid @flowtyone
To make it work, one more change is needed:
the line:
self.mc_func: Callable = marching_cubes
Needs to be removed.

Works on ROCM with this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants