Upload fusion_t2i_CLIP_interrogator.ipynb
Browse files
Google Colab Jupyter Notebooks/fusion_t2i_CLIP_interrogator.ipynb
CHANGED
@@ -165,15 +165,6 @@
|
|
165 |
"execution_count": null,
|
166 |
"outputs": []
|
167 |
},
|
168 |
-
{
|
169 |
-
"cell_type": "markdown",
|
170 |
-
"source": [
|
171 |
-
"The visualization has no effect on the output. It will only be used if you enable the 'Show encoding' checkbox"
|
172 |
-
],
|
173 |
-
"metadata": {
|
174 |
-
"id": "OpOoRmaP3u2H"
|
175 |
-
}
|
176 |
-
},
|
177 |
{
|
178 |
"cell_type": "markdown",
|
179 |
"source": [
|
@@ -219,7 +210,7 @@
|
|
219 |
" save_file(_ref, 'reference.safetensors')\n",
|
220 |
"#-----#\n",
|
221 |
"\n",
|
222 |
-
"if NEW_ENCODING.strip() != ''
|
223 |
" item = NEW_ENCODING.strip()\n",
|
224 |
" inputs = tokenizer(text = item.strip(), truncation = True , padding=True, return_tensors=\"pt\")\n",
|
225 |
" ref = model.get_text_features(**inputs)[0]\n",
|
@@ -301,7 +292,7 @@
|
|
301 |
{
|
302 |
"cell_type": "markdown",
|
303 |
"source": [
|
304 |
-
"
|
305 |
],
|
306 |
"metadata": {
|
307 |
"id": "f9_AcquM7AYZ"
|
@@ -549,6 +540,8 @@
|
|
549 |
{
|
550 |
"cell_type": "markdown",
|
551 |
"source": [
|
|
|
|
|
552 |
"**Save the reference prior to running the Interrogator**"
|
553 |
],
|
554 |
"metadata": {
|
@@ -818,6 +811,15 @@
|
|
818 |
"execution_count": null,
|
819 |
"outputs": []
|
820 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
821 |
{
|
822 |
"cell_type": "markdown",
|
823 |
"source": [
|
|
|
165 |
"execution_count": null,
|
166 |
"outputs": []
|
167 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
{
|
169 |
"cell_type": "markdown",
|
170 |
"source": [
|
|
|
210 |
" save_file(_ref, 'reference.safetensors')\n",
|
211 |
"#-----#\n",
|
212 |
"\n",
|
213 |
+
"if NEW_ENCODING.strip() != '':\n",
|
214 |
" item = NEW_ENCODING.strip()\n",
|
215 |
" inputs = tokenizer(text = item.strip(), truncation = True , padding=True, return_tensors=\"pt\")\n",
|
216 |
" ref = model.get_text_features(**inputs)[0]\n",
|
|
|
292 |
{
|
293 |
"cell_type": "markdown",
|
294 |
"source": [
|
295 |
+
"# 🖼️ Image encoders (optional)"
|
296 |
],
|
297 |
"metadata": {
|
298 |
"id": "f9_AcquM7AYZ"
|
|
|
540 |
{
|
541 |
"cell_type": "markdown",
|
542 |
"source": [
|
543 |
+
"# CLIP Interrogator\n",
|
544 |
+
"\n",
|
545 |
"**Save the reference prior to running the Interrogator**"
|
546 |
],
|
547 |
"metadata": {
|
|
|
811 |
"execution_count": null,
|
812 |
"outputs": []
|
813 |
},
|
814 |
+
{
|
815 |
+
"cell_type": "markdown",
|
816 |
+
"source": [
|
817 |
+
"# 🔍 Evaluate similarities"
|
818 |
+
],
|
819 |
+
"metadata": {
|
820 |
+
"id": "RbFayOGtCdUN"
|
821 |
+
}
|
822 |
+
},
|
823 |
{
|
824 |
"cell_type": "markdown",
|
825 |
"source": [
|