Skip to content

Commit

Permalink
Make multimodal image search template
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik4949 committed Oct 21, 2024
1 parent 7c2df37 commit 8175d34
Show file tree
Hide file tree
Showing 2 changed files with 169 additions and 73 deletions.
46 changes: 32 additions & 14 deletions templates/multimodal_image_search/build.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"source": [
"from superduper import superduper\n",
"\n",
"db = superduper('mongomock:///test_db')"
"db = superduper('mongomock:///test_db')\n"
]
},
{
Expand All @@ -51,7 +51,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "0828031a",
"metadata": {},
"outputs": [],
Expand All @@ -66,12 +66,12 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"id": "44a702b1-faf9-4edb-8a55-efc4add84a83",
"metadata": {},
"outputs": [],
"source": [
"data = [{'img': d} for d in data[:100]]"
"data = [{'img': d} for d in data[:10]]"
]
},
{
Expand All @@ -92,7 +92,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"id": "5375ff04-8b6d-40b0-a8b2-6aa124636871",
"metadata": {},
"outputs": [],
Expand All @@ -104,7 +104,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"id": "489a19c2-c673-4bf9-9bea-f4bb279fc462",
"metadata": {},
"outputs": [],
Expand All @@ -124,7 +124,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"id": "8751ede0-4b9f-4f92-b4ec-f6b0e0740c30",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -168,7 +168,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"id": "12e75fab-8504-4d17-a7d9-f98667a5d6aa",
"metadata": {},
"outputs": [],
Expand All @@ -187,7 +187,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"id": "66ee3ff4-880e-477b-bbdf-5b8d89c56de2",
"metadata": {},
"outputs": [],
Expand All @@ -197,7 +197,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"id": "4cede653",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -277,7 +277,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 12,
"id": "ce565823-4655-488c-8684-2240107fa30d",
"metadata": {},
"outputs": [],
Expand All @@ -288,16 +288,26 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 15,
"id": "d8059626-dff8-4fe0-b872-97b8eb8b1b01",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"{'img': <PIL.PngImagePlugin.PngImageFile image mode=RGB size=500x338>}"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# <tab: Image>\n",
"from IPython.display import display\n",
"search_image = data[0]\n",
"display(search_image)\n",
"item = Document({indexing_key: search_image})"
"item = Document(search_image)"
]
},
{
Expand Down Expand Up @@ -364,6 +374,14 @@
"\n",
"template.export('.')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "759db69c-c3e6-47e5-af6d-e089c1e8ad4e",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Loading

0 comments on commit 8175d34

Please sign in to comment.