diff --git a/build.gradle b/build.gradle index 1c4347f2a..f28059de2 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ allprojects { group = 'org.vitrivr' /* Our current version, on dev branch this should always be release+1-SNAPSHOT */ - version = '3.11.4' + version = '3.11.5' apply plugin: 'java-library' apply plugin: 'maven-publish' diff --git a/cineast-core/src/main/java/org/vitrivr/cineast/core/features/CLIPImage.java b/cineast-core/src/main/java/org/vitrivr/cineast/core/features/CLIPImage.java index bb49bb0be..e8a1507c5 100644 --- a/cineast-core/src/main/java/org/vitrivr/cineast/core/features/CLIPImage.java +++ b/cineast-core/src/main/java/org/vitrivr/cineast/core/features/CLIPImage.java @@ -87,7 +87,7 @@ public List getSimilar(SegmentContainer sc, ReadableQueryConfig qc return getSimilar(embeddingArray, queryConfig); } - private void initializeModel() { + private synchronized static void initializeModel() { if (model == null) { model = SavedModelBundle.load(RESOURCE_PATH + EMBEDDING_MODEL); } diff --git a/cineast-core/src/main/java/org/vitrivr/cineast/core/features/CLIPText.java b/cineast-core/src/main/java/org/vitrivr/cineast/core/features/CLIPText.java index 7a553ba75..2445d8c69 100644 --- a/cineast-core/src/main/java/org/vitrivr/cineast/core/features/CLIPText.java +++ b/cineast-core/src/main/java/org/vitrivr/cineast/core/features/CLIPText.java @@ -60,7 +60,7 @@ public CLIPText() { loadModel(); } - private static void loadModel() { + private synchronized static void loadModel() { if (model == null) { model = SavedModelBundle.load(RESOURCE_PATH + EMBEDDING_MODEL); } diff --git a/cineast-core/src/main/java/org/vitrivr/cineast/core/features/SkeletonPose.java b/cineast-core/src/main/java/org/vitrivr/cineast/core/features/SkeletonPose.java index ede300479..bc6801ac4 100644 --- a/cineast-core/src/main/java/org/vitrivr/cineast/core/features/SkeletonPose.java +++ b/cineast-core/src/main/java/org/vitrivr/cineast/core/features/SkeletonPose.java @@ -57,7 +57,7 @@ public class SkeletonPose extends AbstractFeatureModule { private static final String PERSON_ID_COL = "person"; private static final String FEATURE_COL = "skeleton"; private static final String WEIGHT_COL = "weights"; - private final PoseDetector detector = new MergingPoseDetector(); + private static PoseDetector detector; public SkeletonPose() { super("features_skeletonpose", (float) (16 * Math.PI), 12); @@ -129,7 +129,14 @@ public void persist(Collection> skeletons) { this.phandler.persist(tuples); } + private synchronized static void initializeDetector() { + if (detector == null) { + detector = new MergingPoseDetector(); + } + } + private synchronized List detectSkeletons(MultiImage img) { + initializeDetector(); return detector.detectPoses(img.getBufferedImage()); } diff --git a/cineast-core/src/main/java/org/vitrivr/cineast/core/features/VisualTextCoEmbedding.java b/cineast-core/src/main/java/org/vitrivr/cineast/core/features/VisualTextCoEmbedding.java index 9f6941773..1edfa4e8e 100644 --- a/cineast-core/src/main/java/org/vitrivr/cineast/core/features/VisualTextCoEmbedding.java +++ b/cineast-core/src/main/java/org/vitrivr/cineast/core/features/VisualTextCoEmbedding.java @@ -130,7 +130,7 @@ public List getSimilar(String segmentId, ReadableQueryConfig qc) { return super.getSimilar(segmentId, queryConfig); } - private void initializeTextEmbedding() { + private synchronized static void initializeTextEmbedding() { if (textEmbedding == null) { textEmbedding = SavedModelBundle.load(RESOURCE_PATH + TEXT_EMBEDDING_MODEL); } @@ -139,7 +139,7 @@ private void initializeTextEmbedding() { } } - private void initializeVisualEmbedding() { + private synchronized static void initializeVisualEmbedding() { if (visualEmbedding == null) { visualEmbedding = InceptionResnetV2.getModel(); }