Skip to content

Commit edab0f5

Browse files
Milvus-doc-botMilvus-doc-bot
Milvus-doc-bot
authored and
Milvus-doc-bot
committed
Translate docs
1 parent ac8813c commit edab0f5

File tree

55 files changed

+539
-283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+539
-283
lines changed

localization/v2.4.x/site/fr/menuStructure/fr.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"children": []
7575
},
7676
{
77-
"label": "Exécuter Milvus en mode autonome",
77+
"label": "Run Milvus Standalone",
7878
"id": "run_milvus_docker",
7979
"order": 2,
8080
"isMenu": true,
@@ -1451,7 +1451,7 @@
14511451
"children": []
14521452
},
14531453
{
1454-
"label": "PrivateGPT",
1454+
"label": "PrivéGPT",
14551455
"id": "use_milvus_in_private_gpt.md",
14561456
"order": 10,
14571457
"children": []
@@ -1781,7 +1781,7 @@
17811781
"children": []
17821782
},
17831783
{
1784-
"label": "FAQ opérationnelles",
1784+
"label": "FAQ opérationnelle",
17851785
"id": "operational_faq.md",
17861786
"order": 2,
17871787
"children": []

localization/v2.4.x/site/it/menuStructure/it.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@
493493
"children": []
494494
},
495495
{
496-
"label": "Compattazione dei cluster",
496+
"label": "Compattazione del clustering",
497497
"id": "clustering-compaction.md",
498498
"order": 8,
499499
"children": []
@@ -1729,7 +1729,7 @@
17291729
"children": []
17301730
},
17311731
{
1732-
"label": "Ricerca di somiglianza audio",
1732+
"label": "Ricerca della somiglianza audio",
17331733
"id": "audio_similarity_search.md",
17341734
"order": 8,
17351735
"children": []

localization/v2.4.x/site/pt/menuStructure/pt.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@
803803
"children": []
804804
},
805805
{
806-
"label": "Azure",
806+
"label": "Azulejo",
807807
"id": "abs.md",
808808
"order": 3,
809809
"children": []
@@ -1763,7 +1763,7 @@
17631763
]
17641764
},
17651765
{
1766-
"label": "FAQs",
1766+
"label": "Perguntas frequentes",
17671767
"id": "faq",
17681768
"isMenu": true,
17691769
"order": 9,

localization/v2.4.x/site/zh/menuStructure/zh.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@
677677
"children": []
678678
},
679679
{
680-
"label": "From Milvus 2.3.x",
680+
"label": "来自 Milvus 2.3.x",
681681
"id": "from-m2x.md",
682682
"order": 5,
683683
"children": []

localization/v2.5.x/site/de/about/limitations.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ summary: Informieren Sie sich über die Grenzen bei der Verwendung von Milvus.
106106
<tr><th>Ressource</th><th>Grenze</th></tr>
107107
</thead>
108108
<tbody>
109-
<tr><td>Partition</td><td>4,096</td></tr>
109+
<tr><td>Partition</td><td>1,024</td></tr>
110110
<tr><td>Scherbe</td><td>16</td></tr>
111111
<tr><td>Feld</td><td>64</td></tr>
112112
<tr><td>Index</td><td>1</td></tr>

localization/v2.5.x/site/de/adminGuide/limit_collection_counts.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ title: Begrenzung der Erfassungsanzahl festlegen
6363
></path>
6464
</svg>
6565
</button></h2><p>In einer Sammlung können Sie mehrere Shards und Partitionen einrichten. Shards sind logische Einheiten, die verwendet werden, um Datenschreiboperationen auf mehrere Datenknoten zu verteilen. Partitionen sind logische Einheiten, die dazu dienen, die Effizienz der Datenabfrage zu verbessern, indem nur eine Teilmenge der Sammlungsdaten geladen wird. Wenn Sie die Anzahl der Sammlungen in der aktuellen Milvus-Instanz berechnen, müssen Sie auch die Shards und Partitionen zählen.</p>
66-
<p>Nehmen wir zum Beispiel an, Sie haben bereits <strong>100</strong> Sammlungen angelegt, von denen <strong>60</strong> <strong>mit 2</strong> Shards und <strong>4</strong> Partitionen und die restlichen <strong>40</strong> mit <strong>1</strong> Shard und <strong>12</strong> Partitionen ausgestattet sind. Die aktuelle Anzahl der Sammlungen kann wie folgt berechnet werden:</p>
66+
<p>Nehmen wir zum Beispiel an, dass Sie bereits <strong>100</strong> Sammlungen erstellt haben, von denen <strong>60</strong> <strong>2</strong> Shards und <strong>4</strong> Partitionen und die restlichen <strong>40</strong> Sammlungen <strong>1</strong> Shard und <strong>12</strong> Partitionen enthalten. Die Gesamtzahl der Sammeleinheiten (berechnet als <code translate="no">shards × partitions</code>) kann wie folgt ermittelt werden:</p>
6767
<pre><code translate="no">60 (collections) x 2 (shards) x 4 (partitions) + 40 (collections) x 1 (shard) x 12 (partitions) = 960
6868
<button class="copy-code-btn"></button></code></pre>
69-
<p>Im obigen Beispiel haben Sie bereits <strong>960</strong> der Standardgrenzen genutzt. Wenn Sie nun eine neue Sammlung mit <strong>4</strong> Shards und <strong>20</strong> Partitionen erstellen möchten, erhalten Sie folgende Fehlermeldung, da die Gesamtzahl der Sammlungen die maximale Kapazität überschreitet:</p>
69+
<p>In diesem Beispiel entspricht die berechnete Gesamtzahl von 960 Sammeleinheiten der aktuellen Nutzung. Die <code translate="no">maxGeneralCapacity</code> definiert die maximale Anzahl von Sammeleinheiten, die eine Instanz unterstützen kann, die standardmäßig auf <code translate="no">65536</code> eingestellt ist. Das bedeutet, dass die Instanz bis zu 65.536 Sammeleinheiten aufnehmen kann. Wenn die Gesamtzahl diese Grenze überschreitet, zeigt das System die folgende Fehlermeldung an:</p>
7070
<pre><code translate="no" class="language-shell">failed checking constraint: sum_collections(parition*shard) exceeding the <span class="hljs-built_in">max</span> general capacity:
7171
<button class="copy-code-btn"></button></code></pre>
7272
<p>Um diesen Fehler zu vermeiden, können Sie entweder die Anzahl der Shards oder Partitionen in bestehenden oder neuen Sammlungen reduzieren, einige Sammlungen löschen oder den Wert <code translate="no">maxGeneralCapacity</code> erhöhen.</p>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"codeList":["pip install pymilvus torch gdown torchvision tqdm\n","import gdown\nimport zipfile\n\nurl = 'https://drive.google.com/uc?id=1OYDHLEy992qu5C4C8HV5uDIkOWRTAR1_'\noutput = './paintings.zip'\ngdown.download(url, output)\n\nwith zipfile.ZipFile(\"./paintings.zip\",\"r\") as zip_ref:\n zip_ref.extractall(\"./paintings\")\n","# Milvus Setup Arguments\nCOLLECTION_NAME = 'image_search' # Collection name\nDIMENSION = 2048 # Embedding vector size in this example\nMILVUS_HOST = \"localhost\"\nMILVUS_PORT = \"19530\"\n\n# Inference Arguments\nBATCH_SIZE = 128\nTOP_K = 3\n","from pymilvus import connections\n\n# Connect to the instance\nconnections.connect(host=MILVUS_HOST, port=MILVUS_PORT)\n","from pymilvus import utility\n\n# Remove any previous collections with the same name\nif utility.has_collection(COLLECTION_NAME):\n utility.drop_collection(COLLECTION_NAME)\n","from pymilvus import FieldSchema, CollectionSchema, DataType, Collection\n\n# Create collection which includes the id, filepath of the image, and image embedding\nfields = [\n FieldSchema(name='id', dtype=DataType.INT64, is_primary=True, auto_id=True),\n FieldSchema(name='filepath', dtype=DataType.VARCHAR, max_length=200), # VARCHARS need a maximum length, so for this example they are set to 200 characters\n FieldSchema(name='image_embedding', dtype=DataType.FLOAT_VECTOR, dim=DIMENSION)\n]\nschema = CollectionSchema(fields=fields)\ncollection = Collection(name=COLLECTION_NAME, schema=schema)\n","# Create an AutoIndex index for collection\nindex_params = {\n'metric_type':'L2',\n'index_type':\"IVF_FLAT\",\n'params':{'nlist': 16384}\n}\ncollection.create_index(field_name=\"image_embedding\", index_params=index_params)\ncollection.load()\n","import glob\n\n# Get the filepaths of the images\npaths = glob.glob('./paintings/paintings/**/*.jpg', recursive=True)\nlen(paths)\n","import torch\n\n# Load the embedding model with the last layer removed\nmodel = torch.hub.load('pytorch/vision:v0.10.0', 'resnet50', pretrained=True)\nmodel = torch.nn.Sequential(*(list(model.children())[:-1]))\nmodel.eval()\n","from torchvision import transforms\n\n# Preprocessing for images\npreprocess = transforms.Compose([\n transforms.Resize(256),\n transforms.CenterCrop(224),\n transforms.ToTensor(),\n transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),\n])\n","from PIL import Image\nfrom tqdm import tqdm\n\n# Embed function that embeds the batch and inserts it\ndef embed(data):\n with torch.no_grad():\n output = model(torch.stack(data[0])).squeeze()\n collection.insert([data[1], output.tolist()])\n\ndata_batch = [[],[]]\n\n# Read the images into batches for embedding and insertion\nfor path in tqdm(paths):\n im = Image.open(path).convert('RGB')\n data_batch[0].append(preprocess(im))\n data_batch[1].append(path)\n if len(data_batch[0]) % BATCH_SIZE == 0:\n embed(data_batch)\n data_batch = [[],[]]\n\n# Embed and insert the remainder\nif len(data_batch[0]) != 0:\n embed(data_batch)\n\n# Call a flush to index any unsealed segments.\ncollection.flush()\n","import glob\n\n# Get the filepaths of the search images\nsearch_paths = glob.glob('./paintings/test_paintings/**/*.jpg', recursive=True)\nlen(search_paths)\n","import time\nfrom matplotlib import pyplot as plt\n\n# Embed the search images\ndef embed(data):\n with torch.no_grad():\n ret = model(torch.stack(data))\n # If more than one image, use squeeze\n if len(ret) > 1:\n return ret.squeeze().tolist()\n # Squeeze would remove batch for single image, so using flatten\n else:\n return torch.flatten(ret, start_dim=1).tolist()\n\ndata_batch = [[],[]]\n\nfor path in search_paths:\n im = Image.open(path).convert('RGB')\n data_batch[0].append(preprocess(im))\n data_batch[1].append(path)\n\nembeds = embed(data_batch[0])\nstart = time.time()\nres = collection.search(embeds, anns_field='image_embedding', param={'nprobe': 128}, limit=TOP_K, output_fields=['filepath'])\nfinish = time.time()\n","# Show the image results\nf, axarr = plt.subplots(len(data_batch[1]), TOP_K + 1, figsize=(20, 10), squeeze=False)\n\nfor hits_i, hits in enumerate(res):\n axarr[hits_i][0].imshow(Image.open(data_batch[1][hits_i]))\n axarr[hits_i][0].set_axis_off()\n axarr[hits_i][0].set_title('Search Time: ' + str(finish - start))\n for hit_i, hit in enumerate(hits):\n axarr[hits_i][hit_i + 1].imshow(Image.open(hit.entity.get('filepath')))\n axarr[hits_i][hit_i + 1].set_axis_off()\n axarr[hits_i][hit_i + 1].set_title('Distance: ' + str(hit.distance))\n\n# Save the search result in a separate image file alongside your script.\nplt.savefig('search_result.png')\n"],"headingContent":"Image Search with Milvus","anchorList":[{"label":"Bildsuche mit Milvus","href":"Image-Search-with-Milvus","type":1,"isActive":false},{"label":"Installieren der Voraussetzungen","href":"Installing-the-requirements","type":2,"isActive":false},{"label":"Erfassen der Daten","href":"Grabbing-the-data","type":2,"isActive":false},{"label":"Globale Argumente","href":"Global-Arguments","type":2,"isActive":false},{"label":"Einrichten von Milvus","href":"Setting-up-Milvus","type":2,"isActive":false},{"label":"Einfügen der Daten","href":"Inserting-the-data","type":2,"isActive":false},{"label":"Durchführen der Suche","href":"Performing-the-search","type":2,"isActive":false}]}
1+
{"codeList":["pip install pymilvus torch gdown torchvision tqdm\n","import gdown\nimport zipfile\n\nurl = 'https://drive.google.com/uc?id=1OYDHLEy992qu5C4C8HV5uDIkOWRTAR1_'\noutput = './paintings.zip'\ngdown.download(url, output)\n\nwith zipfile.ZipFile(\"./paintings.zip\",\"r\") as zip_ref:\n zip_ref.extractall(\"./paintings\")\n","# Milvus Setup Arguments\nCOLLECTION_NAME = 'image_search' # Collection name\nDIMENSION = 2048 # Embedding vector size in this example\nMILVUS_HOST = \"localhost\"\nMILVUS_PORT = \"19530\"\n\n# Inference Arguments\nBATCH_SIZE = 128\nTOP_K = 3\n","from pymilvus import connections\n\n# Connect to the instance\nconnections.connect(host=MILVUS_HOST, port=MILVUS_PORT)\n","from pymilvus import utility\n\n# Remove any previous collections with the same name\nif utility.has_collection(COLLECTION_NAME):\n utility.drop_collection(COLLECTION_NAME)\n","from pymilvus import FieldSchema, CollectionSchema, DataType, Collection\n\n# Create collection which includes the id, filepath of the image, and image embedding\nfields = [\n FieldSchema(name='id', dtype=DataType.INT64, is_primary=True, auto_id=True),\n FieldSchema(name='filepath', dtype=DataType.VARCHAR, max_length=200), # VARCHARS need a maximum length, so for this example they are set to 200 characters\n FieldSchema(name='image_embedding', dtype=DataType.FLOAT_VECTOR, dim=DIMENSION)\n]\nschema = CollectionSchema(fields=fields)\ncollection = Collection(name=COLLECTION_NAME, schema=schema)\n","# Create an AutoIndex index for collection\nindex_params = {\n'metric_type':'L2',\n'index_type':\"IVF_FLAT\",\n'params':{'nlist': 16384}\n}\ncollection.create_index(field_name=\"image_embedding\", index_params=index_params)\ncollection.load()\n","import glob\n\n# Get the filepaths of the images\npaths = glob.glob('./paintings/paintings/**/*.jpg', recursive=True)\nlen(paths)\n","import torch\n\n# Load the embedding model with the last layer removed\nmodel = torch.hub.load('pytorch/vision:v0.10.0', 'resnet50', pretrained=True)\nmodel = torch.nn.Sequential(*(list(model.children())[:-1]))\nmodel.eval()\n","from torchvision import transforms\n\n# Preprocessing for images\npreprocess = transforms.Compose([\n transforms.Resize(256),\n transforms.CenterCrop(224),\n transforms.ToTensor(),\n transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),\n])\n","from PIL import Image\nfrom tqdm import tqdm\n\n# Embed function that embeds the batch and inserts it\ndef embed(data):\n with torch.no_grad():\n output = model(torch.stack(data[0])).squeeze()\n collection.insert([data[1], output.tolist()])\n\ndata_batch = [[],[]]\n\n# Read the images into batches for embedding and insertion\nfor path in tqdm(paths):\n im = Image.open(path).convert('RGB')\n data_batch[0].append(preprocess(im))\n data_batch[1].append(path)\n if len(data_batch[0]) % BATCH_SIZE == 0:\n embed(data_batch)\n data_batch = [[],[]]\n\n# Embed and insert the remainder\nif len(data_batch[0]) != 0:\n embed(data_batch)\n\n# Call a flush to index any unsealed segments.\ncollection.flush()\n","import glob\n\n# Get the filepaths of the search images\nsearch_paths = glob.glob('./paintings/test_paintings/**/*.jpg', recursive=True)\nlen(search_paths)\n","import time\nfrom matplotlib import pyplot as plt\n\n# Embed the search images\ndef embed(data):\n with torch.no_grad():\n ret = model(torch.stack(data))\n # If more than one image, use squeeze\n if len(ret) > 1:\n return ret.squeeze().tolist()\n # Squeeze would remove batch for single image, so using flatten\n else:\n return torch.flatten(ret, start_dim=1).tolist()\n\ndata_batch = [[],[]]\n\nfor path in search_paths:\n im = Image.open(path).convert('RGB')\n data_batch[0].append(preprocess(im))\n data_batch[1].append(path)\n\nembeds = embed(data_batch[0])\nstart = time.time()\nres = collection.search(embeds, anns_field='image_embedding', param={'nprobe': 128}, limit=TOP_K, output_fields=['filepath'])\nfinish = time.time()\n","# Show the image results\nf, axarr = plt.subplots(len(data_batch[1]), TOP_K + 1, figsize=(20, 10), squeeze=False)\n\nfor hits_i, hits in enumerate(res):\n axarr[hits_i][0].imshow(Image.open(data_batch[1][hits_i]))\n axarr[hits_i][0].set_axis_off()\n axarr[hits_i][0].set_title('Search Time: ' + str(finish - start))\n for hit_i, hit in enumerate(hits):\n axarr[hits_i][hit_i + 1].imshow(Image.open(hit.entity.get('filepath')))\n axarr[hits_i][hit_i + 1].set_axis_off()\n axarr[hits_i][hit_i + 1].set_title('Distance: ' + str(hit.distance))\n\n# Save the search result in a separate image file alongside your script.\nplt.savefig('search_result.png')\n"],"headingContent":"Image Search with PyTorch and Milvus","anchorList":[{"label":"Bildsuche mit PyTorch und Milvus","href":"Image-Search-with-PyTorch-and-Milvus","type":1,"isActive":false},{"label":"Installieren der Voraussetzungen","href":"Installing-the-requirements","type":2,"isActive":false},{"label":"Erfassen der Daten","href":"Grabbing-the-data","type":2,"isActive":false},{"label":"Globale Argumente","href":"Global-Arguments","type":2,"isActive":false},{"label":"Einrichten von Milvus","href":"Setting-up-Milvus","type":2,"isActive":false},{"label":"Einfügen der Daten","href":"Inserting-the-data","type":2,"isActive":false},{"label":"Durchführen der Suche","href":"Performing-the-search","type":2,"isActive":false}]}

localization/v2.5.x/site/de/integrations/integrate_with_pytorch.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
---
22
id: integrate_with_pytorch.md
3-
summary: Diese Seite behandelt die Bildsuche mit Milvus
4-
title: Bildsuche mit Milvus - Integration
3+
summary: >-
4+
Diese Seite demonstriert, wie man eine Bildsuche mit PyTorch und Milvus
5+
erstellt
6+
title: Bildsuche mit PyTorch und Milvus
57
---
6-
<h1 id="Image-Search-with-Milvus" class="common-anchor-header">Bildsuche mit Milvus<button data-href="#Image-Search-with-Milvus" class="anchor-icon" translate="no">
8+
<h1 id="Image-Search-with-PyTorch-and-Milvus" class="common-anchor-header">Bildsuche mit PyTorch und Milvus<button data-href="#Image-Search-with-PyTorch-and-Milvus" class="anchor-icon" translate="no">
79
<svg translate="no"
810
aria-hidden="true"
911
focusable="false"
@@ -18,8 +20,8 @@ title: Bildsuche mit Milvus - Integration
1820
d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"
1921
></path>
2022
</svg>
21-
</button></h1><p>Auf dieser Seite werden wir ein einfaches Beispiel für eine Bildsuche mit Milvus durchgehen. Der Datensatz, den wir durchsuchen, ist der Impressionist-Classifier-Datensatz, der auf <a href="https://www.kaggle.com/datasets/delayedkarma/impressionist-classifier-data">Kaggle</a> zu finden ist. Für dieses Beispiel haben wir die Daten in einem öffentlichen Google Drive gehostet.</p>
22-
<p>Für dieses Beispiel verwenden wir nur das von Torchvision trainierte Resnet50-Modell für Einbettungen. Los geht's!</p>
23+
</button></h1><p>In dieser Anleitung wird ein Beispiel für die Integration von PyTorch und Milvus vorgestellt, um eine Bildsuche mit Einbettungen durchzuführen. PyTorch ist ein leistungsfähiges Open-Source-Framework für Deep Learning, das häufig für die Erstellung und den Einsatz von Machine-Learning-Modellen verwendet wird. In diesem Beispiel nutzen wir die Torchvision-Bibliothek und ein vorab trainiertes ResNet50-Modell, um Merkmalsvektoren (Einbettungen) zu erzeugen, die Bildinhalte darstellen. Diese Einbettungen werden in Milvus, einer leistungsstarken Vektordatenbank, gespeichert, um eine effiziente Ähnlichkeitssuche zu ermöglichen. Der verwendete Datensatz ist der Impressionist-Classifier Dataset von <a href="https://www.kaggle.com/datasets/delayedkarma/impressionist-classifier-data">Kaggle</a>. Durch die Kombination der Deep-Learning-Fähigkeiten von PyTorch mit den skalierbaren Suchfunktionen von Milvus zeigt dieses Beispiel, wie man ein robustes und effizientes Bildabfragesystem aufbauen kann.</p>
24+
<p>Los geht's!</p>
2325
<h2 id="Installing-the-requirements" class="common-anchor-header">Installieren der Voraussetzungen<button data-href="#Installing-the-requirements" class="anchor-icon" translate="no">
2426
<svg translate="no"
2527
aria-hidden="true"

0 commit comments

Comments
 (0)