Skip to content

Commit 508317e

Browse files
author
Maxime Voisin
committed
forced images resize to 224x224
1 parent 24cf09a commit 508317e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/integrations/huggingface/huggingface.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
"metadata": {},
1717
"source": [
1818
"<td>\n",
19-
"<a href=\"https://colab.research.google.com/github/Labelbox/labelbox-python/blob/master/examples/integrations/huggingface/huggingface.ipynb\" target=\"_blank\"><img\n",
19+
"<a href=\"https://colab.research.google.com/github/Labelbox/labelbox-python/blob/master/examples/basics/huggingface.ipynb\" target=\"_blank\"><img\n",
2020
"src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"></a>\n",
2121
"</td>\n",
2222
"\n",
2323
"<td>\n",
24-
"<a href=\"https://github.com/Labelbox/labelbox-python/tree/master/examples/integrations/huggingface/huggingface.ipynb\" target=\"_blank\"><img\n",
24+
"<a href=\"https://github.com/Labelbox/labelbox-python/tree/master/examples/basics/huggingface.ipynb\" target=\"_blank\"><img\n",
2525
"src=\"https://img.shields.io/badge/GitHub-100000?logo=github&logoColor=white\" alt=\"GitHub\"></a>\n",
2626
"</td>"
2727
],
@@ -50,8 +50,8 @@
5050
"cell_type": "code",
5151
"outputs": [
5252
{
53-
"output_type": "stream",
5453
"name": "stdout",
54+
"output_type": "stream",
5555
"text": [
5656
"\u001b[?25l \u001b[90m\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u001b[0m \u001b[32m0.0/190.5 KB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r\u001b[2K \u001b[90m\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u001b[0m \u001b[32m190.5/190.5 KB\u001b[0m \u001b[31m7.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
5757
"\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
@@ -269,7 +269,7 @@
269269
" data_row_urls_chunk = data_row_urls[i:i+batch_size]\n",
270270
" data_row_ids_chunk = data_row_ids[i:i+batch_size]\n",
271271
" # download images\n",
272-
" imgs = [PIL.Image.open(requests.get(data_row_url, stream=True).raw).convert('RGB') for data_row_url in data_row_urls_chunk]\n",
272+
" imgs = [PIL.Image.open(requests.get(data_row_url, stream=True).raw).convert('RGB').resize((224, 224)) for data_row_url in data_row_urls_chunk]\n",
273273
" # process images\n",
274274
" img_hf = image_processor(imgs, return_tensors=\"pt\")\n",
275275
" # generate resnet embeddings, thanks to inference\n",
@@ -711,4 +711,4 @@
711711
"execution_count": null
712712
}
713713
]
714-
}
714+
}

0 commit comments

Comments
 (0)