deep-learning/practical-deep-learning-for-coders/lesson-1/bird_or_forest.ipynb

1490 lines
1.2 MiB
Plaintext
Raw Normal View History

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Bird or Forest?"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\Users\\micro\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\tqdm\\auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
}
],
"source": [
"from fastai.data.all import *\n",
"from fastai.vision.all import *\n",
"from fastcore.all import *"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Image Search"
]
},
{
"cell_type": "code",
"execution_count": 130,
"metadata": {},
"outputs": [],
"source": [
"from duckduckgo_search import DDGS\n",
"\n",
"def search_images(search_term, max_images = 10):\n",
" return L(DDGS().images(search_term, max_results = max_images)).itemgot('image')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Image Search Response"
]
},
{
"cell_type": "code",
"execution_count": 131,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'title': 'Green Bird · Free Stock Photo',\n",
" 'image': 'https://images.pexels.com/photos/1661179/pexels-photo-1661179.jpeg?cs=srgb&dl=green-bird-1661179.jpg&fm=jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.Ct8gRWSHnCcLr7ozTKmePAHaIp&pid=Api',\n",
" 'url': 'https://www.pexels.com/photo/green-bird-1661179/',\n",
" 'height': 2625,\n",
" 'width': 2250,\n",
" 'source': 'Bing'},\n",
" {'title': '507 Colorful Bird Pictures · Pexels · Free Stock Photos',\n",
" 'image': 'https://images.pexels.com/photos/326900/pexels-photo-326900.jpeg?cs=srgb&dl=wood-flight-bird-326900.jpg&fm=jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.3hTkhdPZ8PRL3R6saGGNAgHaE7&pid=Api',\n",
" 'url': 'https://www.pexels.com/search/bird/',\n",
" 'height': 1333,\n",
" 'width': 2000,\n",
" 'source': 'Bing'},\n",
" {'title': 'Birds Images · Pexels · Free Stock Photos',\n",
" 'image': 'https://images.pexels.com/photos/97533/pexels-photo-97533.jpeg?cs=srgb&dl=animal-avian-bird-97533.jpg&fm=jpg',\n",
" 'thumbnail': 'https://tse2.mm.bing.net/th?id=OIP.e7i7kpiI3SU50FROr4X0gQHaFj&pid=Api',\n",
" 'url': 'https://www.pexels.com/search/birds/',\n",
" 'height': 2000,\n",
" 'width': 2670,\n",
" 'source': 'Bing'},\n",
" {'title': 'Beautiful Birds Wallpapers - Top Free Beautiful Birds Backgrounds - WallpaperAccess',\n",
" 'image': 'https://wallpaperaccess.com/full/775987.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.oDbsLhdB_-PAnAjNlOFuVAHaEo&pid=Api',\n",
" 'url': 'https://wallpaperaccess.com/beautiful-birds',\n",
" 'height': 1800,\n",
" 'width': 2880,\n",
" 'source': 'Bing'},\n",
" {'title': '30 Cute Bird Pictures with Most Beautiful Colors',\n",
" 'image': 'https://images.alphacoders.com/492/492674.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.sleWxJRjQLAghcYqhDlEcQHaEo&pid=Api',\n",
" 'url': 'https://www.entertainmentmesh.com/30-cute-bird-pictures-with-most-beautiful-colors/',\n",
" 'height': 1493,\n",
" 'width': 2389,\n",
" 'source': 'Bing'},\n",
" {'title': 'Top 10 Most Beautiful Birds In The World',\n",
" 'image': 'https://i2.wp.com/earthnworld.com/wp-content/uploads/2015/11/Blue-Jay.jpg?ssl=1',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.eRAcekSLvo8DBMzKOL4apQHaIL&pid=Api',\n",
" 'url': 'https://earthnworld.com/beautiful-birds/',\n",
" 'height': 1280,\n",
" 'width': 1160,\n",
" 'source': 'Bing'},\n",
" {'title': 'File:Eastern Bluebird-27527-2.jpg - Wikipedia',\n",
" 'image': 'http://upload.wikimedia.org/wikipedia/commons/9/9b/Eastern_Bluebird-27527-2.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.4tjKhc1RdP-fIvFoXVJSNgHaHa&pid=Api',\n",
" 'url': 'http://en.wikipedia.org/wiki/File:Eastern_Bluebird-27527-2.jpg',\n",
" 'height': 1024,\n",
" 'width': 1024,\n",
" 'source': 'Bing'},\n",
" {'title': 'Bird Wallpapers: Free HD Download [500+ HQ] | Unsplash',\n",
" 'image': 'https://images.unsplash.com/photo-1552728089-57bdde30beb3?ixlib=rb-1.2.1&w=1000&q=80',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.t17ti8Buq2RB2RT7JIhMqgHaKH&pid=Api',\n",
" 'url': 'https://unsplash.com/wallpapers/animals/bird',\n",
" 'height': 1365,\n",
" 'width': 1000,\n",
" 'source': 'Bing'},\n",
" {'title': 'Colorful Parrot Bird, HD Birds, 4k Wallpapers, Images, Backgrounds, Photos and Pictures',\n",
" 'image': 'https://hdqwalls.com/wallpapers/colorful-parrot-bird.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.qLc7CKA1SnBvANPyTe5zeAHaEK&pid=Api',\n",
" 'url': 'https://hdqwalls.com/colorful-parrot-bird-wallpaper',\n",
" 'height': 2160,\n",
" 'width': 3840,\n",
" 'source': 'Bing'},\n",
" {'title': 'File:Eastern Bluebird-27527-7.jpg',\n",
" 'image': 'http://upload.wikimedia.org/wikipedia/commons/5/54/Eastern_Bluebird-27527-7.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.2SeDOWlYBhcXVcv82L2RZAHaHa&pid=Api',\n",
" 'url': 'http://commons.wikimedia.org/wiki/File:Eastern_Bluebird-27527-7.jpg',\n",
" 'height': 1600,\n",
" 'width': 1600,\n",
" 'source': 'Bing'},\n",
" {'title': 'How to Photograph Birds in Flight with Sharp Results',\n",
" 'image': 'https://photographylife.com/wp-content/uploads/2022/01/LVP0594-NEF_DxO_DeepPRIME-1.jpg',\n",
" 'thumbnail': 'https://tse2.mm.bing.net/th?id=OIP.cJ_e6ogQkgCDauziHtPoZQHaE7&pid=Api',\n",
" 'url': 'https://photographylife.com/how-to-photograph-birds-in-flight',\n",
" 'height': 1365,\n",
" 'width': 2048,\n",
" 'source': 'Bing'},\n",
" {'title': 'Mountain bluebird today in central Colorado. First time seeing one! : r/wildlifephotography',\n",
" 'image': 'https://i.redd.it/n1e0kjh3nwu21.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.n7C7as_7kjc9IChg_LpYeAHaF7&pid=Api',\n",
" 'url': 'https://www.reddit.com/r/wildlifephotography/comments/bi5wgs/mountain_bluebird_today_in_central_colorado_first/',\n",
" 'height': 2266,\n",
" 'width': 2832,\n",
" 'source': 'Bing'},\n",
" {'title': 'Flying Birds Wallpapers - Wallpaper Cave',\n",
" 'image': 'https://wallpapercave.com/wp/wp2284850.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.XwxD2LMEqvBOBAgfP8LKWgHaEo&pid=Api',\n",
" 'url': 'https://wallpapercave.com/flying-birds-wallpapers',\n",
" 'height': 2400,\n",
" 'width': 3840,\n",
" 'source': 'Bing'},\n",
" {'title': 'Cardinal Bird Wallpapers - Wallpaper Cave',\n",
" 'image': 'https://wallpapercave.com/wp/KIxyCPO.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.uoBzdicnt8enzWqO0E-5jQHaIX&pid=Api',\n",
" 'url': 'https://wallpapercave.com/cardinal-bird-wallpaper',\n",
" 'height': 1600,\n",
" 'width': 1415,\n",
" 'source': 'Bing'},\n",
" {'title': 'Birds Wallpapers | Best Wallpapers',\n",
" 'image': 'http://s1.picswalls.com/wallpapers/2014/07/18/birds-high-definition_104547222_54.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.0Qdy_rg1jGE6u1mU7ZekBwHaEo&pid=Api',\n",
" 'url': 'http://www.picswalls.com/pic/birds-wallpapers/',\n",
" 'height': 1600,\n",
" 'width': 2560,\n",
" 'source': 'Bing'},\n",
" {'title': 'Free photo: Beautiful Bird - Animal, Beauty, Bird - Free Download - Jooinn',\n",
" 'image': 'https://jooinn.com/images/beautiful-bird-3.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.RqChr4qJxDwVLrd4iNflygHaFj&pid=Api',\n",
" 'url': 'https://jooinn.com/beautiful-bird.html',\n",
" 'height': 1425,\n",
" 'width': 1900,\n",
" 'source': 'Bing'},\n",
" {'title': 'Bird Free Stock Photo - Public Domain Pictures',\n",
" 'image': 'https://www.publicdomainpictures.net/pictures/60000/velka/bird-1382262607iEg.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.OxmEX9TRkB_toRfDZUuXUAHaE5&pid=Api',\n",
" 'url': 'https://www.publicdomainpictures.net/view-image.php?image=58656&picture=bird',\n",
" 'height': 1271,\n",
" 'width': 1920,\n",
" 'source': 'Bing'},\n",
" {'title': 'Most Beautiful Birds On The Planet - PRETEND Magazine',\n",
" 'image': 'https://pre-tend.com/wp-content/uploads/2015/02/gouldian-finch.jpg',\n",
" 'thumbnail': 'https://tse2.mm.bing.net/th?id=OIP.MRyBBwVyj4h8h2u8ttVfNgHaEo&pid=Api',\n",
" 'url': 'https://pre-tend.com/most-beautiful-birds-on-the-planet/',\n",
" 'height': 1050,\n",
" 'width': 1680,\n",
" 'source': 'Bing'},\n",
" {'title': 'Guide to North American Birds | Audubon',\n",
" 'image': 'https://nas-national-prod.s3.amazonaws.com/styles/hero_image/s3/h_a1_7443_5_painted-bunting_julie_torkomian_adult-male.jpg?itok=pjRwtocb',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.RWNep0nZqmLVXBRPHuGtowHaE2&pid=Api',\n",
" 'url': 'https://www.audubon.org/bird-guide',\n",
" 'height': 1572,\n",
" 'width': 2400,\n",
" 'source': 'Bing'},\n",
" {'title': 'toucan, Parrot, Bird, Tropical, 66 Wallpapers HD / Desktop and Mobile Backgrounds',\n",
" 'image': 'https://wallup.net/wp-content/uploads/2019/09/363515-toucan-parrot-bird-tropical-66.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.3qDlwMBkM-wHf2xA7xvHnQHaEo&pid=Api',\n",
" 'url': 'https://wallup.net/toucan-parrot-bird-tropical-66/',\n",
" 'height': 1200,\n",
" 'width': 1920,\n",
" 'source': 'Bing'},\n",
" {'title': 'Beautiful Birds | Chilternchatter.com',\n",
" 'image': 'https://chilternchatter.com/wp-content/uploads/2018/01/RED-Bird.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.g24V6bI5c2hvi1pTmdIqUwHaE7&pid=Api',\n",
" 'url': 'https://chilternchatter.com/events/beautiful-birds/',\n",
" 'height': 2029,\n",
" 'width': 3044,\n",
" 'source': 'Bing'},\n",
" {'title': 'Bluebird Wallpapers - Wallpaper Cave',\n",
" 'image': 'https://wallpapercave.com/wp/ZzyoOHd.jpg',\n",
" 'thumbnail': 'https://tse2.mm.bing.net/th?id=OIP.UCY5_cmXOyAALQJNC9indwHaGW&pid=Api',\n",
" 'url': 'https://wallpapercave.com/bluebird-wallpaper',\n",
" 'height': 1924,\n",
" 'width': 2244,\n",
" 'source': 'Bing'},\n",
" {'title': 'The Most Colorful Birds From Around The World - WorldAtlas',\n",
" 'image': 'https://www.worldatlas.com/r/w1200/upload/58/1b/eb/shutterstock-760749433.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.ATruKn_Wh68h3d1_psh_WAHaE8&pid=Api',\n",
" 'url': 'https://www.worldatlas.com/articles/the-most-colorful-birds-of-the-world-where-to-see-them.html',\n",
" 'height': 770,\n",
" 'width': 1155,\n",
" 'source': 'Bing'},\n",
" {'title': 'Bluebirds Computer Wallpapers - Wallpaper Cave',\n",
" 'image': 'https://wallpapercave.com/wp/wp5919973.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP._LatA8BI-aoyLKlj0FbDHgHaE8&pid=Api',\n",
" 'url': 'https://wallpapercave.com/bluebirds-computer-wallpapers',\n",
" 'height': 1067,\n",
" 'width': 1600,\n",
" 'source': 'Bing'},\n",
" {'title': 'Description - Watching Birds',\n",
" 'image': 'http://www.advdelphisys.com/photos/FloraNFauna/Cardinal-Northern-male/Northern-Cardinal-male-16.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.-RiiJs9_6Rpw4UBM9WgSmAHaHd&pid=Api',\n",
" 'url': 'https://sites.google.com/a/hdsb.ca/watching-birds/description-1',\n",
" 'height': 2167,\n",
" 'width': 2150,\n",
" 'source': 'Bing'},\n",
" {'title': 'Photography: Birds Photography',\n",
" 'image': 'http://www.yourpictureframes.com/blog/wp-content/uploads/2010/02/Blue-Bird.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.E0buh_ZVcK_xz5rm6XEwQgHaHa&pid=Api',\n",
" 'url': 'https://its4photography.blogspot.com/2011/06/birds-photography.html',\n",
" 'height': 900,\n",
" 'width': 900,\n",
" 'source': 'Bing'},\n",
" {'title': '10 Most Beautiful Finch Birds In The World - YouTube',\n",
" 'image': 'https://i.ytimg.com/vi/C_GXFp4C8yE/maxresdefault.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.y7wvku2y41u-Y0-oLHyA4gHaEK&pid=Api',\n",
" 'url': 'https://www.youtube.com/watch?v=C_GXFp4C8yE',\n",
" 'height': 720,\n",
" 'width': 1280,\n",
" 'source': 'Bing'},\n",
" {'title': 'Colourful Bird - Birds Photo (40741713) - Fanpop',\n",
" 'image': 'http://images6.fanpop.com/image/photos/40700000/Colourful-Bird-birds-40741713-1280-960.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.T1-Es7NCjddWDvXSs9VqgwHaFj&pid=Api',\n",
" 'url': 'https://www.fanpop.com/clubs/birds/images/40741713/title/colourful-bird-photo',\n",
" 'height': 960,\n",
" 'width': 1280,\n",
" 'source': 'Bing'},\n",
" {'title': 'Snapshots of Beauty: BIRDS, BIRDS, BIRDS...',\n",
" 'image': 'https://1.bp.blogspot.com/-1frXav8yFwI/XsC-1jM_bCI/AAAAAAAACzk/ORwrVPD8SUIwMIP7-ql4shxQtU1JDrsYgCPcBGAYYCw/s1600/az+kf+17.5.20.JPG',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.uIRU0t3e647pNagdMa6OpQHaGf&pid=Api',\n",
" 'url': 'https://snapshotsofbeauty.blogspot.com/2020/05/birds-birds-birds.html',\n",
" 'height': 1401,\n",
" 'width': 1600,\n",
" 'source': 'Bing'},\n",
" {'title': \"Bird Sounds and Songs of the Eastern Bluebird | The Old Farmer's Almanac\",\n",
" 'image': 'https://www.almanac.com/sites/default/files/image_nodes/bluebird-3456115_1920.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.2kOlMfxwbbX86W085hTmkwHaGT&pid=Api',\n",
" 'url': 'https://www.almanac.com/content/bird-sounds-eastern-bluebird',\n",
" 'height': 1633,\n",
" 'width': 1920,\n",
" 'source': 'Bing'},\n",
" {'title': 'The Cardinal | Bird USA | Beauty Of Bird',\n",
" 'image': 'https://3.bp.blogspot.com/-mJ-Kw1mdLOo/UeLJx7vxsaI/AAAAAAAADkg/TfDHtuJnY7I/s1600/The-Cardinal-Bird.jpg',\n",
" 'thumbnail': 'https://tse2.mm.bing.net/th?id=OIP.PT8fmP1UF8W0_PVpxo6dIwHaFj&pid=Api',\n",
" 'url': 'https://birds-infoa2z.blogspot.com/2013/07/Cardinal-Bird-Interesting-Facts.html',\n",
" 'height': 1200,\n",
" 'width': 1600,\n",
" 'source': 'Bing'},\n",
" {'title': '🔥 [49+] Free Bird Wallpaper Screensavers | WallpaperSafari',\n",
" 'image': 'https://cdn.wallpapersafari.com/64/10/VpymqY.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.yP7tKJk8lDukjePRnfGnKQHaFj&pid=Api',\n",
" 'url': 'https://wallpapersafari.com/free-bird-wallpaper-screensavers/',\n",
" 'height': 1200,\n",
" 'width': 1600,\n",
" 'source': 'Bing'},\n",
" {'title': 'Bird Bird wallpaper',\n",
" 'image': 'https://jooinn.com/images/bluebird-1.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.GrnT4nwuPI1KXEyHxkK2QQHaE6&pid=Api',\n",
" 'url': 'https://kamesav.blogspot.com/2022/10/bird-bird-wallpaper.html',\n",
" 'height': 1273,\n",
" 'width': 1920,\n",
" 'source': 'Bing'},\n",
" {'title': 'Animals World: February 2013',\n",
" 'image': 'https://2.bp.blogspot.com/-g9STQqFQ9Ik/UScse2IifqI/AAAAAAAAA08/mh1immEtVZo/s1600/bluebird.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.f195H2w-vlsFs4Y9coeYQgHaGj&pid=Api',\n",
" 'url': 'https://entertainmentstar.blogspot.com/2013_02_01_archive.html',\n",
" 'height': 1415,\n",
" 'width': 1600,\n",
" 'source': 'Bing'},\n",
" {'title': \"Birds In Illinois: The 35 Most Popular Species You'll Recognize\",\n",
" 'image': 'https://www.wildbirdscoop.com/wp-content/uploads/2021/06/Eastern-Bluebird-2.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.-QAg1zYXZMH0sz0dq3z6RwHaE8&pid=Api',\n",
" 'url': 'https://www.wildbirdscoop.com/illinois-birds.html',\n",
" 'height': 1024,\n",
" 'width': 1536,\n",
" 'source': 'Bing'},\n",
" {'title': 'Attract Bluebirds to Your Yard | A Birds Delight',\n",
" 'image': 'https://abirdsdelight.com/wp-content/uploads/2018/03/bird-2179663_1920.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.d_ZBqHEJXsWuZXtfvFc26AHaJQ&pid=Api',\n",
" 'url': 'https://abirdsdelight.com/attract-bluebirds-to-your-yard',\n",
" 'height': 1920,\n",
" 'width': 1536,\n",
" 'source': 'Bing'},\n",
" {'title': 'Nature Info: most beautiful birds ..........',\n",
" 'image': 'https://4.bp.blogspot.com/-KgT70H1qEgE/V1MQgrj4UvI/AAAAAAAAAOA/bBQbZxcq9aIlvzdvBi-Hu5vr9zClWABUACLcB/s1600/birds-1.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.S6LYhJVfx-f_duBCTN2hbwHaFj&pid=Api',\n",
" 'url': 'https://natureinplace.blogspot.com/2016/06/most-beautiful-birds.html',\n",
" 'height': 1200,\n",
" 'width': 1600,\n",
" 'source': 'Bing'},\n",
" {'title': 'warbler, Bird, Birds, Nature, Wildlife',\n",
" 'image': 'https://wallup.net/wp-content/uploads/2018/10/07/766927-warbler-bird-birds-nature-wildlife.jpg',\n",
" 'thumbnail': 'https://tse2.mm.bing.net/th?id=OIP.x1_DCKyS4LGlDA-kQJ0QEAHaFj&pid=Api',\n",
" 'url': 'https://wallup.net/warbler-bird-birds-nature-wildlife-29/',\n",
" 'height': 1200,\n",
" 'width': 1600,\n",
" 'source': 'Bing'},\n",
" {'title': 'Handsome Gouldian | Finches bird, Pet birds, Nature birds',\n",
" 'image': 'http://www.voidphase.com/media/2010/12/bird_gouldian_finch_1920.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP._oUvGnT7EaoC5XHrS7VbkwHaEK&pid=Api',\n",
" 'url': 'https://www.pinterest.com/pin/542402348846114338/',\n",
" 'height': 1080,\n",
" 'width': 1920,\n",
" 'source': 'Bing'},\n",
" {'title': 'The new birds to Costa Rica: Where to find them? - Birdwatching in Costa Rica',\n",
" 'image': 'http://www.birdwatchingincostarica.com/wp-content/uploads/2015/10/Blue-Crowned-Motmot-copia.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.y7htfWyfkeMCkIceOHupeAHaH5&pid=Api',\n",
" 'url': 'https://www.birdwatchingincostarica.com/index.php/2016/08/10/the-new-birds-to-costa-rica-where-to-bird-for-them/',\n",
" 'height': 2850,\n",
" 'width': 2675,\n",
" 'source': 'Bing'},\n",
" {'title': 'Bird Wallpapers HD Wide - Wallpaper Cave',\n",
" 'image': 'https://wallpapercave.com/wp/wp3356599.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.bovYZTR-YSGXOaqojCuulQHaEK&pid=Api',\n",
" 'url': 'https://wallpapercave.com/bird-wallpaper-hd-wide',\n",
" 'height': 1080,\n",
" 'width': 1920,\n",
" 'source': 'Bing'},\n",
" {'title': 'American Goldfinch | Celebrate Urban Birds',\n",
" 'image': 'https://www.allaboutbirds.org/guide/assets/photo/124706471-1900px.jpg',\n",
" 'thumbnail': 'https://tse2.mm.bing.net/th?id=OIP.VN-ULyX_0XCdvjSvzxh9twHaFj&pid=Api',\n",
" 'url': 'http://celebrateurbanbirds.org/learn/birds/focal-species/american-goldfinch/',\n",
" 'height': 1424,\n",
" 'width': 1900,\n",
" 'source': 'Bing'},\n",
" {'title': 'How Many Birds Are In The World? - A-Z Animals',\n",
" 'image': 'https://a-z-animals.com/media/2022/06/Lovebirds-on-fence.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.ymYbJOeWF2bZEGOsziDjoAHaEc&pid=Api',\n",
" 'url': 'https://a-z-animals.com/blog/how-many-birds-are-in-the-world/',\n",
" 'height': 1200,\n",
" 'width': 2000,\n",
" 'source': 'Bing'},\n",
" {'title': 'Wild Birds Photos Hd - unique rare bird',\n",
" 'image': 'https://i.pinimg.com/originals/b8/02/fe/b802fe211686551dbbcd50e9fd0616f7.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.Vsn5zEGXZUw0W4ueiHO36AHaFj&pid=Api',\n",
" 'url': 'https://uniquerarebirds.blogspot.com/2021/01/wild-birds-photos-hd.html',\n",
" 'height': 1080,\n",
" 'width': 1440,\n",
" 'source': 'Bing'},\n",
" {'title': 'The 51 Best Spring Bird Pictures Ever - Birds and Blooms',\n",
" 'image': 'https://www.birdsandblooms.com/wp-content/uploads/2021/02/11_ScottDiedrich_BBfm20.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.CIef09hxeyp1JuFQdwmxVwHaHY&pid=Api',\n",
" 'url': 'https://www.birdsandblooms.com/birding/bird-photography/best-spring-bird-photos-ever/',\n",
" 'height': 1197,\n",
" 'width': 1200,\n",
" 'source': 'Bing'},\n",
" {'title': 'eclectus, Parrot, Bird, Tropical, 1 Wallpapers HD / Desktop and Mobile Backgrounds',\n",
" 'image': 'https://wallup.net/wp-content/uploads/2019/09/363332-eclectus-parrot-bird-tropical-1.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.7MZ9bd3UwzQuGYEaecxVVQHaEo&pid=Api',\n",
" 'url': 'https://wallup.net/eclectus-parrot-bird-tropical-1-2/',\n",
" 'height': 1200,\n",
" 'width': 1920,\n",
" 'source': 'Bing'},\n",
" {'title': 'File:Mockingbird, Northern SunsetBeach.jpg - Wikimedia Commons',\n",
" 'image': 'https://upload.wikimedia.org/wikipedia/commons/6/67/Mockingbird,_Northern_SunsetBeach.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.BUS5Tp58f4TJ_UVDtI4wQwHaFj&pid=Api',\n",
" 'url': 'http://commons.wikimedia.org/wiki/File:Mockingbird,_Northern_SunsetBeach.jpg',\n",
" 'height': 3032,\n",
" 'width': 4043,\n",
" 'source': 'Bing'},\n",
" {'title': 'Eastern Bluebird portrait - Pic for Today',\n",
" 'image': 'https://psnp.info/p4td_/wp-content/uploads/2020/05/dsc06413.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.aaAauFivvkWqnMWspjtUDwHaHk&pid=Api',\n",
" 'url': 'https://psnp.info/p4td_/?p=13306',\n",
" 'height': 2000,\n",
" 'width': 1957,\n",
" 'source': 'Bing'},\n",
" {'title': 'Finches of arizona 12 species with pictures - Artofit',\n",
" 'image': 'https://i.pinimg.com/originals/a5/c6/42/a5c64208796df8d2a75ea7ef032c2146.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.Eh5BAf7_5MbYwh7gUVP_8QHaIp&pid=Api',\n",
" 'url': 'https://www.artofit.org/image-gallery/720927852866924794/finches-of-arizona-12-species-with-pictures/',\n",
" 'height': 2048,\n",
" 'width': 1754,\n",
" 'source': 'Bing'},\n",
" {'title': 'Birds Images · Pexels · Free Stock Photos',\n",
" 'image': 'https://images.pexels.com/photos/110812/pexels-photo-110812.jpeg?cs=srgb&dl=birds-macro-branch-110812.jpg&fm=jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.-N2YO3sx5osj9BAuiDZ4fgHaE5&pid=Api',\n",
" 'url': 'https://www.pexels.com/search/birds/',\n",
" 'height': 2544,\n",
" 'width': 3849,\n",
" 'source': 'Bing'},\n",
" {'title': 'absolutely beautiful bird on a cherry blossom tree - Birds Photo (36097361) - Fanpop',\n",
" 'image': 'http://images6.fanpop.com/image/photos/36000000/Birds-image-birds-36097361-1600-1200.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.vC5WkgBqdY5Sbmw-9uzz2QHaFj&pid=Api',\n",
" 'url': 'https://www.fanpop.com/clubs/birds/images/36097361/title/absolutely-beautiful-bird-on-cherry-blossom-tree-photo',\n",
" 'height': 1200,\n",
" 'width': 1600,\n",
" 'source': 'Bing'},\n",
" {'title': '[43+] Branch Birds Wallpaper | WallpaperSafari.com',\n",
" 'image': 'https://cdn.wallpapersafari.com/21/87/zPkANO.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.dOBwRZygiksMYvOswO93nQHaEK&pid=Api',\n",
" 'url': 'https://wallpapersafari.com/branch-birds-wallpaper/',\n",
" 'height': 900,\n",
" 'width': 1600,\n",
" 'source': 'Bing'},\n",
" {'title': 'Blue Bird, Beautiful, Blue Bird, Desktop, Hd, Birds, #3312',\n",
" 'image': 'http://wallpaperping.com/wp-content/uploads/2018/12/63740061-1280px.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.FymedHSn8P07b-fWsixvpQHaFj&pid=Api',\n",
" 'url': 'http://wallpaperping.com/blue-bird.html',\n",
" 'height': 960,\n",
" 'width': 1280,\n",
" 'source': 'Bing'},\n",
" {'title': '12 pics common British birds you can find in your garden | Common british birds, Common birds, Birds',\n",
" 'image': 'https://i.pinimg.com/originals/c1/77/ee/c177eee70a7f47a7a02eabad6925de86.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.8_hmQXEQZkCaTV6ZAyYPjQHaFj&pid=Api',\n",
" 'url': 'https://www.pinterest.com/pin/619385754983605783/',\n",
" 'height': 1128,\n",
" 'width': 1504,\n",
" 'source': 'Bing'},\n",
" {'title': 'Canary Bird Wallpaper Hd - unique rare bird',\n",
" 'image': 'https://www.wallpaperflare.com/static/275/405/232/bird-nature-animal-branch-wallpaper.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.rXNA5W3YI4P04n3s2dzp1AHaEr&pid=Api',\n",
" 'url': 'https://uniquerarebirds.blogspot.com/2020/12/canary-bird-wallpaper-hd.html',\n",
" 'height': 2307,\n",
" 'width': 3656,\n",
" 'source': 'Bing'},\n",
" {'title': 'Hummingbird Wallpapers - Top Free Hummingbird Backgrounds - WallpaperAccess',\n",
" 'image': 'https://wallpaperaccess.com/full/353399.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.k1IWVprz50qonuvqUCPmqwHaFX&pid=Api',\n",
" 'url': 'https://wallpaperaccess.com/hummingbird',\n",
" 'height': 4350,\n",
" 'width': 6000,\n",
" 'source': 'Bing'},\n",
" {'title': 'Free Images : nature, wildlife, beak, fauna, lorikeet, birds, vertebrate, colours, finch ...',\n",
" 'image': 'https://get.pxhere.com/photo/nature-bird-wildlife-beak-fauna-lorikeet-birds-vertebrate-colours-finch-australianbirds-sonyalpha-gouldianfinch-finches-old-world-flycatcher-perching-bird-green-jay-341318.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.1RDhfGZe0iMkvmObHBXqtgHaE2&pid=Api',\n",
" 'url': 'https://pxhere.com/en/photo/341318',\n",
" 'height': 1572,\n",
" 'width': 2400,\n",
" 'source': 'Bing'},\n",
" {'title': 'a small bird perched on top of a tree branch',\n",
" 'image': 'https://i.pinimg.com/originals/72/7d/1c/727d1cdb33821f109591870217b5dfe0.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.IV8S-u8c7dfZPd60dP5WjQHaFf&pid=Api',\n",
" 'url': 'https://www.pinterest.com/pin/298293175309934250/',\n",
" 'height': 1902,\n",
" 'width': 2562,\n",
" 'source': 'Bing'},\n",
" {'title': '14+ Cute Birds Pics | angelinajoliecoolsagt',\n",
" 'image': 'https://i1.wp.com/entertainmentmesh.com/wp-content/uploads/2017/02/five-different-colored-birds.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.z67uJNjLnqHza82VyNxNLQHaEK&pid=Api',\n",
" 'url': 'https://angelinajoliecoolsagt.blogspot.com/2022/09/14-cute-birds-pics.html',\n",
" 'height': 768,\n",
" 'width': 1366,\n",
" 'source': 'Bing'},\n",
" {'title': 'birds, Parrot Wallpapers HD / Desktop and Mobile Backgrounds',\n",
" 'image': 'https://wallup.net/wp-content/uploads/2019/09/137093-birds-parrot.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.LJyFqYb5SowfkdFkdu099AHaEo&pid=Api',\n",
" 'url': 'https://wallup.net/birds-parrot-4/',\n",
" 'height': 1050,\n",
" 'width': 1680,\n",
" 'source': 'Bing'},\n",
" {'title': 'Top 10 Most Beautiful Birds in the World | Fabulous Life',\n",
" 'image': 'https://1.bp.blogspot.com/-HVQCgDX3tY8/VHQz32tGwCI/AAAAAAAACDQ/gDoTznnkYTU/s1600/top_10_most_beautiful_amazing_birds_in_the_world_Atlantic-Puffin.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.C7nCwkv0zYnbUoGDKo0zHgHaF2&pid=Api',\n",
" 'url': 'https://fabulouslifeforyou.blogspot.com/2014/11/top-10-most-beautiful-birds-in-world.html',\n",
" 'height': 1265,\n",
" 'width': 1600,\n",
" 'source': 'Bing'},\n",
" {'title': 'Free photo: Flying bird - Animal, Bird, Blue - Free Download - Jooinn',\n",
" 'image': 'https://jooinn.com/images/birds-flying-28.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.a73DR4E1zVrbv5HyJxVO3wHaFC&pid=Api',\n",
" 'url': 'https://jooinn.com/flying-bird.html',\n",
" 'height': 1201,\n",
" 'width': 1765,\n",
" 'source': 'Bing'},\n",
" {'title': 'Bird of the Week: Eastern Bluebird - Huron-Clinton Metroparks',\n",
" 'image': 'https://www.metroparks.com/wp-content/uploads/2020/04/Eastern-Bluebirds.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.zqX5bU14K4L91wiPNk9KegHaE8&pid=Api',\n",
" 'url': 'https://www.metroparks.com/bird-of-the-week-eastern-bluebird/',\n",
" 'height': 1000,\n",
" 'width': 1500,\n",
" 'source': 'Bing'},\n",
" {'title': 'Scarlet Macaw Bird Species Profile',\n",
" 'image': 'https://fthmb.tqn.com/D9LmnHYOLdxXB4OHyJx-_-OkwpI=/4724x2657/filters:fill(auto,1)/GettyImages-634869043-58a6e83f5f9b58a3c918ca12.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.klBVhaIRwebGDaTRNkstFgHaEK&pid=Api',\n",
" 'url': 'https://www.thespruce.com/scarlet-macaws-390840',\n",
" 'height': 2657,\n",
" 'width': 4724,\n",
" 'source': 'Bing'},\n",
" {'title': 'Pictures of Red Birds from around the Globe',\n",
" 'image': 'https://fthmb.tqn.com/p4duqUvzu185Vcu-MxxjrSa8ST0=/1500x1000/filters:fill(auto,1)/red-summer-tanager-58991d123df78caebc049ac4.jpg',\n",
" 'thumbnail': 'https://tse2.mm.bing.net/th?id=OIP.SaNM19bNous2QSez1MKGywHaE8&pid=Api',\n",
" 'url': 'https://www.thespruce.com/pictures-of-red-birds-4121968',\n",
" 'height': 1000,\n",
" 'width': 1500,\n",
" 'source': 'Bing'},\n",
" {'title': 'Birds Wallpapers | Best Wallpapers',\n",
" 'image': 'http://s1.picswalls.com/wallpapers/2014/07/18/birds-picture_104548844_54.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.E6HA4_7QcWLiojFLaZzZuwHaEo&pid=Api',\n",
" 'url': 'http://www.picswalls.com/pic/birds-wallpapers/',\n",
" 'height': 1600,\n",
" 'width': 2560,\n",
" 'source': 'Bing'},\n",
" {'title': 'Bird Wallpapers HD',\n",
" 'image': 'https://www.pixelstalk.net/wp-content/uploads/2016/04/Bird-pics-free-download-wallpaper-HD.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.uMiJRzKF4yekggl1BAwSOgHaEo&pid=Api',\n",
" 'url': 'https://www.pixelstalk.net/bird-wallpapers-hd/',\n",
" 'height': 1600,\n",
" 'width': 2560,\n",
" 'source': 'Bing'},\n",
" {'title': 'Bird - Bird Populations Are Collapsing And It S A Sign Of A Bigger Problem Abc News / Birds make ...',\n",
" 'image': 'https://static.scientificamerican.com/sciam/cache/file/7A715AD8-449D-4B5A-ABA2C5D92D9B5A21_source.png',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.cXZbtUmrx_5dMByZkNDnhgHaFj&pid=Api',\n",
" 'url': 'https://miacg-images.blogspot.com/2021/01/bird-bird-populations-are-collapsing.html',\n",
" 'height': 1500,\n",
" 'width': 2000,\n",
" 'source': 'Bing'},\n",
" {'title': 'pictures: top ten beautiful birds, top 10 parrot wallpaper, parrot wallpaper',\n",
" 'image': 'http://1.bp.blogspot.com/-NpbyAj-nnuc/TzKCP-Gwu-I/AAAAAAAAAd4/3vYZDFAevyo/s1600/Beautiful-bird-wallpaper-for-desktop.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.nzRctJNNWiyP7uUJp704wgHaEo&pid=Api',\n",
" 'url': 'http://top-tenpics.blogspot.co.uk/2012/02/top-ten-beautiful-birds-top-10-parrot.html',\n",
" 'height': 800,\n",
" 'width': 1280,\n",
" 'source': 'Bing'},\n",
" {'title': 'Beautiful Birds Wallpapers ~ Free HD Desktop Wallpapers Download',\n",
" 'image': 'https://1.bp.blogspot.com/-6GeskwWCLkw/Un6hdvh5alI/AAAAAAAAWPI/PrkFZ_6UkEo/s1600/Beautiful+Birds+HD+Wallpapers+Pictuo.blogspot+(8).jpg',\n",
" 'thumbnail': 'https://tse2.mm.bing.net/th?id=OIP.noJl2tsROAXNZywegbOKvAHaE8&pid=Api',\n",
" 'url': 'https://hdwallpaperswide4u.blogspot.com/2013/11/beautiful-birds-wallpapers.html',\n",
" 'height': 1067,\n",
" 'width': 1600,\n",
" 'source': 'Bing'},\n",
" {'title': 'Cardinal Bird Wallpapers - Wallpaper Cave',\n",
" 'image': 'https://wallpapercave.com/wp/ZRZ9Y9t.jpg',\n",
" 'thumbnail': 'https://tse2.mm.bing.net/th?id=OIP.KYh7XeTxf8rK8S0MwA7YPgHaE9&pid=Api',\n",
" 'url': 'https://wallpapercave.com/cardinal-bird-wallpaper',\n",
" 'height': 2592,\n",
" 'width': 3872,\n",
" 'source': 'Bing'},\n",
" {'title': 'Discovering New Zealand birds by Sandra Morris | National Library of New Zealand',\n",
" 'image': 'https://images.ctfassets.net/pwv49hug9jad/tJ3YjTY9u7z25Ybnk7nlQ/24cd3bc755dd9a5b7e50218286e0422d/Tui-1.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.7j62iverQDrdGCCp_m0AbAHaF7&pid=Api',\n",
" 'url': 'https://natlib.govt.nz/blog/posts/discovering-new-zealand-birds-by-sandra-morris',\n",
" 'height': 819,\n",
" 'width': 1024,\n",
" 'source': 'Bing'},\n",
" {'title': \"Birds' cultural benefits | Stanford News\",\n",
" 'image': 'https://news-media.stanford.edu/wp-content/uploads/2020/10/06110917/Birds_Culture-1-copy.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.sUp-IO4Vb21odcyTjxxFPQHaE8&pid=Api',\n",
" 'url': 'https://news.stanford.edu/2020/10/07/birds-cultural-benefits/',\n",
" 'height': 1000,\n",
" 'width': 1500,\n",
" 'source': 'Bing'},\n",
" {'title': 'birds, Bluebirds Wallpapers HD / Desktop and Mobile Backgrounds',\n",
" 'image': 'https://wallup.net/wp-content/uploads/2018/10/06/196814-birds-bluebirds.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.jNljxkviOPeNotioQj_xWwHaEo&pid=Api',\n",
" 'url': 'https://wallup.net/birds-bluebirds/',\n",
" 'height': 1200,\n",
" 'width': 1920,\n",
" 'source': 'Bing'},\n",
" {'title': 'Photography of Small Blue and Brown Bird · Free Stock Photo',\n",
" 'image': 'https://images.pexels.com/photos/792416/pexels-photo-792416.jpeg?cs=srgb&dl=animal-beautiful-birdwatching-792416.jpg&fm=jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.pVTy7nSYsdQ0NpauiaqPEwHaFS&pid=Api',\n",
" 'url': 'https://www.pexels.com/photo/photography-of-small-blue-and-brown-bird-792416/',\n",
" 'height': 2976,\n",
" 'width': 4167,\n",
" 'source': 'Bing'},\n",
" {'title': 'How to Convert Your Backyard Into Paradise for Birds',\n",
" 'image': 'https://www.funcitydevelopers.com/wp-content/uploads/2021/01/bird-768x544.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.T143HGqmSz2kQ9RTIbCxewHaFP&pid=Api',\n",
" 'url': 'https://www.funcitydevelopers.com/how-to-convert-your-backyard-into-paradise-for-birds/',\n",
" 'height': 544,\n",
" 'width': 768,\n",
" 'source': 'Bing'},\n",
" {'title': \"Woodland Kingfisher - Dick Stannard's Blog\",\n",
" 'image': 'https://dickstannard.com/wp-content/uploads/2013/07/Beautiful-Birds-Wallpapers-Birds-Flying-Birds-Pictures-Woodland-Kingfisher-Cute-Birds-Blue-Birds.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.G5sP7oHNUyBlxNj121qGUwHaE8&pid=Api',\n",
" 'url': 'https://dickstannard.com/beautiful-birds-wallpapers-birds-flying-birds-pictures-woodland-kingfisher-cute-birds-blue-birds/',\n",
" 'height': 683,\n",
" 'width': 1024,\n",
" 'source': 'Bing'},\n",
" {'title': 'Beautiful Birds... - Beautiful Nature Photo (23812608) - Fanpop',\n",
" 'image': 'http://images4.fanpop.com/image/photos/23800000/Beautiful-Birds-beautiful-nature-23812608-774-616.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.mHpvOxcJy7f0-1Dq9bt_uAHaF5&pid=Api',\n",
" 'url': 'https://www.fanpop.com/clubs/beautiful-nature/images/23812608/title/beautiful-birds-photo',\n",
" 'height': 616,\n",
" 'width': 774,\n",
" 'source': 'Bing'},\n",
" {'title': 'Unique Wallpaper: Colourful Birds',\n",
" 'image': 'http://3.bp.blogspot.com/-T9n87FiEfUQ/UBAn9y1rxVI/AAAAAAAABQA/MsMHWcuhtUc/s1600/Beautiful+Bird+24.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.KZLWJVQR0lSb-ONAzmWAVAHaFj&pid=Api',\n",
" 'url': 'http://unikwallpaper.blogspot.ch/2012/07/colourful-birds.html',\n",
" 'height': 768,\n",
" 'width': 1024,\n",
" 'source': 'Bing'},\n",
" {'title': 'Colorful Hummingbird Perched on Tree Branch',\n",
" 'image': 'https://i.pinimg.com/originals/9a/d6/4e/9ad64e311fc54b3003d730dc9b2fe80e.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.79UVMr727f-ECf8Vzcb_WgHaIM&pid=Api',\n",
" 'url': 'https://www.pinterest.com/pin/502784745901868156/',\n",
" 'height': 1196,\n",
" 'width': 1080,\n",
" 'source': 'Bing'},\n",
" {'title': 'Latest Collection of 25 Bluebird Pictures',\n",
" 'image': 'https://funchap.net/wp-content/uploads/2014/07/Bluebird-1024x789.jpg',\n",
" 'thumbnail': 'https://tse2.mm.bing.net/th?id=OIP.OCSNHQLKZo4bYb-nvN4UngHaFt&pid=Api',\n",
" 'url': 'https://funchap.net/bluebird/',\n",
" 'height': 789,\n",
" 'width': 1024,\n",
" 'source': 'Bing'},\n",
" {'title': 'Top 20 Backyard Birds in Tennessee (Free Picture ID Printable) - Bird Advisors',\n",
" 'image': 'https://www.birdadvisors.com/wp-content/uploads/2021/01/tufted-titmouse-scaled.jpg',\n",
" 'thumbnail': 'https://tse2.mm.bing.net/th?id=OIP.wbo3uSJDJu0cRMG1medH6QHaHa&pid=Api',\n",
" 'url': 'https://www.birdadvisors.com/backyard-birds-tennessee/',\n",
" 'height': 2560,\n",
" 'width': 2560,\n",
" 'source': 'Bing'},\n",
" {'title': 'Common UK birds: Dunnock | Common british birds, Common garden birds, Bird garden',\n",
" 'image': 'https://i.pinimg.com/originals/16/c2/a0/16c2a0598565ee269f07a9857c227ec1.jpg',\n",
" 'thumbnail': 'https://tse2.mm.bing.net/th?id=OIP.ZwoL9hBe9I6N_UrgkNoCkQHaFj&pid=Api',\n",
" 'url': 'https://www.pinterest.co.uk/pin/328270260340714586/',\n",
" 'height': 1128,\n",
" 'width': 1504,\n",
" 'source': 'Bing'},\n",
" {'title': '25 Birds With Yellow Beaks (With Photos) - Animal Hype',\n",
" 'image': 'https://upload.wikimedia.org/wikipedia/commons/b/b8/Turdus-migratorius-002.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.poJsGugU6euCRwpYThzU2wHaFn&pid=Api',\n",
" 'url': 'https://animalhype.com/birds/birds-with-yellow-beaks/',\n",
" 'height': 1024,\n",
" 'width': 1350,\n",
" 'source': 'Bing'},\n",
" {'title': '10 Incredible Hummingbird Species You Could See in Your Backyard | Family Handyman',\n",
" 'image': 'https://www.familyhandyman.com/wp-content/uploads/2019/07/shutterstock_627565535-Calliope.jpg?w=1200',\n",
" 'thumbnail': 'https://tse2.mm.bing.net/th?id=OIP.GxkYvyxgszNTbW5yqWkGOgHaHa&pid=Api',\n",
" 'url': 'https://www.familyhandyman.com/list/hummingbird-species-you-could-see-in-your-backyard/',\n",
" 'height': 1200,\n",
" 'width': 1200,\n",
" 'source': 'Bing'},\n",
" {'title': 'Blue Bird Wallpaper (68+ images)',\n",
" 'image': 'https://getwallpapers.com/wallpaper/full/7/6/a/1255753-beautiful-blue-bird-wallpaper-2560x1707.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.n-jl-Uzd7TD8pukPRZpBKAHaE8&pid=Api',\n",
" 'url': 'https://getwallpapers.com/collection/blue-bird-wallpaper',\n",
" 'height': 1707,\n",
" 'width': 2560,\n",
" 'source': 'Bing'},\n",
" {'title': 'Northern Cardinal | Celebrate Urban Birds',\n",
" 'image': 'https://celebrateurbanbirds.org/wp-content/uploads/2016/05/northern-cardinal-1024x916.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.l8Dmb6CHIiqHfuKn0hE1SgHaGo&pid=Api',\n",
" 'url': 'https://celebrateurbanbirds.org/learn/birds/focal-species/northern-cardinal/',\n",
" 'height': 916,\n",
" 'width': 1024,\n",
" 'source': 'Bing'},\n",
" {'title': 'Cardinal | Ohio birds, Red robin bird, Common birds',\n",
" 'image': 'https://i.pinimg.com/originals/48/7d/cc/487dccfd54aeba36db30de662f25ea30.jpg',\n",
" 'thumbnail': 'https://tse2.mm.bing.net/th?id=OIP.g8MDaeRDWqn34Onc13qu4AHaE9&pid=Api',\n",
" 'url': 'https://www.pinterest.com/pin/295478425534424935/',\n",
" 'height': 2592,\n",
" 'width': 3872,\n",
" 'source': 'Bing'},\n",
" {'title': 'Cute Birds Wallpapers | Download Free Bird Images',\n",
" 'image': 'https://1.bp.blogspot.com/-qxv7YAs5uuI/UWE5Avdn9sI/AAAAAAAAAac/awQTggyyNsA/s1600/cute+pear+tree+blossoms+with+red+birds+cardinal+2013+picture.Jpg',\n",
" 'thumbnail': 'https://tse2.mm.bing.net/th?id=OIP.-CWih6mwf9HqlsDZrRqLSQHaFj&pid=Api',\n",
" 'url': 'https://bird-images.blogspot.com/2013/04/cute-birds-wallpapers.html',\n",
" 'height': 1200,\n",
" 'width': 1600,\n",
" 'source': 'Bing'},\n",
" {'title': '19 common British birds in your garden | Love The Garden',\n",
" 'image': 'https://www.lovethegarden.com/sites/default/files/styles/large_retina/public/content/content_block/UK_wildbirds-04-goldfinch.jpg?itok=haxPXYsR',\n",
" 'thumbnail': 'https://tse2.explicit.bing.net/th?id=OIP.JdvQw4CQPgWyMVRXAXSeZgHaFj&pid=Api',\n",
" 'url': 'https://www.lovethegarden.com/uk-en/article/19-common-british-birds-you-can-find-your-garden?language_content_entity=uk-en',\n",
" 'height': 720,\n",
" 'width': 960,\n",
" 'source': 'Bing'},\n",
" {'title': 'Top 5 and 10 Lines on Parrot in English 2024/Few Best Lines',\n",
" 'image': 'https://jobsdigit.com/wp-content/uploads/2021/03/parrot-lines-essay-1024x743.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.Zfe3GG-ESdpEpovvCEKCyQHaFX&pid=Api',\n",
" 'url': 'https://jobsdigit.com/blog/top-5-10-lines-on-parrot-in-english-few-lines/',\n",
" 'height': 743,\n",
" 'width': 1024,\n",
" 'source': 'Bing'},\n",
" {'title': 'Colorful and Exotic Birds in Nature',\n",
" 'image': 'https://i.pinimg.com/originals/b8/8b/48/b88b489c204c229b1cb9912fd2f8d9bc.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.qr10PrWXiZac5y61zo-vgAHaKc&pid=Api',\n",
" 'url': 'https://www.pinterest.co.uk/pin/524458319106247245/',\n",
" 'height': 1494,\n",
" 'width': 1060,\n",
" 'source': 'Bing'},\n",
" {'title': \"How can you ignore such a beautiful bird: Let's see the interesting thing (Video)\",\n",
" 'image': 'https://celebrateurbanbirds.org/wp-content/uploads/2016/05/northern-cardinal.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.4VW1vSoRQ3ClzDUsTZiQjwAAAA&pid=Api',\n",
" 'url': 'https://vntin365.com/how-can-you-ignore-such-a-beautiful-bird-lets-see-the-interesting-thing-video-linhth002/',\n",
" 'height': 424,\n",
" 'width': 474,\n",
" 'source': 'Bing'},\n",
" {'title': '19 common British birds in your garden | Love The Garden',\n",
" 'image': 'https://www.lovethegarden.com/sites/default/files/content/articles/UK_wildbirds-04-goldfinch.jpg',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.Ots3C9BG3bj06m-OIYrI1wHaFj&pid=Api',\n",
" 'url': 'https://www.lovethegarden.com/uk-en/article/19-common-british-birds-you-can-find-your-garden',\n",
" 'height': 1128,\n",
" 'width': 1504,\n",
" 'source': 'Bing'},\n",
" {'title': 'Pin by dawn aumann on Living Creatures | Common british birds, Common garden birds, Bird garden',\n",
" 'image': 'https://i.pinimg.com/originals/ef/b4/06/efb40632e710976fd21f35d6f0028d29.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.JnJQ56ldV0nDcy5FbPVahAHaFj&pid=Api',\n",
" 'url': 'https://www.pinterest.com/pin/303570831133706884/',\n",
" 'height': 1128,\n",
" 'width': 1504,\n",
" 'source': 'Bing'},\n",
" {'title': '20,000+ Best Birds Photos · 100% Free Download · Pexels Stock Photos',\n",
" 'image': 'https://images.pexels.com/photos/416179/pexels-photo-416179.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',\n",
" 'thumbnail': 'https://tse1.mm.bing.net/th?id=OIP.617SXz3_GvLEJ3j0SF1N5wHaE8&pid=Api',\n",
" 'url': 'https://www.pexels.com/search/birds',\n",
" 'height': 334,\n",
" 'width': 500,\n",
" 'source': 'Bing'},\n",
" {'title': 'Hummingbird Migration: A Marvel of Nature | Whitehawk Birding Blog',\n",
" 'image': 'https://www.whitehawkbirding.com/wp-content/uploads/2020/07/Rufous-Hummingbird-1230x1536.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.HXn2jw8fzi4TrfVIu06BeQHaJP&pid=Api',\n",
" 'url': 'https://www.whitehawkbirding.com/hummingbird-migration/',\n",
" 'height': 1536,\n",
" 'width': 1230,\n",
" 'source': 'Bing'},\n",
" {'title': 'Wallpaper Nature Birds | Wallpapers Gallery',\n",
" 'image': 'http://images4.fanpop.com/image/photos/23400000/Birds-beautiful-nature-23445747-1024-768.jpg',\n",
" 'thumbnail': 'https://tse2.mm.bing.net/th?id=OIP.QtlindVP8RcM6nQfUL1N2gHaFj&pid=Api',\n",
" 'url': 'https://awallpapersgallery.blogspot.com/2015/10/wallpaper-nature-birds.html',\n",
" 'height': 768,\n",
" 'width': 1024,\n",
" 'source': 'Bing'},\n",
" {'title': 'Unique Birds (40 Pics) - STATIONGOSSIP',\n",
" 'image': 'https://i.imgur.com/w6JibQX.jpg',\n",
" 'thumbnail': 'https://tse3.mm.bing.net/th?id=OIP.gvIrcARWorPypat_jJEf3AHaHa&pid=Api',\n",
" 'url': 'http://www.stationgossip.com/2020/05/unique-birds-40-pics.html',\n",
" 'height': 700,\n",
" 'width': 700,\n",
" 'source': 'Bing'},\n",
" {'title': 'animals, Nature, Birds Wallpapers HD / Desktop and Mobile Backgrounds',\n",
" 'image': 'https://wallup.net/wp-content/uploads/2016/01/206531-animals-nature-birds.jpg',\n",
" 'thumbnail': 'https://tse4.mm.bing.net/th?id=OIP.9r1FK45OyzvEPnZ4HZKcxQHaEo&pid=Api',\n",
" 'url': 'https://wallup.net/animals-nature-birds-5/',\n",
" 'height': 1200,\n",
" 'width': 1920,\n",
" 'source': 'Bing'}]"
]
},
"execution_count": 131,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"DDGS().images('bird photos')"
]
},
{
"cell_type": "code",
"execution_count": 132,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'https://images.pexels.com/photos/1661179/pexels-photo-1661179.jpeg?cs=srgb&dl=green-bird-1661179.jpg&fm=jpg'"
]
},
"execution_count": 132,
"metadata": {},
"output_type": "execute_result"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\Users\\micro\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\curl_cffi\\aio.py:204: UserWarning: Curlm alread closed! quitting from process_data\n",
" warnings.warn(\"Curlm alread closed! quitting from process_data\")\n"
]
}
],
"source": [
"urls = search_images('bird photos', 10)\n",
"urls[0]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Image Download"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\Users\\micro\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\tqdm\\auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
},
{
"data": {
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
" background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
" <div>\n",
" <progress value='811008' class='' max='807464' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
" 100.44% [811008/807464 00:00&lt;00:00]\n",
" </div>\n",
" "
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAEAANsDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDcdqru3FPdqhc1zs5RjGoWNPY1ExqRCE0m6mE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dLI/JHh61HXb95IuCG9ybv56Fb6ree3c27P3FlzF3235J7SvYr7mvcbfjT9sV3qID0+6j068GDBgztj3LEnP2X/9H686CH5YcWEzkTzI9tHxyZ9Jy8/Xvh4/EnWk5mnxT8r/1z7zOTZd794/DIwFTs1/lz0/NOvm1+ov9j/0u5l73TY9P1XGa9mXpe8UX9z4C3rbf+7mHcTM7nvse8rP5h+6PkY9PHup4xPn34D94Tz+6TMXDkAAQAASURBVHgBZP3n021Nep+H7ZyeeNKbJ2MGmBmEAQgMEkGAgkgCDKIpky5XqWyXv/q/kb+6bJer7CpXOYlyibZUCrZskRIoUgZApAEwM5h5500nPGnn6Ov63WvvcwD1ec7avbrvvnPH1atX+9//P/0vD4d9u93a7/etllduW63DXwmtdmubvN3+QC6AAORCXOi6NpHWHvhCSHqrLXDdtrndt/btQ7fdAQ2RTqfbOpicsm2AiXY6HeDbCSJot8nl+pfih0673QnzplsQEAhLT1nAbcHWjvQIB47wWdT2iMKt8IddZLOw1ClbkCVmI4iolKI4EVc0tafwgYLkWm6323XanWAmAQJbeCBRaHL3RDdip6wpATmSSzLGEA5JKBNyO9gHCfG9PO9RznYrWkoHQDTJBcEuyMILqQqwU3cJSciFsqcUVBPwSH7oIshR1RCCSgUS67aQdLrkwX+fUp12F5F7nQ5ZAnPhPr9g7gpqVl2FMN7jF5y9ttmtXhdcFCP0YtE3vEeBNCcScqWMVy1B1N/
"text/plain": [
"<PIL.Image.Image image mode=RGB size=219x256>"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from fastai.vision.all import Image\n",
"from fastdownload import download_url\n",
"\n",
"destination = 'images/bird.jpg'\n",
"download_url(urls[0], destination)\n",
"\n",
"image = Image.open(destination)\n",
"image.to_thumb(256, 256)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Forest Test"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
" background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
" <div>\n",
" <progress value='6070272' class='' max='6064064' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
" 100.10% [6070272/6064064 00:00&lt;00:00]\n",
" </div>\n",
" "
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCACqAQADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEB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jlJ8pUK3nStoMqxUVNAco5oqR
"text/plain": [
"<PIL.Image.Image image mode=RGB size=256x170>"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\Users\\micro\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\curl_cffi\\aio.py:204: UserWarning: Curlm alread closed! quitting from process_data\n",
" warnings.warn(\"Curlm alread closed! quitting from process_data\")\n"
]
}
],
"source": [
"download_url(search_images('forest photo', max_images = 1)[0], 'images/forest.jpg')\n",
"Image.open('images/forest.jpg').to_thumb(256, 256)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Download Data Sets"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"from pathlib import Path\n",
"data_set_path = Path('bird_or_not')"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"█\r"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\Users\\micro\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\curl_cffi\\aio.py:204: UserWarning: Curlm alread closed! quitting from process_data\n",
" warnings.warn(\"Curlm alread closed! quitting from process_data\")\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"█\r"
]
}
],
"source": [
"from fastai.vision.utils import download_images, resize_images\n",
"from time import sleep # Be nice to the DDG servers.\n",
"\n",
"searches = ['bird', 'forest']\n",
"\n",
"for search in searches:\n",
" destination = data_set_path/search\n",
" destination.mkdir(exist_ok = True, parents = True)\n",
" download_images(dest = destination, urls = search_images(f'{search} photo', max_images = 25))\n",
" sleep(5)\n",
" # Search for different lighting conditions.\n",
" download_images(dest = destination, urls = search_images(f'{search} sun photo', max_images = 25))\n",
" sleep(5)\n",
" download_images(dest = destination, urls = search_images(f'{search} shade photo', max_images = 25))\n",
" resize_images(path = destination, max_size = 400, dest = destination)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Verify Images"
]
},
{
"cell_type": "code",
"execution_count": 134,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0"
]
},
"execution_count": 134,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from fastai.vision.utils import get_image_files, verify_images\n",
"\n",
"failed_images = verify_images(get_image_files(data_set_path))\n",
"failed_images.map(Path.unlink)\n",
"len(failed_images)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Construct Training and Validation Sets"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAs0AAAHzCAYAAADb1yDBAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9acytaV7WDf/O6RrWdE97rl3jruoJGhq7ARkExPgiGpEI3SIftKMIhElj/GLigAm0yWvURKIhqAGE5Plg1Bh99YG3H4j6PIJvY9NjdVXXXLV37b3vcY3XdE7vh/Na933vXVVdxViFriO577XWda11zed1HedxHv//X8QYIxtssMEGG2ywwQYbbLDBG0K+3RuwwQYbbLDBBhtssMEG73RsSPMGG2ywwQYbbLDBBhu8CTakeYMNNthggw022GCDDd4EG9K8wQYbbLDBBhtssMEGb4INad5ggw022GCDDTbYYIM3wYY0b7DBBhtssMEGG2ywwZtgQ5o32GCDDTbYYIMNNtjgTbAhzRtssMEGG2ywwQYbbPAm2JDmDTbYYIMNNthggw02eBNsSPM7BD/+4z+OEILDw8Mv+b1HHnmEj370o7+jdX3Lt3wL3/It3/I7WsYGG2yQ8IlPfIKv//qvZzgcIoTgU5/61Nu9SRtssMHvEJt2vcHrQb/dG7DBBhts8AcV1lo+/OEPUxQF//gf/2MGgwEPP/zw271Z9+BjH/sY73vf+/jO7/zOt3tTNtjgDwQ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CMH3yCnasPELUhKknXtmRKIVzH8uiIZr5AK4FSiu3tCVeuXMZ6x8HBPk1To63DtoFHv+zLyAYlLz/
"text/plain": [
"<Figure size 900x600 with 6 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"data_loaders = DataBlock(\n",
" blocks = (ImageBlock, CategoryBlock),\n",
" get_items = get_image_files,\n",
" splitter = RandomSplitter(valid_pct = 0.2, seed = 42),\n",
" get_y = parent_label,\n",
" item_tfms = [Resize(192, method = 'squish')],\n",
").dataloaders(data_set_path, bs = 32)\n",
"\n",
"data_loaders.show_batch(max_n = 6)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Train Model"
]
},
{
"cell_type": "code",
"execution_count": 125,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"GPU Available: True\n",
"GPU Device: NVIDIA GeForce RTX 3090\n",
"CUDA Version: 11.8\n"
]
}
],
"source": [
"import torch\n",
"\n",
"print(f'GPU Available: {torch.cuda.is_available()}')\n",
"print(f'GPU Device: {torch.cuda.get_device_name(0)}')\n",
"print(f'CUDA Version: {torch.version.cuda}')\n",
"\n",
"# Shouldn't be necessary, just for reference:\n",
"# torch.set_default_device('cuda')\n",
"# import os\n",
"# os.environ['CUDA_VISIBLE_DEVICES'] = '0'"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
" background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: left;\">\n",
" <th>epoch</th>\n",
" <th>train_loss</th>\n",
" <th>valid_loss</th>\n",
" <th>error_rate</th>\n",
" <th>time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>0</td>\n",
" <td>0.712349</td>\n",
" <td>0.675835</td>\n",
" <td>0.250000</td>\n",
" <td>00:02</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
" background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: left;\">\n",
" <th>epoch</th>\n",
" <th>train_loss</th>\n",
" <th>valid_loss</th>\n",
" <th>error_rate</th>\n",
" <th>time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>0</td>\n",
" <td>0.253165</td>\n",
" <td>0.213951</td>\n",
" <td>0.071429</td>\n",
" <td>00:00</td>\n",
" </tr>\n",
" <tr>\n",
" <td>1</td>\n",
" <td>0.133015</td>\n",
" <td>0.019212</td>\n",
" <td>0.000000</td>\n",
" <td>00:00</td>\n",
" </tr>\n",
" <tr>\n",
" <td>2</td>\n",
" <td>0.093029</td>\n",
" <td>0.013886</td>\n",
" <td>0.000000</td>\n",
" <td>00:00</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from fastai.vision.learner import vision_learner, error_rate\n",
"from fastai.vision.models import resnet18\n",
"\n",
"model = vision_learner(data_loaders, arch = resnet18, metrics = error_rate)\n",
"model.fine_tune(3)"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"cuda:0\n",
"cuda:0 cuda:0\n",
"cuda:0\n"
]
}
],
"source": [
"# Sanity checks\n",
"print(model.dls.device)\n",
"\n",
"x, y = data_loaders.one_batch()\n",
"print(x.device, y.device)\n",
"\n",
"print(next(model.model.parameters()).device)"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCACqAQADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLD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iaee67tUZzr97c3z/IlWIk0L+tRqPfbLVqwJEapbR
"text/plain": [
"<PIL.Image.Image image mode=RGB size=256x170>"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"test_image = PILImage.create('test_images/bird.jpg')\n",
"test_image.to_thumb(256, 256)"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
" background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Category: bird.\n",
"Probabilities: tensor([9.9999e-01, 5.3161e-06])\n"
]
}
],
"source": [
"category, _, probability = model.predict(test_image)\n",
"print(f\"Category: {category}.\")\n",
"print(f\"Probabilities: {probability}\")"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL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fDMh6o7/QvAT+7Y0N5OVbFYZ+laTtk/YXH338892twa2d6id78oN9pZx7czLZn0y6FMnGxE1aoBuDLzyH2C7+Qf28PZ20AksxNZkTiW/99hqBZaeqooTnvpL66oP7quwHiI8gAU1jtoM4RoDhPoGHr7y2SlORr+89J0N3OgkxKvQ8RIxiFEWaCyTwQ4ajMCrAiTAWEXkusXI31Ryf4JhPc6RrWgSJeQEdE+86dhClq/Xp+yRDEkgyl7pFBPHOxQOxkBcFo9n7IMZVp107v7xGs8V84uUPvvifO1jrB9/KPf+Cld1uKpteyC1Xi127niLoSYjHavWAJBk7QBYLzzM
"text/plain": [
"<PIL.Image.Image image mode=RGB size=256x171>"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"test_image = PILImage.create('test_images/forest.jpg')\n",
"test_image.to_thumb(256, 256)"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"<style>\n",
" /* Turns off some styling */\n",
" progress {\n",
" /* gets rid of default border in Firefox and Opera. */\n",
" border: none;\n",
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
" background-size: auto;\n",
" }\n",
" progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
" background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
" }\n",
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
" background: #F44336;\n",
" }\n",
"</style>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Category: forest.\n",
"Probabilities: tensor([5.5726e-04, 9.9944e-01])\n"
]
}
],
"source": [
"category, _, probability = model.predict(test_image)\n",
"print(f\"Category: {category}.\")\n",
"print(f\"Probabilities: {probability}\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}