vitrivr / vitrivr-engine

vitrivr's next-generation retrieval engine. It is capable of extracting and retrieving a wider range of multimedia objects such as audio, video, images or 3d models.
https://vitrivr.org
MIT License
6 stars 3 forks source link

[BUG] <Your Description of the Bug> #113

Closed net-cscience-raphael closed 2 months ago

net-cscience-raphael commented 2 months ago

Description

A clear and concise description of what the bug is.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Setup ingestion pipeline for Source:image
  2. Set PostgreSQL as DB
  3. Start extraction with average color feature.
  4. Error on feature persistence. Vector wrong dimensionality (4 instead of 3)

Exception

2024-09-09 07:04:56.530 [pool-2-thread-3] ERROR PgVectorConnection - Failed to INSERT descriptors into "descriptor_averagecolor" due to SQL error.
 java.sql.BatchUpdateException: Batch entry 0 INSERT INTO "descriptor_averagecolor" (descriptorid, retrievableid, "vector") VALUES (('188cc9dc-3a20-486a-8670-5a49343777b0'::uuid), ('3d852e9d-bdac-47a2-886e-33cf18045ec4'::uuid), ?) was aborted: ERROR: expected 3 dimensions, not 4  Call getNextException to see other errors in the batch.

Environment

Attached the config

{
  "schemas": {
    "sandbox": {
      "connection": {
        "database": "PgVectorConnectionProvider",
        "parameters": {
          "host": "10.34.64.130",
          "port": "5432",
          "database": "postgres",
          "username": "postgres",
          "password": "admin"
        }
      },
      "fields": {
        "averagecolor": {
          "factory": "AverageColor"
        },
        "file": {
          "factory": "FileSourceMetadata"
        }
      },
      "resolvers": {
        "disk": {
          "factory": "DiskResolver",
          "parameters": {
            "location": "D:/4eyes/sandbox/thumbnails/"
          }
        }
      },
      "exporters": {
        "thumbnail": {
          "factory": "ThumbnailExporter",
          "resolverName": "disk",
          "parameters": {
            "maxSideResolution": "512",
            "mimeType": "JPG"
          }
        }
      },
      "extractionPipelines": {
        "ingestion": {
          "path": "D:/4eyes/config-ingestion.json"
        }
      }
    }
  }
}
{
  "schema": "sandbox",
  "context": {
    "contentFactory": "InMemoryContentFactory",
    "resolverName": "disk",
    "local": {
      "enumerator": {
        "path": "D:/PTT-Testdaten/PTT Testdaten",
        "depth": "5"
      },
      "thumbnails": {
        "path": "D:/sandbox/thumbnails"
      },
      "filter": {
        "type": "SOURCE:IMAGE"
      }
    }
  },
  "operators": {
      "enumerator": { "type": "ENUMERATOR", "factory": "FileSystemEnumerator", "mediaTypes": ["IMAGE"]},
      "decoder": { "type": "DECODER", "factory": "ImageDecoder"  },
      "avgColor": { "type": "EXTRACTOR", "fieldName": "averagecolor"},
      "file_metadata": { "type": "EXTRACTOR", "fieldName": "file" },
      "thumbnail": { "type": "EXPORTER", "exporterName": "thumbnail" },
      "filter": { "type": "TRANSFORMER", "factory": "TypeFilterTransformer"}
  },
  "operations": {
      "enumerator": { "operator": "enumerator" },
      "decoder": { "operator": "decoder", "inputs": [ "enumerator" ] },
      "averagecolor": { "operator": "avgColor","inputs": ["decoder"]},
      "thumbnail": {  "operator": "thumbnail", "inputs": ["decoder"] },
      "filter": {  "operator": "filter", "inputs": ["averagecolor", "thumbnail"], "merge": "COMBINE" },
      "file_metadata": {  "operator": "file_metadata", "inputs": ["filter"] }
  },
  "output": ["file_metadata"]
}
net-cscience-raphael commented 2 months ago

Changed the RGBColorContainer.toVector() that one can add the alpha channel manually. See: bd642ef57f3e82ad177bdfba16485ee3b7c5f035