Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Analyst WebApp
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
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
fidentis
Analyst WebApp
Commits
3ebdc53e
There was an error fetching the commit references. Please try again later.
Commit
3ebdc53e
authored
3 years ago
by
Daniel Schramm
Browse files
Options
Downloads
Patches
Plain Diff
Own parallel implementation deleted and existing implementation used instead
parent
e2fa67e0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Comparison/src/main/java/cz/fidentis/analyst/visitors/face/HausdorffDistancePrioritized.java
+3
-24
3 additions, 24 deletions
...s/analyst/visitors/face/HausdorffDistancePrioritized.java
with
3 additions
and
24 deletions
Comparison/src/main/java/cz/fidentis/analyst/visitors/face/HausdorffDistancePrioritized.java
+
3
−
24
View file @
3ebdc53e
...
...
@@ -15,8 +15,6 @@ import java.util.HashSet;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
javax.vecmath.Point3d
;
/**
...
...
@@ -222,30 +220,11 @@ public class HausdorffDistancePrioritized extends HumanFaceVisitor {
@Override
public
void
visitHumanFace
(
HumanFace
humanFace
)
{
final
FeaturePoint
featurePoint
=
humanFace
.
getFeaturePoints
().
get
(
featurePointType
.
getType
());
final
List
<
MeshFacet
>
facets
=
humanFace
.
getMeshModel
().
getFacets
();
final
ExecutorService
executor
=
Executors
.
newFixedThreadPool
(
Runtime
.
getRuntime
().
availableProcessors
());
humanFace
.
getMeshModel
().
compute
(
distanceVisitor
,
inParallel
());
final
FeaturePoint
featurePoint
=
humanFace
.
getFeaturePoints
().
get
(
featurePointType
.
getType
());
final
PrioritySphere
priorityVisitor
=
new
PrioritySphere
(
featurePoint
.
getPosition
(),
1
/*TODO TEMPORARY - sphere radius needs to be computed dynamically*/
);
for
(
final
MeshFacet
comparedFacet:
facets
)
{
// For each mesh facet of the visited human face
if
(
inParallel
()
&&
distanceVisitor
.
isThreadSafe
())
{
executor
.
execute
(()
->
comparedFacet
.
accept
(
distanceVisitor
));
// Fork and continue
}
else
{
comparedFacet
.
accept
(
distanceVisitor
);
// Process immediately
}
if
(
inParallel
()
&&
priorityVisitor
.
isThreadSafe
())
{
executor
.
execute
(()
->
comparedFacet
.
accept
(
priorityVisitor
));
// Fork and continue
}
else
{
comparedFacet
.
accept
(
priorityVisitor
);
// Proces immediately
}
// Visitors store results into their internal structure
}
if
(
inParallel
())
{
executor
.
shutdown
();
while
(!
executor
.
isTerminated
()){}
// Wait until all computations are finished
}
humanFace
.
getMeshModel
().
compute
(
priorityVisitor
,
inParallel
());
synchronized
(
this
)
{
// Retrieve results from the visitor's internal structure
...
...
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