Skip to content

Commit

Permalink
adds video and image example
Browse files Browse the repository at this point in the history
  • Loading branch information
net-cscience-raphael committed Aug 14, 2024
1 parent d0b99f8 commit 9f46c0a
Show file tree
Hide file tree
Showing 3 changed files with 263 additions and 0 deletions.
86 changes: 86 additions & 0 deletions example-configs/ingestion/example/image.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"schemas": [
{
"name": "example",
"connection": {
"database": "CottontailConnectionProvider",
"parameters": {
"Host": "127.0.0.1",
"port": "1865"
}
},
"fields": [
{
"name": "averagecolor",
"factory": "AverageColor"
},
{
"name": "file",
"factory": "FileSourceMetadata"
},
{
"name": "clip",
"factory": "DenseEmbedding",
"parameters": {
"host": "http://127.0.0.1:8888",
"model": "open-clip-vit-b32",
"length":"512"
}
},
{
"name": "dino",
"factory": "DenseEmbedding",
"parameters": {
"host": "http://127.0.0.1:8888/",
"model": "dino-v2-vits14",
"length":"384"
}
},
{
"name": "whisper",
"factory": "ASR",
"parameters": {
"host": "http://127.0.0.1:8888/",
"model": "whisper"
}
},
{
"name": "ocr",
"factory": "OCR",
"parameters": {
"host": "http://127.0.0.1:8888/",
"model": "tesseract"
}
},
{
"name": "time",
"factory": "TemporalMetadata"
},
{
"name": "video",
"factory": "VideoSourceMetadata"
},
],
"resolvers": {
"disk": {
"factory": "DiskResolver",
"parameters": {
"location": "./example/thumbs"
}
}
},
"exporters": [
{
"name": "thumbnail",
"factory": "ThumbnailExporter",
"resolverName": "disk",
"parameters": {
"maxSideResolution": "300",
"mimeType": "JPG"
}
}
],
"extractionPipelines": []
}
]
}
82 changes: 82 additions & 0 deletions example-configs/ingestion/example/video.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"schema": "example",
"context": {
"contentFactory": "InMemoryContentFactory",
"resolverName":"disk",
"local": {
"enumerator": {
"path": "./example/media/",
"depth": "3"
},
"filter": {
"type": "SOURCE:IMAGE"
}
}
},
"operators": {
"enumerator": {
"type": "ENUMERATOR",
"factory": "FileSystemEnumerator",
"mediaTypes": ["IMAGE"]
},
"decoder": {
"type": "DECODER",
"factory": "ImageDecoder"
},
"averagecolor": {
"type": "EXTRACTOR",
"fieldName": "averagecolor"
},
"clip": {
"type": "EXTRACTOR",
"fieldName": "clip"
},
"dino": {
"type": "EXTRACTOR",
"fieldName": "dino"
},
"ocr": {
"type": "EXTRACTOR",
"fieldName": "ocr"
},
"meta-file": {
"type": "EXTRACTOR",
"fieldName": "file"
},
"meta-video": {
"type": "EXTRACTOR",
"fieldName": "video"
},
"meta-time": {
"type": "EXTRACTOR",
"fieldName": "time"
},
"thumbnail": {
"type": "EXPORTER",
"exporterName": "thumbnail"
},
"filter": {
"type": "TRANSFORMER",
"factory": "TypeFilterTransformer"
}
},
"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"]}
},
"output": [
"stage-2-0",
"stage-2-1",
"stage-2-2",
"stage-2-3",
"stage-4-0"
],
"mergeType": "COMBINE"
}
95 changes: 95 additions & 0 deletions example-configs/schema/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"schemas": [
{
"name": "example",
"connection": {
"database": "CottontailConnectionProvider",
"parameters": {
"Host": "127.0.0.1",
"port": "1865"
}
},
"fields": [
{
"name": "averagecolor",
"factory": "AverageColor"
},
{
"name": "file",
"factory": "FileSourceMetadata"
},
{
"name": "clip",
"factory": "DenseEmbedding",
"parameters": {
"host": "http://127.0.0.1:8888",
"model": "open-clip-vit-b32",
"length":"512"
}
},
{
"name": "dino",
"factory": "DenseEmbedding",
"parameters": {
"host": "http://127.0.0.1:8888/",
"model": "dino-v2-vits14",
"length":"384"
}
},
{
"name": "whisper",
"factory": "ASR",
"parameters": {
"host": "http://127.0.0.1:8888/",
"model": "whisper"
}
},
{
"name": "ocr",
"factory": "OCR",
"parameters": {
"host": "http://127.0.0.1:8888/",
"model": "tesseract"
}
},
{
"name": "time",
"factory": "TemporalMetadata"
},
{
"name": "video",
"factory": "VideoSourceMetadata"
},
],
"resolvers": {
"disk": {
"factory": "DiskResolver",
"parameters": {
"location": "./example/thumbs"
}
}
},
"exporters": [
{
"name": "thumbnail",
"factory": "ThumbnailExporter",
"resolverName": "disk",
"parameters": {
"maxSideResolution": "300",
"mimeType": "JPG"
}
}
],
"extractionPipelines": [
{
"name": "video",
"path": "./example/video.json"
},
{
"name": "image",
"path": "./example/image.json"
}
]
}
]
}

0 comments on commit 9f46c0a

Please sign in to comment.