Skip to content

Commit

Permalink
Merge branch 'feature/Segmenter' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
net-cscience-raphael committed Nov 21, 2024
2 parents 33d5dbb + d26bf77 commit ff198c9
Show file tree
Hide file tree
Showing 11 changed files with 747 additions and 38 deletions.
17 changes: 11 additions & 6 deletions example-configs/ingestion/example/video.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
"depth": "3"
},
"decoder": {
"timeWindowMs": "6000"
"timeWindowMs": "1000"
},
"segmenter": {
"duration": "6000",
"lookAheadTime": "1000"
},
"filter": {
"type": "SOURCE:VIDEO"
Expand All @@ -47,6 +51,10 @@
"type": "DECODER",
"factory": "VideoDecoder"
},
"segmenter": {
"type": "TRANSFORMER",
"factory": "FixedDurationSegmenter"
},
"metadata":{
"type": "EXTRACTOR",
"fieldName": "video"
Expand Down Expand Up @@ -87,16 +95,13 @@
"operations": {
"enumerator": {"operator": "enumerator"},
"decoder": {"operator": "decoder", "inputs": ["enumerator"]},
"path": {"operator": "path", "inputs": ["decoder"]},
"segmenter": {"operator": "decoder", "inputs": ["decoder"]},
"path": {"operator": "path", "inputs": ["segmenter"]},
"metadata": {"operator": "metadata", "inputs": ["path"], "merge": "COMBINE"},

"source": {"operator": "source", "inputs": ["metadata"]},

"time": {"operator": "time", "inputs": ["source"]},
"selector": {"operator": "selector", "inputs": ["time"]},

"thumbnail": {"operator": "thumbnail", "inputs": ["selector"]},

"clip": {"operator": "clip", "inputs": ["thumbnail"]},
"filter": {"operator": "filter","inputs": ["clip"],"merge": "MERGE"}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.vitrivr.engine.core.model.retrievable

import org.vitrivr.engine.core.database.blackhole.LOGGER
import org.vitrivr.engine.core.model.content.element.ContentElement
import org.vitrivr.engine.core.model.descriptor.Descriptor
import org.vitrivr.engine.core.model.relationship.Relationship
Expand Down Expand Up @@ -159,7 +160,7 @@ abstract class AbstractRetrievable(override val id: UUID, override val type: Str
@Synchronized
override fun addRelationship(relationship: Relationship): Boolean {
check(relationship.subjectId == this.id || relationship.objectId == this.id) {
"Relationship is not related to current retrievable and therefore cannot be added."
LOGGER.error { "Relationship is not related to current retrievable and therefore cannot be added." }
}
if (this.relationshipSet.add(relationship)) {
if (relationship.subjectId == this.id && relationship is Relationship.WithObject) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,14 @@ class PersistingSink(

/* Write entities to database. */
//this.writer.connection.withTransaction {
this.writer.addAll(retrievables)
this.writer.connectAll(relationships)
for ((f, d) in descriptors) {
val writer =
f.let { field -> this.descriptorWriters.computeIfAbsent(field) { it.getWriter() } } as? DescriptorWriter<Descriptor<*>>
if (writer?.addAll(d) != true) {
logger.error { "Failed to persist descriptors for field ${f.fieldName}." }
this.writer.addAll(retrievables)
this.writer.connectAll(relationships)
for ((f, d) in descriptors) {
val writer = f.let { field -> this.descriptorWriters.computeIfAbsent(field) { it.getWriter() } } as? DescriptorWriter<Descriptor<*>>
if (writer?.addAll(d) != true) {
logger.error { "Failed to persist descriptors for field ${f.fieldName}." }
}
}
}
//}

logger.debug { "Persisted ${retrievables.size} retrievables, ${relationships.size} relationships and ${descriptors.values.sumOf { it.size }} descriptors." }
Expand Down
Loading

0 comments on commit ff198c9

Please sign in to comment.