Surn commited on
Commit
bc2ae02
·
1 Parent(s): faf797f

requirements update for HF

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitignore +2 -0
  2. app.py +25 -3
  3. requirements.txt +5 -5
  4. trellis/__pycache__/__init__.cpython-312.pyc +0 -0
  5. trellis/models/__pycache__/__init__.cpython-312.pyc +0 -0
  6. trellis/models/__pycache__/sparse_structure_flow.cpython-312.pyc +0 -0
  7. trellis/models/__pycache__/sparse_structure_vae.cpython-312.pyc +0 -0
  8. trellis/models/__pycache__/structured_latent_flow.cpython-312.pyc +0 -0
  9. trellis/models/structured_latent_vae/__pycache__/__init__.cpython-312.pyc +0 -0
  10. trellis/models/structured_latent_vae/__pycache__/base.cpython-312.pyc +0 -0
  11. trellis/models/structured_latent_vae/__pycache__/decoder_gs.cpython-312.pyc +0 -0
  12. trellis/models/structured_latent_vae/__pycache__/decoder_mesh.cpython-312.pyc +0 -0
  13. trellis/models/structured_latent_vae/__pycache__/decoder_rf.cpython-312.pyc +0 -0
  14. trellis/models/structured_latent_vae/__pycache__/encoder.cpython-312.pyc +0 -0
  15. trellis/modules/__pycache__/norm.cpython-312.pyc +0 -0
  16. trellis/modules/__pycache__/spatial.cpython-312.pyc +0 -0
  17. trellis/modules/__pycache__/utils.cpython-312.pyc +0 -0
  18. trellis/modules/attention/__pycache__/__init__.cpython-312.pyc +0 -0
  19. trellis/modules/attention/__pycache__/full_attn.cpython-312.pyc +0 -0
  20. trellis/modules/attention/__pycache__/modules.cpython-312.pyc +0 -0
  21. trellis/modules/sparse/__pycache__/__init__.cpython-312.pyc +0 -0
  22. trellis/modules/sparse/__pycache__/basic.cpython-312.pyc +0 -0
  23. trellis/modules/sparse/__pycache__/linear.cpython-312.pyc +0 -0
  24. trellis/modules/sparse/__pycache__/nonlinearity.cpython-312.pyc +0 -0
  25. trellis/modules/sparse/__pycache__/norm.cpython-312.pyc +0 -0
  26. trellis/modules/sparse/__pycache__/spatial.cpython-312.pyc +0 -0
  27. trellis/modules/sparse/attention/__pycache__/__init__.cpython-312.pyc +0 -0
  28. trellis/modules/sparse/attention/__pycache__/full_attn.cpython-312.pyc +0 -0
  29. trellis/modules/sparse/attention/__pycache__/modules.cpython-312.pyc +0 -0
  30. trellis/modules/sparse/attention/__pycache__/serialized_attn.cpython-312.pyc +0 -0
  31. trellis/modules/sparse/attention/__pycache__/windowed_attn.cpython-312.pyc +0 -0
  32. trellis/modules/sparse/conv/__pycache__/__init__.cpython-312.pyc +0 -0
  33. trellis/modules/sparse/conv/__pycache__/conv_spconv.cpython-312.pyc +0 -0
  34. trellis/modules/sparse/transformer/__pycache__/__init__.cpython-312.pyc +0 -0
  35. trellis/modules/sparse/transformer/__pycache__/blocks.cpython-312.pyc +0 -0
  36. trellis/modules/sparse/transformer/__pycache__/modulated.cpython-312.pyc +0 -0
  37. trellis/modules/transformer/__pycache__/__init__.cpython-312.pyc +0 -0
  38. trellis/modules/transformer/__pycache__/blocks.cpython-312.pyc +0 -0
  39. trellis/modules/transformer/__pycache__/modulated.cpython-312.pyc +0 -0
  40. trellis/pipelines/__pycache__/__init__.cpython-312.pyc +0 -0
  41. trellis/pipelines/__pycache__/base.cpython-312.pyc +0 -0
  42. trellis/pipelines/__pycache__/trellis_image_to_3d.cpython-312.pyc +0 -0
  43. trellis/pipelines/samplers/__pycache__/__init__.cpython-312.pyc +0 -0
  44. trellis/pipelines/samplers/__pycache__/base.cpython-312.pyc +0 -0
  45. trellis/pipelines/samplers/__pycache__/classifier_free_guidance_mixin.cpython-312.pyc +0 -0
  46. trellis/pipelines/samplers/__pycache__/flow_euler.cpython-312.pyc +0 -0
  47. trellis/pipelines/samplers/__pycache__/guidance_interval_mixin.cpython-312.pyc +0 -0
  48. trellis/renderers/__pycache__/__init__.cpython-312.pyc +0 -0
  49. trellis/renderers/__pycache__/gaussian_render.cpython-312.pyc +0 -0
  50. trellis/renderers/__pycache__/mesh_renderer.cpython-312.pyc +0 -0
.gitignore CHANGED
@@ -166,3 +166,5 @@ cython_debug/
166
  /__pycache__
167
  /temp_models
168
  /.vscode/settings.json
 
 
 
166
  /__pycache__
167
  /temp_models
168
  /.vscode/settings.json
169
+ **/*.pyc
170
+ **/__pycache__/
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import gradio as gr
2
  import os
3
-
4
  import numpy as np
5
  os.environ['SPCONV_ALGO'] = 'native'
6
  from typing import *
@@ -100,7 +100,7 @@ from utils.version_info import (
100
  #release_torch_resources,
101
  #get_torch_info
102
  )
103
- import spaces
104
 
105
  input_image_palette = []
106
  current_prerendered_image = gr.State("./images/images/Beeuty-1.png")
@@ -718,6 +718,28 @@ def generate_3d_asset(depth_image_source, randomize_seed, seed, input_image, out
718
  "cfg_strength": 3.0,
719
  },
720
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
721
  # Save the video to a temporary file
722
  user_dir = os.path.join(constants.TMPDIR, str(req.session_hash))
723
  os.makedirs(user_dir, exist_ok=True)
@@ -725,7 +747,7 @@ def generate_3d_asset(depth_image_source, randomize_seed, seed, input_image, out
725
  video = render_utils.render_video(outputs['gaussian'][0], resolution=576, num_frames=60, r=1)['color']
726
  snapshot_results = render_utils.render_snapshot(outputs['gaussian'][0], resolution=576)
727
  depth_snapshot = snapshot_results['depth'][0]
728
- video_geo = render_utils.render_video(outputs['mesh'][0], resolution=576, num_frames=30, r=1)['normal']
729
  video = [np.concatenate([video[i], video_geo[i]], axis=1) for i in range(len(video))]
730
  video_path = os.path.join(user_dir, f'{output_name}.mp4')
731
  imageio.mimsave(video_path, video, fps=15)
 
1
  import gradio as gr
2
  import os
3
+ import spaces
4
  import numpy as np
5
  os.environ['SPCONV_ALGO'] = 'native'
6
  from typing import *
 
100
  #release_torch_resources,
101
  #get_torch_info
102
  )
103
+
104
 
105
  input_image_palette = []
106
  current_prerendered_image = gr.State("./images/images/Beeuty-1.png")
 
718
  "cfg_strength": 3.0,
719
  },
720
  )
721
+
722
+ # Validate the mesh
723
+ mesh = outputs['mesh'][0]
724
+ # Depending on the mesh format (it might be a dict or an object)
725
+ if isinstance(mesh, dict):
726
+ vertices = mesh['vertices']
727
+ faces = mesh['faces']
728
+ else:
729
+ vertices = mesh.vertices
730
+ faces = mesh.faces
731
+
732
+ # Check mesh properties
733
+ print(f"Mesh vertices: {vertices.shape}, faces: {faces.shape}")
734
+ if faces.max() >= vertices.shape[0]:
735
+ raise ValueError(f"Invalid mesh: face index {faces.max()} exceeds vertex count {vertices.shape[0]}")
736
+
737
+ # Ensure data is on GPU and has correct type
738
+ if not vertices.is_cuda or not faces.is_cuda:
739
+ raise ValueError("Mesh data must be on GPU")
740
+ if vertices.dtype != torch.float32 or faces.dtype != torch.int32:
741
+ raise ValueError("Mesh vertices must be float32, faces must be int32")
742
+
743
  # Save the video to a temporary file
744
  user_dir = os.path.join(constants.TMPDIR, str(req.session_hash))
745
  os.makedirs(user_dir, exist_ok=True)
 
747
  video = render_utils.render_video(outputs['gaussian'][0], resolution=576, num_frames=60, r=1)['color']
748
  snapshot_results = render_utils.render_snapshot(outputs['gaussian'][0], resolution=576)
749
  depth_snapshot = snapshot_results['depth'][0]
750
+ video_geo = render_utils.render_video(outputs['mesh'][0], resolution=576, num_frames=60, r=1)['normal']
751
  video = [np.concatenate([video[i], video_geo[i]], axis=1) for i in range(len(video))]
752
  video_path = os.path.join(user_dir, f'{output_name}.mp4')
753
  imageio.mimsave(video_path, video, fps=15)
requirements.txt CHANGED
@@ -17,9 +17,9 @@ sentencepiece
17
 
18
  #generic Torch versions
19
  --extra-index-url https://download.pytorch.org/whl/cu124
20
- torch==2.6.0
21
  torchvision
22
- #xformers #==0.0.29.post3
23
 
24
  # Other dependencies
25
  Haishoku
@@ -68,9 +68,9 @@ git+https://github.com/EasternJournalist/utils3d.git@9a4eb15e4021b67b12c460c7057
68
  spconv-cu124==2.3.8
69
  gradio_litmodel3d==0.0.1
70
  #linux only
71
- #https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.0.post2/flash_attn-2.7.0.post2+cu12torch2.4cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
72
- #https://huggingface.co/spaces/JeffreyXiang/TRELLIS/resolve/main/wheels/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl?download=true
73
- #https://huggingface.co/spaces/JeffreyXiang/TRELLIS/resolve/main/wheels/nvdiffrast-0.3.3-cp310-cp310-linux_x86_64.whl?download=true
74
  #Windows only
75
  #https://huggingface.co/spaces/Surn/HexaGrid/main/wheels/flash_attn-2.7.4.post1-cp312-cp312-win_amd64.whl?download=true
76
  #https://huggingface.co/spaces/Surn/HexaGrid/main/wheels/diff_gaussian_rasterization-0.0.0-cp312-cp312-win_amd64.whl?download=true
 
17
 
18
  #generic Torch versions
19
  --extra-index-url https://download.pytorch.org/whl/cu124
20
+ torch
21
  torchvision
22
+ xformers #==0.0.29.post3
23
 
24
  # Other dependencies
25
  Haishoku
 
68
  spconv-cu124==2.3.8
69
  gradio_litmodel3d==0.0.1
70
  #linux only
71
+ https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.3/flash_attn-2.7.3+cu12torch2.6cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
72
+ https://huggingface.co/spaces/JeffreyXiang/TRELLIS/resolve/main/wheels/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl?download=true
73
+ https://huggingface.co/spaces/JeffreyXiang/TRELLIS/resolve/main/wheels/nvdiffrast-0.3.3-cp310-cp310-linux_x86_64.whl?download=true
74
  #Windows only
75
  #https://huggingface.co/spaces/Surn/HexaGrid/main/wheels/flash_attn-2.7.4.post1-cp312-cp312-win_amd64.whl?download=true
76
  #https://huggingface.co/spaces/Surn/HexaGrid/main/wheels/diff_gaussian_rasterization-0.0.0-cp312-cp312-win_amd64.whl?download=true
trellis/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (343 Bytes)
 
trellis/models/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (3.22 kB)
 
trellis/models/__pycache__/sparse_structure_flow.cpython-312.pyc DELETED
Binary file (12.1 kB)
 
trellis/models/__pycache__/sparse_structure_vae.cpython-312.pyc DELETED
Binary file (15.1 kB)
 
trellis/models/__pycache__/structured_latent_flow.cpython-312.pyc DELETED
Binary file (14.7 kB)
 
trellis/models/structured_latent_vae/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (387 Bytes)
 
trellis/models/structured_latent_vae/__pycache__/base.cpython-312.pyc DELETED
Binary file (6.57 kB)
 
trellis/models/structured_latent_vae/__pycache__/decoder_gs.cpython-312.pyc DELETED
Binary file (7.94 kB)
 
trellis/models/structured_latent_vae/__pycache__/decoder_mesh.cpython-312.pyc DELETED
Binary file (8.24 kB)
 
trellis/models/structured_latent_vae/__pycache__/decoder_rf.cpython-312.pyc DELETED
Binary file (6.35 kB)
 
trellis/models/structured_latent_vae/__pycache__/encoder.cpython-312.pyc DELETED
Binary file (3.5 kB)
 
trellis/modules/__pycache__/norm.cpython-312.pyc DELETED
Binary file (2.29 kB)
 
trellis/modules/__pycache__/spatial.cpython-312.pyc DELETED
Binary file (3.85 kB)
 
trellis/modules/__pycache__/utils.cpython-312.pyc DELETED
Binary file (2.42 kB)
 
trellis/modules/attention/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (1.17 kB)
 
trellis/modules/attention/__pycache__/full_attn.cpython-312.pyc DELETED
Binary file (7.38 kB)
 
trellis/modules/attention/__pycache__/modules.cpython-312.pyc DELETED
Binary file (10.5 kB)
 
trellis/modules/sparse/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (3.57 kB)
 
trellis/modules/sparse/__pycache__/basic.cpython-312.pyc DELETED
Binary file (27.8 kB)
 
trellis/modules/sparse/__pycache__/linear.cpython-312.pyc DELETED
Binary file (1.09 kB)
 
trellis/modules/sparse/__pycache__/nonlinearity.cpython-312.pyc DELETED
Binary file (2.4 kB)
 
trellis/modules/sparse/__pycache__/norm.cpython-312.pyc DELETED
Binary file (4.48 kB)
 
trellis/modules/sparse/__pycache__/spatial.cpython-312.pyc DELETED
Binary file (8.59 kB)
 
trellis/modules/sparse/attention/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (280 Bytes)
 
trellis/modules/sparse/attention/__pycache__/full_attn.cpython-312.pyc DELETED
Binary file (13.7 kB)
 
trellis/modules/sparse/attention/__pycache__/modules.cpython-312.pyc DELETED
Binary file (9.64 kB)
 
trellis/modules/sparse/attention/__pycache__/serialized_attn.cpython-312.pyc DELETED
Binary file (10.5 kB)
 
trellis/modules/sparse/attention/__pycache__/windowed_attn.cpython-312.pyc DELETED
Binary file (8.53 kB)
 
trellis/modules/sparse/conv/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (775 Bytes)
 
trellis/modules/sparse/conv/__pycache__/conv_spconv.cpython-312.pyc DELETED
Binary file (6.47 kB)
 
trellis/modules/sparse/transformer/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (223 Bytes)
 
trellis/modules/sparse/transformer/__pycache__/blocks.cpython-312.pyc DELETED
Binary file (7.05 kB)
 
trellis/modules/sparse/transformer/__pycache__/modulated.cpython-312.pyc DELETED
Binary file (7.76 kB)
 
trellis/modules/transformer/__pycache__/__init__.cpython-312.pyc CHANGED
Binary files a/trellis/modules/transformer/__pycache__/__init__.cpython-312.pyc and b/trellis/modules/transformer/__pycache__/__init__.cpython-312.pyc differ
 
trellis/modules/transformer/__pycache__/blocks.cpython-312.pyc CHANGED
Binary files a/trellis/modules/transformer/__pycache__/blocks.cpython-312.pyc and b/trellis/modules/transformer/__pycache__/blocks.cpython-312.pyc differ
 
trellis/modules/transformer/__pycache__/modulated.cpython-312.pyc CHANGED
Binary files a/trellis/modules/transformer/__pycache__/modulated.cpython-312.pyc and b/trellis/modules/transformer/__pycache__/modulated.cpython-312.pyc differ
 
trellis/pipelines/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (1.18 kB)
 
trellis/pipelines/__pycache__/base.cpython-312.pyc DELETED
Binary file (3.48 kB)
 
trellis/pipelines/__pycache__/trellis_image_to_3d.cpython-312.pyc DELETED
Binary file (21.2 kB)
 
trellis/pipelines/samplers/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (330 Bytes)
 
trellis/pipelines/samplers/__pycache__/base.cpython-312.pyc DELETED
Binary file (678 Bytes)
 
trellis/pipelines/samplers/__pycache__/classifier_free_guidance_mixin.cpython-312.pyc DELETED
Binary file (988 Bytes)
 
trellis/pipelines/samplers/__pycache__/flow_euler.cpython-312.pyc DELETED
Binary file (9.83 kB)
 
trellis/pipelines/samplers/__pycache__/guidance_interval_mixin.cpython-312.pyc DELETED
Binary file (1.13 kB)
 
trellis/renderers/__pycache__/__init__.cpython-312.pyc DELETED
Binary file (1.3 kB)
 
trellis/renderers/__pycache__/gaussian_render.cpython-312.pyc DELETED
Binary file (9.08 kB)
 
trellis/renderers/__pycache__/mesh_renderer.cpython-312.pyc DELETED
Binary file (7.44 kB)