Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Gdrnpp Bop2022
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guillaume Duret
Gdrnpp Bop2022
Commits
b8c3dff1
Commit
b8c3dff1
authored
2 years ago
by
wangg12
Browse files
Options
Downloads
Patches
Plain Diff
fix #17
parent
8ca7d3e0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/render_vispy/model3d.py
+9
-4
9 additions, 4 deletions
lib/render_vispy/model3d.py
requirements/requirements.txt
+0
-1
0 additions, 1 deletion
requirements/requirements.txt
with
9 additions
and
5 deletions
lib/render_vispy/model3d.py
+
9
−
4
View file @
b8c3dff1
...
...
@@ -3,7 +3,6 @@ import os
import
os.path
as
osp
import
cv2
import
fastfunc
import
mmcv
import
numpy
as
np
import
pyassimp
...
...
@@ -30,6 +29,12 @@ support model_loadfn to load objects
"""
def
_fast_add_at
(
target
,
idx
,
vals
):
# https://github.com/ml31415/numpy-groupies/issues/24
# https://github.com/numpy/numpy/issues/5922
return
target
+
np
.
bincount
(
idx
,
weights
=
vals
,
minlength
=
target
.
shape
[
0
])
class
Model3D
:
""""""
...
...
@@ -333,11 +338,11 @@ class Model3D:
num_neighbors
=
np
.
zeros
(
len
(
mesh
.
node_coords
),
dtype
=
int
)
idx
=
mesh
.
edges
[
"
nodes
"
]
fastfunc
.
add
.
at
(
num_neighbors
,
idx
,
np
.
ones
(
idx
.
shape
,
dtype
=
int
))
num_neighbors
=
_fast_
add
_
at
(
num_neighbors
,
idx
,
np
.
ones
(
idx
.
shape
,
dtype
=
int
))
new_points
=
np
.
zeros
(
mesh
.
node_coords
.
shape
)
fastfunc
.
add
.
at
(
new_points
,
idx
[:,
0
],
mesh
.
node_coords
[
idx
[:,
1
]])
fastfunc
.
add
.
at
(
new_points
,
idx
[:,
1
],
mesh
.
node_coords
[
idx
[:,
0
]])
new_points
=
_fast_
add
_
at
(
new_points
,
idx
[:,
0
],
mesh
.
node_coords
[
idx
[:,
1
]])
new_points
=
_fast_
add
_
at
(
new_points
,
idx
[:,
1
],
mesh
.
node_coords
[
idx
[:,
0
]])
new_points
/=
num_neighbors
[:,
None
]
idx
=
mesh
.
is_boundary_node
...
...
This diff is collapsed.
Click to expand it.
requirements/requirements.txt
+
0
−
1
View file @
b8c3dff1
...
...
@@ -9,7 +9,6 @@ ninja
black
docformatter
setproctitle
fastfunc
meshplex
OpenEXR
vispy>=0.6.4
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment