Instructions to use devin-lai/Hi3Dv1.0-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use devin-lai/Hi3Dv1.0-mlx with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download devin-lai/Hi3Dv1.0-mlx --local-dir Hi3Dv1.0-mlx
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
File size: 963 Bytes
5b702b4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | import numpy as np
import pytest
import torch
from hi3d_mac.fast_unique import unique_keys
from hi3d_mac.lean_extract import construct_voxel_grid
@pytest.mark.parametrize("counts", [False, True])
def test_unique_empty_keys_matches_numpy(counts):
keys = np.empty(0, dtype=np.int64)
values, inverse, observed_counts = unique_keys(keys, return_counts=counts)
reference = np.unique(keys, return_inverse=True, return_counts=counts)
np.testing.assert_array_equal(values, reference[0])
np.testing.assert_array_equal(inverse, reference[1])
if counts:
np.testing.assert_array_equal(observed_counts, reference[2])
else:
assert observed_counts is None
def test_empty_voxel_grid_preserves_shapes_and_dtypes():
vertices, cubes = construct_voxel_grid(torch.empty((0, 3), dtype=torch.int32))
assert vertices.shape == (0, 3) and vertices.dtype == torch.int32
assert cubes.shape == (0, 8) and cubes.dtype == torch.int64
|