mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-20 05:32:49 +03:00
Add ability to use Jina CLIP V2 for semantic search (#16826)
* add wheels * move extra index url to bottom * config model option * add postprocess * fix config * jina v2 embedding class * use jina v2 in embeddings * fix ov inference * frontend * update reference config * revert device * fix truncation * return np tensors * use correct embeddings from inference * manual preprocess * clean up * docs * lower batch size for v2 only * docs clarity * wording
This commit is contained in:
@@ -72,6 +72,9 @@ class BaseEmbedding(ABC):
|
||||
|
||||
return image
|
||||
|
||||
def _postprocess_outputs(self, outputs: any) -> any:
|
||||
return outputs
|
||||
|
||||
def __call__(
|
||||
self, inputs: list[str] | list[Image.Image] | list[str]
|
||||
) -> list[np.ndarray]:
|
||||
@@ -91,5 +94,7 @@ class BaseEmbedding(ABC):
|
||||
else:
|
||||
logger.warning(f"Expected input '{key}' not found in onnx_inputs")
|
||||
|
||||
embeddings = self.runner.run(onnx_inputs)[0]
|
||||
outputs = self.runner.run(onnx_inputs)[0]
|
||||
embeddings = self._postprocess_outputs(outputs)
|
||||
|
||||
return [embedding for embedding in embeddings]
|
||||
|
||||
Reference in New Issue
Block a user