From 93a1d2c1d1a250cfb80cb448e5d7ffd374a37ec6 Mon Sep 17 00:00:00 2001 From: Ethan Steininger Date: Tue, 10 Sep 2024 11:15:24 -0400 Subject: [PATCH] Update mixpeek.mdx reorder create collection --- .../documentation/embeddings/mixpeek.mdx | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/qdrant-landing/content/documentation/embeddings/mixpeek.mdx b/qdrant-landing/content/documentation/embeddings/mixpeek.mdx index ba1d50519..633d54df9 100644 --- a/qdrant-landing/content/documentation/embeddings/mixpeek.mdx +++ b/qdrant-landing/content/documentation/embeddings/mixpeek.mdx @@ -39,7 +39,18 @@ client = QdrantClient("localhost", port=6333) ## Usage -### 1. Process and Embed Video +### 1. Create Qdrant Collection + +Make sure to create a Qdrant collection before inserting vectors. You can create a collection with the appropriate vector size (768 for "vuse-generic-v1" model) using: + +```python +client.create_collection( + collection_name="video_chunks", + vectors_config=models.VectorParams(size=768, distance=models.Distance.COSINE) +) +``` + +### 2. Process and Embed Video First, process the video into chunks and embed each chunk: @@ -87,7 +98,7 @@ for index, chunk in enumerate(processed_chunks): print(f"Processed and inserted {len(processed_chunks)} chunks") ``` -### 2. Search for Similar Video Chunks +### 3. Search for Similar Video Chunks To search for similar video chunks, you can use either text or video queries: @@ -139,16 +150,5 @@ for result in search_results: print(f"Time range: {result.payload['start_time']} - {result.payload['end_time']}") ``` -## Note on Collection Creation - -Make sure to create a Qdrant collection before inserting vectors. You can create a collection with the appropriate vector size (768 for "vuse-generic-v1" model) using: - -```python -client.create_collection( - collection_name="video_chunks", - vectors_config=models.VectorParams(size=768, distance=models.Distance.COSINE) -) -``` - ## Resources For more information on Mixpeek Embed, review the official documentation: https://docs.mixpeek.com/api-documentation/inference/embed