Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ppanopticon committed Oct 31, 2024
2 parents c696273 + f314526 commit c27e605
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 75 deletions.
2 changes: 1 addition & 1 deletion example-configs/ingestion/dense/dense.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"path": "../cache"
},
"enumerator": {
"path": "../objects_dense",,
"path": "../objects_dense",
"depth": "5"
},
"selector":{
Expand Down
97 changes: 61 additions & 36 deletions example-configs/ingestion/example/video.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,79 @@
{
"schema": "example",
"context": {
"contentFactory": "InMemoryContentFactory",
"contentFactory": "CachedContentFactory",
"resolverName":"disk",

"local": {
"clip": {
"contentSources": "selector"
},
"averagecolor": {
"contentSources": "selector"
},
"content": {
"path": "../cache"
},
"thumbnail": {
"contentSources": "selector",
"maxSideResolution": "400",
"mimeType": "JPG"
},
"selector":{
"contentSources": "decoder"
},
"enumerator": {
"path": "./example/media/",
"path": "D:\\v3c",
"depth": "3"
},
"decoder": {
"timeWindowMs": "6000"
},
"filter": {
"type": "SOURCE:IMAGE"
"type": "SOURCE:VIDEO"
},
"path": {
"field": "file"
}
}
},
"operators": {
"enumerator": {
"type": "ENUMERATOR",
"factory": "FileSystemEnumerator",
"mediaTypes": ["IMAGE"]
"mediaTypes": ["VIDEO"]
},
"decoder": {
"type": "DECODER",
"factory": "ImageDecoder"
"factory": "VideoDecoder"
},
"averagecolor": {
"metadata":{
"type": "EXTRACTOR",
"fieldName": "averagecolor"
"fieldName": "video"
},
"clip": {
"source":{
"type": "EXTRACTOR",
"fieldName": "clip"
"fieldName": "file"
},
"dino": {
"type": "EXTRACTOR",
"fieldName": "dino"
"path": {
"type": "TRANSFORMER",
"factory":"DescriptorAsContentTransformer"
},
"ocr": {
"type": "EXTRACTOR",
"fieldName": "ocr"
"selector": {
"type": "TRANSFORMER",
"factory": "LastContentAggregator"
},
"meta-file": {
"time": {
"type": "EXTRACTOR",
"fieldName": "file"
"fieldName": "time"
},
"meta-video": {
"averagecolor": {
"type": "EXTRACTOR",
"fieldName": "video"
"fieldName": "averagecolor"
},
"meta-time": {
"clip": {
"type": "EXTRACTOR",
"fieldName": "time"
"fieldName": "clip"
},
"thumbnail": {
"type": "EXPORTER",
Expand All @@ -61,22 +85,23 @@
}
},
"operations": {
"stage-0-0": {"operator": "enumerator"},
"stage-1-0": {"operator": "decoder","inputs": ["stage-0-0"]},
"stage-2-0": {"operator": "clip","inputs": ["stage-1-0"]},
"stage-2-1": {"operator": "dino","inputs": ["stage-1-0"]},
"stage-2-2": {"operator": "ocr","inputs": ["stage-1-0"]},
"stage-2-3": {"operator": "averagecolor","inputs": ["stage-1-0"]},
"stage-2-4": {"operator": "thumbnail","inputs": ["stage-1-0"]},
"stage-3-0": {"operator": "filter","inputs": ["stage-2-3","stage-2-4"], "merge": "COMBINE"},
"stage-4-0": {"operator": "meta-file", "inputs": ["stage-3-0"]}
"enumerator": {"operator": "enumerator"},
"decoder": {"operator": "decoder", "inputs": ["enumerator"]},
"path": {"operator": "path", "inputs": ["decoder"]},
"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"}
},
"output": [
"stage-2-0",
"stage-2-1",
"stage-2-2",
"stage-2-3",
"stage-4-0"
"filter"
],
"mergeType": "COMBINE"
"mergeType": "MERGE"
}
3 changes: 3 additions & 0 deletions example-configs/schema/dense.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
}
},
"fields": {
"imageFilePathContent": {
"field": "file"
},
"averagecolor": {
"factory": "AverageColor"
},
Expand Down
39 changes: 9 additions & 30 deletions example-configs/schema/example.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
"schemas": {
"example": {
"connection": {
"database": "CottontailConnectionProvider",
"database": "PgVectorConnectionProvider",
"parameters": {
"Host": "127.0.0.1",
"port": "1865"
"port": "5432",
"username": "postgres",
"password": "vitrivr"
}
},
"fields": {
Expand All @@ -18,31 +20,11 @@
"clip": {
"factory": "DenseEmbedding",
"parameters": {
"host": "http://127.0.0.1:8888",
"host": "http://10.34.64.84:8888/",
"model": "open-clip-vit-b32",
"length": "512"
}
},
"dino": {
"factory": "DenseEmbedding",
"parameters": {
"host": "http://127.0.0.1:8888/",
"model": "dino-v2-vits14",
"length": "384"
}
},
"whisper": {
"factory": "ASR",
"parameters": {
"host": "http://127.0.0.1:8888/",
"model": "whisper"
}
},
"ocr": {
"factory": "OCR",
"parameters": {
"host": "http://127.0.0.1:8888/",
"model": "tesseract"
"length": "512",
"timeoutSeconds": "100",
"retries": "1000"
}
},
"time": {
Expand Down Expand Up @@ -72,10 +54,7 @@
},
"extractionPipelines": {
"video": {
"path": "./example/video.json"
},
"image": {
"path": "./example/image.json"
"path": "./example-configs/ingestion/example/video.json"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
}
rootProject.name = 'vitrivr-engine'

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.vitrivr.engine.core.util.extension

import org.vitrivr.engine.core.config.ingest.IngestionPipelineBuilder
import org.vitrivr.engine.core.model.retrievable.Retrievable
import org.vitrivr.engine.core.operators.Operator

public enum class Flavor {
MERMAID
}

fun IngestionPipelineBuilder.build(flavor: Flavor) : List<Operator.Sink<Retrievable>> {
val nodes = this.build()
nodes.forEach {
it.input

}
return nodes
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ fun main(args: Array<String>) {
c.jsonMapper(KotlinxJsonMapper)

/* Registers Open API plugin. */
c.registerPlugin(OpenApiPlugin{
c.registerPlugin(OpenApiPlugin {
it.withDocumentationPath("/openapi.json")
.withDefinitionConfiguration{ _, def ->
def.withInfo{i ->
.withDefinitionConfiguration { _, def ->
def.withInfo { i ->
i.title = "vitrivr engine API"
i.version = "0.1.0"
i.description = "Rest API for the vitrivr engine project. Provides query (runtime) and extraction (ingestion) endpoints"
i.description =
"Rest API for the vitrivr engine project. Provides query (runtime) and extraction (ingestion) endpoints"
}
.withSecurity(
SecurityComponentConfiguration().withSecurityScheme("CookieAuth", CookieAuth("SESSIONID"))
Expand All @@ -59,9 +60,9 @@ fun main(args: Array<String>) {
})
c.http.maxRequestSize = 1024 * 1024 * 1024 /* 1GB */

c.bundledPlugins.enableCors{cors ->
c.bundledPlugins.enableCors { cors ->
/* https://javalin.io/plugins/cors#getting-started */
cors.addRule{
cors.addRule {
it.reflectClientOrigin = true // might be a little too loose
it.allowCredentials = true
}
Expand All @@ -74,7 +75,7 @@ fun main(args: Array<String>) {
swaggerConfig.uiPath = "/swagger-ui"
})

c.router.apiBuilder{
c.router.apiBuilder {
configureApiRoutes(config.api, manager, executor)
}
}.exception(ErrorStatusException::class.java) { e, ctx ->
Expand Down

0 comments on commit c27e605

Please sign in to comment.