Spaces:
Runtime error
Runtime error
add
Browse files- .gitignore +2 -2
- requirements.txt +0 -1
- src/utils/loading.py +0 -20
.gitignore
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
data/
|
2 |
checkpoints/
|
3 |
venv/
|
4 |
log_feature/
|
5 |
log/
|
6 |
-
trex/
|
7 |
log_style/
|
|
|
|
|
8 |
|
9 |
|
|
|
|
|
1 |
checkpoints/
|
2 |
venv/
|
3 |
log_feature/
|
4 |
log/
|
|
|
5 |
log_style/
|
6 |
+
data/
|
7 |
+
trex/
|
8 |
|
9 |
|
requirements.txt
CHANGED
@@ -2,7 +2,6 @@ pytorch_lightning==1.9.0
|
|
2 |
transformers==4.26.1
|
3 |
pytorch_metric_learning==2.0.1
|
4 |
pandas==1.5.3
|
5 |
-
pymeshlab
|
6 |
tabulate
|
7 |
torchvision
|
8 |
matplotlib
|
|
|
2 |
transformers==4.26.1
|
3 |
pytorch_metric_learning==2.0.1
|
4 |
pandas==1.5.3
|
|
|
5 |
tabulate
|
6 |
torchvision
|
7 |
matplotlib
|
src/utils/loading.py
CHANGED
@@ -1,26 +1,6 @@
|
|
1 |
-
import random
|
2 |
-
import numpy as np
|
3 |
-
import pymeshlab
|
4 |
import yaml
|
5 |
|
6 |
|
7 |
def load_yaml(path):
|
8 |
with open(path, "rt") as f:
|
9 |
return yaml.safe_load(f)
|
10 |
-
|
11 |
-
|
12 |
-
def load_point_cloud(filename: str, n_sample: int = 1024):
|
13 |
-
ms = pymeshlab.MeshSet()
|
14 |
-
ms.load_new_mesh(filename)
|
15 |
-
ms.generate_sampling_poisson_disk(samplenum=n_sample)
|
16 |
-
pc_list = ms.current_mesh().vertex_matrix()
|
17 |
-
|
18 |
-
n = len(pc_list)
|
19 |
-
if n > n_sample:
|
20 |
-
pc_list = np.array(random.choices(pc_list, k=n_sample))
|
21 |
-
elif n < n_sample:
|
22 |
-
pc_list = np.concatenate(
|
23 |
-
[pc_list, np.array(random.choices(pc_list, k=n_sample - n))], axis=0
|
24 |
-
)
|
25 |
-
|
26 |
-
return pc_list
|
|
|
|
|
|
|
|
|
1 |
import yaml
|
2 |
|
3 |
|
4 |
def load_yaml(path):
|
5 |
with open(path, "rt") as f:
|
6 |
return yaml.safe_load(f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|