Bird Species Recognition¶
Data set of 285 bird species.40930 training images, 1425 test images(5 images per species) and 1425 validation images(5 images per species. All images are 224 X 224 X 3 color images in jpg format. Data set includes a train set, test set and validation set. Each set contains 285 sub directories, one for each bird species. The data structure is convenient if you use the Keras ImageDataGenerator.flowfromdirectory to create your train, test and valid data generators.
The data set also include a file Bird Species.csv. This cvs file contains three columns. The filepaths column contains the file path to an image file. The labels column contains the class name associated with the image file. The Bird Species.csv file if read in using df= pandas.birdscsv(Bird Species.csv) will create a pandas dataframe which then can be split into traindf, testdf and validdf dataframes to create your own partitioning of the data into train, test and valid data sets
from google.colab import files
files.upload()
Getting data using Kaggle API¶
! mkdir ~/.kaggle
! cp kaggle.json ~/.kaggle/
! chmod 600 ~/.kaggle/kaggle.json
! kaggle datasets download -d gpiosenka/100-bird-species
Downloading 100-bird-species.zip to /content 100% 2.82G/2.83G [00:59<00:00, 53.1MB/s] 100% 2.83G/2.83G [00:59<00:00, 50.6MB/s]
# downloading helper_functions.py
! wget https://raw.githubusercontent.com/Hrushi11/Dogs_VS_Cats/main/helper_functions.py
--2021-08-22 07:25:41-- https://raw.githubusercontent.com/Hrushi11/Dogs_VS_Cats/main/helper_functions.py Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133, 185.199.108.133, 185.199.111.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 10139 (9.9K) [text/plain] Saving to: ‘helper_functions.py’ helper_functions.py 100%[===================>] 9.90K --.-KB/s in 0s 2021-08-22 07:25:41 (64.9 MB/s) - ‘helper_functions.py’ saved [10139/10139]
Importing dependancies¶
# Importing dependancies
import os
import random
import numpy as np
import pandas as pd
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.keras.layers.experimental import preprocessing
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from helper_functions import unzip_data, walk_through_dir, plot_loss_curves, compare_historys, make_confusion_matrix
Getting our data ready¶
unzip_data("/content/100-bird-species.zip")
Deleting unneccesory files¶
# To delete the zip file
!rm 100-bird-species.zip
# To delete extra folders
!rm -rf 285-birds # add '-' in folder name
!rm -rf birds_rev2
rm: cannot remove '100-bird-species.zip': No such file or directory
Walkthrough¶
walk_through_dir("/content/birds")
There are 3 directories and 1 images in '/content/birds'. There are 275 directories and 0 images in '/content/birds/test'. There are 0 directories and 5 images in '/content/birds/test/SPOON BILED SANDPIPER'. There are 0 directories and 5 images in '/content/birds/test/RED FACED WARBLER'. There are 0 directories and 5 images in '/content/birds/test/UMBRELLA BIRD'. There are 0 directories and 5 images in '/content/birds/test/COMMON POORWILL'. There are 0 directories and 5 images in '/content/birds/test/CROW'. There are 0 directories and 5 images in '/content/birds/test/BALD EAGLE'. There are 0 directories and 5 images in '/content/birds/test/ENGGANO MYNA'. There are 0 directories and 5 images in '/content/birds/test/BANDED BROADBILL'. There are 0 directories and 5 images in '/content/birds/test/GOLDEN PIPIT'. There are 0 directories and 5 images in '/content/birds/test/ANNAS HUMMINGBIRD'. There are 0 directories and 5 images in '/content/birds/test/PUFFIN'. There are 0 directories and 5 images in '/content/birds/test/BANANAQUIT'. There are 0 directories and 5 images in '/content/birds/test/MALEO'. There are 0 directories and 5 images in '/content/birds/test/KAKAPO'. There are 0 directories and 5 images in '/content/birds/test/RED WINGED BLACKBIRD'. There are 0 directories and 5 images in '/content/birds/test/BLACK SWAN'. There are 0 directories and 5 images in '/content/birds/test/ALEXANDRINE PARAKEET'. There are 0 directories and 5 images in '/content/birds/test/CALIFORNIA GULL'. There are 0 directories and 5 images in '/content/birds/test/DARK EYED JUNCO'. There are 0 directories and 5 images in '/content/birds/test/FRIGATE'. There are 0 directories and 5 images in '/content/birds/test/YELLOW BELLIED FLOWERPECKER'. There are 0 directories and 5 images in '/content/birds/test/CHARA DE COLLAR'. There are 0 directories and 5 images in '/content/birds/test/OYSTER CATCHER'. There are 0 directories and 5 images in '/content/birds/test/STEAMER DUCK'. There are 0 directories and 5 images in '/content/birds/test/BARRED PUFFBIRD'. There are 0 directories and 5 images in '/content/birds/test/INDIAN BUSTARD'. There are 0 directories and 5 images in '/content/birds/test/SPANGLED COTINGA'. There are 0 directories and 5 images in '/content/birds/test/PURPLE SWAMPHEN'. There are 0 directories and 5 images in '/content/birds/test/OCELLATED TURKEY'. There are 0 directories and 5 images in '/content/birds/test/STRAWBERRY FINCH'. There are 0 directories and 5 images in '/content/birds/test/CALIFORNIA CONDOR'. There are 0 directories and 5 images in '/content/birds/test/ARARIPE MANAKIN'. There are 0 directories and 5 images in '/content/birds/test/NORTHERN CARDINAL'. There are 0 directories and 5 images in '/content/birds/test/PURPLE GALLINULE'. There are 0 directories and 5 images in '/content/birds/test/RAZORBILL'. There are 0 directories and 5 images in '/content/birds/test/ROBIN'. There are 0 directories and 5 images in '/content/birds/test/COMMON GRACKLE'. There are 0 directories and 5 images in '/content/birds/test/WHITE CHEEKED TURACO'. There are 0 directories and 5 images in '/content/birds/test/ROSY FACED LOVEBIRD'. There are 0 directories and 5 images in '/content/birds/test/BLACK THROATED BUSHTIT'. There are 0 directories and 5 images in '/content/birds/test/CAPE MAY WARBLER'. There are 0 directories and 5 images in '/content/birds/test/COMMON FIRECREST'. There are 0 directories and 5 images in '/content/birds/test/COUCHS KINGBIRD'. There are 0 directories and 5 images in '/content/birds/test/SCARLET MACAW'. There are 0 directories and 5 images in '/content/birds/test/BLACK-CAPPED CHICKADEE'. There are 0 directories and 5 images in '/content/birds/test/RUFUOS MOTMOT'. There are 0 directories and 5 images in '/content/birds/test/HELMET VANGA'. There are 0 directories and 5 images in '/content/birds/test/EASTERN TOWEE'. There are 0 directories and 5 images in '/content/birds/test/COMMON STARLING'. There are 0 directories and 5 images in '/content/birds/test/WHITE NECKED RAVEN'. There are 0 directories and 5 images in '/content/birds/test/ROUGH LEG BUZZARD'. There are 0 directories and 5 images in '/content/birds/test/ANHINGA'. There are 0 directories and 5 images in '/content/birds/test/BALTIMORE ORIOLE'. There are 0 directories and 5 images in '/content/birds/test/YELLOW HEADED BLACKBIRD'. There are 0 directories and 5 images in '/content/birds/test/AFRICAN FIREFINCH'. There are 0 directories and 5 images in '/content/birds/test/SAND MARTIN'. There are 0 directories and 5 images in '/content/birds/test/CLARKS NUTCRACKER'. There are 0 directories and 5 images in '/content/birds/test/NORTHERN RED BISHOP'. There are 0 directories and 5 images in '/content/birds/test/KIWI'. There are 0 directories and 5 images in '/content/birds/test/FLAMINGO'. There are 0 directories and 5 images in '/content/birds/test/BROWN NOODY'. There are 0 directories and 5 images in '/content/birds/test/CARMINE BEE-EATER'. There are 0 directories and 5 images in '/content/birds/test/GREEN MAGPIE'. There are 0 directories and 5 images in '/content/birds/test/PARAKETT AKULET'. There are 0 directories and 5 images in '/content/birds/test/BLACKBURNIAM WARBLER'. There are 0 directories and 5 images in '/content/birds/test/GRAY PARTRIDGE'. There are 0 directories and 5 images in '/content/birds/test/BLACK VULTURE'. There are 0 directories and 5 images in '/content/birds/test/PARADISE TANAGER'. There are 0 directories and 5 images in '/content/birds/test/BELTED KINGFISHER'. There are 0 directories and 5 images in '/content/birds/test/RED WISKERED BULBUL'. There are 0 directories and 5 images in '/content/birds/test/JAVA SPARROW'. There are 0 directories and 5 images in '/content/birds/test/SMITHS LONGSPUR'. There are 0 directories and 5 images in '/content/birds/test/MASKED BOOBY'. There are 0 directories and 5 images in '/content/birds/test/CHUKAR PARTRIDGE'. There are 0 directories and 5 images in '/content/birds/test/PYGMY KINGFISHER'. There are 0 directories and 5 images in '/content/birds/test/CHIPPING SPARROW'. There are 0 directories and 5 images in '/content/birds/test/BORNEAN LEAFBIRD'. There are 0 directories and 5 images in '/content/birds/test/ROYAL FLYCATCHER'. There are 0 directories and 5 images in '/content/birds/test/SNOWY OWL'. There are 0 directories and 5 images in '/content/birds/test/VENEZUELIAN TROUPIAL'. There are 0 directories and 5 images in '/content/birds/test/AMERICAN BITTERN'. There are 0 directories and 5 images in '/content/birds/test/AMERICAN KESTREL'. There are 0 directories and 5 images in '/content/birds/test/MIKADO PHEASANT'. There are 0 directories and 5 images in '/content/birds/test/ELLIOTS PHEASANT'. There are 0 directories and 5 images in '/content/birds/test/MALLARD DUCK'. There are 0 directories and 5 images in '/content/birds/test/COCK OF THE ROCK'. There are 0 directories and 5 images in '/content/birds/test/CROWNED PIGEON'. There are 0 directories and 5 images in '/content/birds/test/BIRD OF PARADISE'. There are 0 directories and 5 images in '/content/birds/test/D-ARNAUDS BARBET'. There are 0 directories and 5 images in '/content/birds/test/SAMATRAN THRUSH'. There are 0 directories and 5 images in '/content/birds/test/LEARS MACAW'. There are 0 directories and 5 images in '/content/birds/test/EASTERN ROSELLA'. There are 0 directories and 5 images in '/content/birds/test/SWINHOES PHEASANT'. There are 0 directories and 5 images in '/content/birds/test/PURPLE FINCH'. There are 0 directories and 5 images in '/content/birds/test/RED FACED CORMORANT'. There are 0 directories and 5 images in '/content/birds/test/GREY PLOVER'. There are 0 directories and 5 images in '/content/birds/test/COMMON HOUSE MARTIN'. There are 0 directories and 5 images in '/content/birds/test/BLACK SKIMMER'. There are 0 directories and 5 images in '/content/birds/test/GO AWAY BIRD'. There are 0 directories and 5 images in '/content/birds/test/RED BROWED FINCH'. There are 0 directories and 5 images in '/content/birds/test/KING VULTURE'. There are 0 directories and 5 images in '/content/birds/test/ASIAN CRESTED IBIS'. There are 0 directories and 5 images in '/content/birds/test/BULWERS PHEASANT'. There are 0 directories and 5 images in '/content/birds/test/BAY-BREASTED WARBLER'. There are 0 directories and 5 images in '/content/birds/test/IMPERIAL SHAQ'. There are 0 directories and 5 images in '/content/birds/test/PELICAN'. There are 0 directories and 5 images in '/content/birds/test/GUINEA TURACO'. There are 0 directories and 5 images in '/content/birds/test/YELLOW CACIQUE'. There are 0 directories and 5 images in '/content/birds/test/EMU'. There are 0 directories and 5 images in '/content/birds/test/FLAME TANAGER'. There are 0 directories and 5 images in '/content/birds/test/JABIRU'. There are 0 directories and 5 images in '/content/birds/test/SORA'. There are 0 directories and 5 images in '/content/birds/test/WILD TURKEY'. There are 0 directories and 5 images in '/content/birds/test/TRUMPTER SWAN'. There are 0 directories and 5 images in '/content/birds/test/WILSONS BIRD OF PARADISE'. There are 0 directories and 5 images in '/content/birds/test/BARN SWALLOW'. There are 0 directories and 5 images in '/content/birds/test/GRAY CATBIRD'. There are 0 directories and 5 images in '/content/birds/test/GOULDIAN FINCH'. There are 0 directories and 5 images in '/content/birds/test/AMERICAN COOT'. There are 0 directories and 5 images in '/content/birds/test/CRESTED NUTHATCH'. There are 0 directories and 5 images in '/content/birds/test/PINK ROBIN'. There are 0 directories and 5 images in '/content/birds/test/STRIPPED SWALLOW'. There are 0 directories and 5 images in '/content/birds/test/COCKATOO'. There are 0 directories and 5 images in '/content/birds/test/VULTURINE GUINEAFOWL'. There are 0 directories and 5 images in '/content/birds/test/MANDRIN DUCK'. There are 0 directories and 5 images in '/content/birds/test/BLUE HERON'. There are 0 directories and 5 images in '/content/birds/test/INDIAN PITTA'. There are 0 directories and 5 images in '/content/birds/test/SRI LANKA BLUE MAGPIE'. There are 0 directories and 5 images in '/content/birds/test/GAMBELS QUAIL'. There are 0 directories and 5 images in '/content/birds/test/EURASIAN MAGPIE'. There are 0 directories and 5 images in '/content/birds/test/GLOSSY IBIS'. There are 0 directories and 5 images in '/content/birds/test/BLACK THROATED WARBLER'. There are 0 directories and 5 images in '/content/birds/test/NORTHERN GANNET'. There are 0 directories and 5 images in '/content/birds/test/HARPY EAGLE'. There are 0 directories and 5 images in '/content/birds/test/NICOBAR PIGEON'. There are 0 directories and 5 images in '/content/birds/test/OVENBIRD'. There are 0 directories and 5 images in '/content/birds/test/MAGPIE GOOSE'. There are 0 directories and 5 images in '/content/birds/test/OSTRICH'. There are 0 directories and 5 images in '/content/birds/test/OSPREY'. There are 0 directories and 5 images in '/content/birds/test/SNOWY EGRET'. There are 0 directories and 5 images in '/content/birds/test/REGENT BOWERBIRD'. There are 0 directories and 5 images in '/content/birds/test/ELEGANT TROGON'. There are 0 directories and 5 images in '/content/birds/test/ROCK DOVE'. There are 0 directories and 5 images in '/content/birds/test/NORTHERN GOSHAWK'. There are 0 directories and 5 images in '/content/birds/test/BLACK-NECKED GREBE'. There are 0 directories and 5 images in '/content/birds/test/PHILIPPINE EAGLE'. There are 0 directories and 5 images in '/content/birds/test/HAWAIIAN GOOSE'. There are 0 directories and 5 images in '/content/birds/test/AMERICAN PIPIT'. There are 0 directories and 5 images in '/content/birds/test/CAPUCHINBIRD'. There are 0 directories and 5 images in '/content/birds/test/SHOEBILL'. There are 0 directories and 5 images in '/content/birds/test/ALBATROSS'. There are 0 directories and 5 images in '/content/birds/test/GOLDEN EAGLE'. There are 0 directories and 5 images in '/content/birds/test/BARN OWL'. There are 0 directories and 5 images in '/content/birds/test/NORTHERN JACANA'. There are 0 directories and 5 images in '/content/birds/test/LILAC ROLLER'. There are 0 directories and 5 images in '/content/birds/test/PALILA'. There are 0 directories and 5 images in '/content/birds/test/CUBAN TODY'. There are 0 directories and 5 images in '/content/birds/test/AMERICAN AVOCET'. There are 0 directories and 5 images in '/content/birds/test/ANTBIRD'. There are 0 directories and 5 images in '/content/birds/test/NORTHERN PARULA'. There are 0 directories and 5 images in '/content/birds/test/RED HEADED WOODPECKER'. There are 0 directories and 5 images in '/content/birds/test/CANARY'. There are 0 directories and 5 images in '/content/birds/test/MALABAR HORNBILL'. There are 0 directories and 5 images in '/content/birds/test/WHITE TAILED TROPIC'. There are 0 directories and 5 images in '/content/birds/test/MARABOU STORK'. There are 0 directories and 5 images in '/content/birds/test/HORNBILL'. There are 0 directories and 5 images in '/content/birds/test/WHIMBREL'. There are 0 directories and 5 images in '/content/birds/test/CASSOWARY'. There are 0 directories and 5 images in '/content/birds/test/SPLENDID WREN'. There are 0 directories and 5 images in '/content/birds/test/BLACK FRANCOLIN'. There are 0 directories and 5 images in '/content/birds/test/PURPLE MARTIN'. There are 0 directories and 5 images in '/content/birds/test/WATTLED CURASSOW'. There are 0 directories and 5 images in '/content/birds/test/VERMILION FLYCATHER'. There are 0 directories and 5 images in '/content/birds/test/WHITE THROATED BEE EATER'. There are 0 directories and 5 images in '/content/birds/test/GREAT POTOO'. There are 0 directories and 5 images in '/content/birds/test/RED TAILED THRUSH'. There are 0 directories and 5 images in '/content/birds/test/HOUSE FINCH'. There are 0 directories and 5 images in '/content/birds/test/RING-NECKED PHEASANT'. There are 0 directories and 5 images in '/content/birds/test/KOOKABURRA'. There are 0 directories and 5 images in '/content/birds/test/EASTERN BLUEBIRD'. There are 0 directories and 5 images in '/content/birds/test/TREE SWALLOW'. There are 0 directories and 5 images in '/content/birds/test/GOLDEN PHEASANT'. There are 0 directories and 5 images in '/content/birds/test/PEREGRINE FALCON'. There are 0 directories and 5 images in '/content/birds/test/VIOLET GREEN SWALLOW'. There are 0 directories and 5 images in '/content/birds/test/GREEN JAY'. There are 0 directories and 5 images in '/content/birds/test/GUINEAFOWL'. There are 0 directories and 5 images in '/content/birds/test/SUPERB STARLING'. There are 0 directories and 5 images in '/content/birds/test/GILDED FLICKER'. There are 0 directories and 5 images in '/content/birds/test/DOWNY WOODPECKER'. There are 0 directories and 5 images in '/content/birds/test/SHORT BILLED DOWITCHER'. There are 0 directories and 5 images in '/content/birds/test/WOOD DUCK'. There are 0 directories and 5 images in '/content/birds/test/BEARDED BARBET'. There are 0 directories and 5 images in '/content/birds/test/TOUCHAN'. There are 0 directories and 5 images in '/content/birds/test/OKINAWA RAIL'. There are 0 directories and 5 images in '/content/birds/test/CALIFORNIA QUAIL'. There are 0 directories and 5 images in '/content/birds/test/DOUBLE BARRED FINCH'. There are 0 directories and 5 images in '/content/birds/test/BLUE GROUSE'. There are 0 directories and 5 images in '/content/birds/test/GOLDEN CHEEKED WARBLER'. There are 0 directories and 5 images in '/content/birds/test/CRESTED CARACARA'. There are 0 directories and 5 images in '/content/birds/test/HORNED SUNGEM'. There are 0 directories and 5 images in '/content/birds/test/GYRFALCON'. There are 0 directories and 5 images in '/content/birds/test/EURASIAN GOLDEN ORIOLE'. There are 0 directories and 5 images in '/content/birds/test/TOWNSENDS WARBLER'. There are 0 directories and 5 images in '/content/birds/test/TASMANIAN HEN'. There are 0 directories and 5 images in '/content/birds/test/MASKED LAPWING'. There are 0 directories and 5 images in '/content/birds/test/HIMALAYAN MONAL'. There are 0 directories and 5 images in '/content/birds/test/HOOPOES'. There are 0 directories and 5 images in '/content/birds/test/AFRICAN CROWNED CRANE'. There are 0 directories and 5 images in '/content/birds/test/GOLD WING WARBLER'. There are 0 directories and 5 images in '/content/birds/test/RED HEADED DUCK'. There are 0 directories and 5 images in '/content/birds/test/NORTHERN BALD IBIS'. There are 0 directories and 5 images in '/content/birds/test/STORK BILLED KINGFISHER'. There are 0 directories and 5 images in '/content/birds/test/CRESTED AUKLET'. There are 0 directories and 5 images in '/content/birds/test/EMPEROR PENGUIN'. There are 0 directories and 5 images in '/content/birds/test/RED BELLIED PITTA'. There are 0 directories and 5 images in '/content/birds/test/EVENING GROSBEAK'. There are 0 directories and 5 images in '/content/birds/test/GILA WOODPECKER'. There are 0 directories and 5 images in '/content/birds/test/CURL CRESTED ARACURI'. There are 0 directories and 5 images in '/content/birds/test/PAINTED BUNTIG'. There are 0 directories and 5 images in '/content/birds/test/BAR-TAILED GODWIT'. There are 0 directories and 5 images in '/content/birds/test/COMMON LOON'. There are 0 directories and 5 images in '/content/birds/test/CASPIAN TERN'. There are 0 directories and 5 images in '/content/birds/test/INCA TERN'. There are 0 directories and 5 images in '/content/birds/test/BLACK-THROATED SPARROW'. There are 0 directories and 5 images in '/content/birds/test/NORTHERN MOCKINGBIRD'. There are 0 directories and 5 images in '/content/birds/test/BORNEAN BRISTLEHEAD'. There are 0 directories and 5 images in '/content/birds/test/LARK BUNTING'. There are 0 directories and 5 images in '/content/birds/test/INDIGO BUNTING'. There are 0 directories and 5 images in '/content/birds/test/TAIWAN MAGPIE'. There are 0 directories and 5 images in '/content/birds/test/MALACHITE KINGFISHER'. There are 0 directories and 5 images in '/content/birds/test/TAKAHE'. There are 0 directories and 5 images in '/content/birds/test/BALI STARLING'. There are 0 directories and 5 images in '/content/birds/test/HOUSE SPARROW'. There are 0 directories and 5 images in '/content/birds/test/MYNA'. There are 0 directories and 5 images in '/content/birds/test/AMERICAN GOLDFINCH'. There are 0 directories and 5 images in '/content/birds/test/RUBY THROATED HUMMINGBIRD'. There are 0 directories and 5 images in '/content/birds/test/CINNAMON TEAL'. There are 0 directories and 5 images in '/content/birds/test/TIT MOUSE'. There are 0 directories and 5 images in '/content/birds/test/BLACK TAIL CRAKE'. There are 0 directories and 5 images in '/content/birds/test/RED HONEY CREEPER'. There are 0 directories and 5 images in '/content/birds/test/MOURNING DOVE'. There are 0 directories and 5 images in '/content/birds/test/HOATZIN'. There are 0 directories and 5 images in '/content/birds/test/CACTUS WREN'. There are 0 directories and 5 images in '/content/birds/test/NORTHERN FLICKER'. There are 0 directories and 5 images in '/content/birds/test/BOBOLINK'. There are 0 directories and 5 images in '/content/birds/test/VICTORIA CROWNED PIGEON'. There are 0 directories and 5 images in '/content/birds/test/TURQUOISE MOTMOT'. There are 0 directories and 5 images in '/content/birds/test/NOISY FRIARBIRD'. There are 0 directories and 5 images in '/content/birds/test/ROADRUNNER'. There are 0 directories and 5 images in '/content/birds/test/GOLDEN CHLOROPHONIA'. There are 0 directories and 5 images in '/content/birds/test/VARIED THRUSH'. There are 0 directories and 5 images in '/content/birds/test/FIRE TAILLED MYZORNIS'. There are 0 directories and 5 images in '/content/birds/test/NORTHERN SHOVELER'. There are 0 directories and 5 images in '/content/birds/test/RUFOUS KINGFISHER'. There are 0 directories and 5 images in '/content/birds/test/KILLDEAR'. There are 0 directories and 5 images in '/content/birds/test/HORNED GUAN'. There are 0 directories and 5 images in '/content/birds/test/GANG GANG COCKATOO'. There are 0 directories and 5 images in '/content/birds/test/BROWN THRASHER'. There are 0 directories and 5 images in '/content/birds/test/RED BEARDED BEE EATER'. There are 0 directories and 5 images in '/content/birds/test/BLACK & YELLOW bROADBILL'. There are 0 directories and 5 images in '/content/birds/test/SPOONBILL'. There are 0 directories and 5 images in '/content/birds/test/HOODED MERGANSER'. There are 0 directories and 5 images in '/content/birds/test/BEARDED REEDLING'. There are 0 directories and 5 images in '/content/birds/test/LONG-EARED OWL'. There are 0 directories and 5 images in '/content/birds/test/EASTERN MEADOWLARK'. There are 0 directories and 5 images in '/content/birds/test/TEAL DUCK'. There are 0 directories and 5 images in '/content/birds/test/AMERICAN REDSTART'. There are 0 directories and 5 images in '/content/birds/test/CEDAR WAXWING'. There are 0 directories and 5 images in '/content/birds/test/PEACOCK'. There are 0 directories and 5 images in '/content/birds/test/TURKEY VULTURE'. There are 0 directories and 5 images in '/content/birds/test/GREATOR SAGE GROUSE'. There are 0 directories and 5 images in '/content/birds/test/PARUS MAJOR'. There are 0 directories and 5 images in '/content/birds/test/SCARLET IBIS'. There are 0 directories and 5 images in '/content/birds/test/RAINBOW LORIKEET'. There are 0 directories and 5 images in '/content/birds/test/QUETZAL'. There are 275 directories and 0 images in '/content/birds/train'. There are 0 directories and 144 images in '/content/birds/train/SPOON BILED SANDPIPER'. There are 0 directories and 167 images in '/content/birds/train/RED FACED WARBLER'. There are 0 directories and 144 images in '/content/birds/train/UMBRELLA BIRD'. There are 0 directories and 161 images in '/content/birds/train/COMMON POORWILL'. There are 0 directories and 107 images in '/content/birds/train/CROW'. There are 0 directories and 160 images in '/content/birds/train/BALD EAGLE'. There are 0 directories and 124 images in '/content/birds/train/ENGGANO MYNA'. There are 0 directories and 194 images in '/content/birds/train/BANDED BROADBILL'. There are 0 directories and 113 images in '/content/birds/train/GOLDEN PIPIT'. There are 0 directories and 139 images in '/content/birds/train/ANNAS HUMMINGBIRD'. There are 0 directories and 124 images in '/content/birds/train/PUFFIN'. There are 0 directories and 166 images in '/content/birds/train/BANANAQUIT'. There are 0 directories and 120 images in '/content/birds/train/MALEO'. There are 0 directories and 130 images in '/content/birds/train/KAKAPO'. There are 0 directories and 127 images in '/content/birds/train/RED WINGED BLACKBIRD'. There are 0 directories and 112 images in '/content/birds/train/BLACK SWAN'. There are 0 directories and 165 images in '/content/birds/train/ALEXANDRINE PARAKEET'. There are 0 directories and 109 images in '/content/birds/train/CALIFORNIA GULL'. There are 0 directories and 203 images in '/content/birds/train/DARK EYED JUNCO'. There are 0 directories and 105 images in '/content/birds/train/FRIGATE'. There are 0 directories and 129 images in '/content/birds/train/YELLOW BELLIED FLOWERPECKER'. There are 0 directories and 130 images in '/content/birds/train/CHARA DE COLLAR'. There are 0 directories and 207 images in '/content/birds/train/OYSTER CATCHER'. There are 0 directories and 109 images in '/content/birds/train/STEAMER DUCK'. There are 0 directories and 136 images in '/content/birds/train/BARRED PUFFBIRD'. There are 0 directories and 131 images in '/content/birds/train/INDIAN BUSTARD'. There are 0 directories and 112 images in '/content/birds/train/SPANGLED COTINGA'. There are 0 directories and 154 images in '/content/birds/train/PURPLE SWAMPHEN'. There are 0 directories and 118 images in '/content/birds/train/OCELLATED TURKEY'. There are 0 directories and 167 images in '/content/birds/train/STRAWBERRY FINCH'. There are 0 directories and 153 images in '/content/birds/train/CALIFORNIA CONDOR'. There are 0 directories and 155 images in '/content/birds/train/ARARIPE MANAKIN'. There are 0 directories and 130 images in '/content/birds/train/NORTHERN CARDINAL'. There are 0 directories and 128 images in '/content/birds/train/PURPLE GALLINULE'. There are 0 directories and 194 images in '/content/birds/train/RAZORBILL'. There are 0 directories and 147 images in '/content/birds/train/ROBIN'. There are 0 directories and 177 images in '/content/birds/train/COMMON GRACKLE'. There are 0 directories and 153 images in '/content/birds/train/WHITE CHEEKED TURACO'. There are 0 directories and 139 images in '/content/birds/train/ROSY FACED LOVEBIRD'. There are 0 directories and 122 images in '/content/birds/train/BLACK THROATED BUSHTIT'. There are 0 directories and 145 images in '/content/birds/train/CAPE MAY WARBLER'. There are 0 directories and 139 images in '/content/birds/train/COMMON FIRECREST'. There are 0 directories and 140 images in '/content/birds/train/COUCHS KINGBIRD'. There are 0 directories and 105 images in '/content/birds/train/SCARLET MACAW'. There are 0 directories and 133 images in '/content/birds/train/BLACK-CAPPED CHICKADEE'. There are 0 directories and 189 images in '/content/birds/train/RUFUOS MOTMOT'. There are 0 directories and 107 images in '/content/birds/train/HELMET VANGA'. There are 0 directories and 127 images in '/content/birds/train/EASTERN TOWEE'. There are 0 directories and 141 images in '/content/birds/train/COMMON STARLING'. There are 0 directories and 112 images in '/content/birds/train/WHITE NECKED RAVEN'. There are 0 directories and 127 images in '/content/birds/train/ROUGH LEG BUZZARD'. There are 0 directories and 147 images in '/content/birds/train/ANHINGA'. There are 0 directories and 137 images in '/content/birds/train/BALTIMORE ORIOLE'. There are 0 directories and 159 images in '/content/birds/train/YELLOW HEADED BLACKBIRD'. There are 0 directories and 140 images in '/content/birds/train/AFRICAN FIREFINCH'. There are 0 directories and 151 images in '/content/birds/train/SAND MARTIN'. There are 0 directories and 161 images in '/content/birds/train/CLARKS NUTCRACKER'. There are 0 directories and 135 images in '/content/birds/train/NORTHERN RED BISHOP'. There are 0 directories and 138 images in '/content/birds/train/KIWI'. There are 0 directories and 122 images in '/content/birds/train/FLAMINGO'. There are 0 directories and 129 images in '/content/birds/train/BROWN NOODY'. There are 0 directories and 121 images in '/content/birds/train/CARMINE BEE-EATER'. There are 0 directories and 176 images in '/content/birds/train/GREEN MAGPIE'. There are 0 directories and 130 images in '/content/birds/train/PARAKETT AKULET'. There are 0 directories and 134 images in '/content/birds/train/BLACKBURNIAM WARBLER'. There are 0 directories and 103 images in '/content/birds/train/GRAY PARTRIDGE'. There are 0 directories and 126 images in '/content/birds/train/BLACK VULTURE'. There are 0 directories and 176 images in '/content/birds/train/PARADISE TANAGER'. There are 0 directories and 125 images in '/content/birds/train/BELTED KINGFISHER'. There are 0 directories and 123 images in '/content/birds/train/RED WISKERED BULBUL'. There are 0 directories and 122 images in '/content/birds/train/JAVA SPARROW'. There are 0 directories and 116 images in '/content/birds/train/SMITHS LONGSPUR'. There are 0 directories and 132 images in '/content/birds/train/MASKED BOOBY'. There are 0 directories and 168 images in '/content/birds/train/CHUKAR PARTRIDGE'. There are 0 directories and 173 images in '/content/birds/train/PYGMY KINGFISHER'. There are 0 directories and 115 images in '/content/birds/train/CHIPPING SPARROW'. There are 0 directories and 116 images in '/content/birds/train/BORNEAN LEAFBIRD'. There are 0 directories and 142 images in '/content/birds/train/ROYAL FLYCATCHER'. There are 0 directories and 161 images in '/content/birds/train/SNOWY OWL'. There are 0 directories and 127 images in '/content/birds/train/VENEZUELIAN TROUPIAL'. There are 0 directories and 170 images in '/content/birds/train/AMERICAN BITTERN'. There are 0 directories and 130 images in '/content/birds/train/AMERICAN KESTREL'. There are 0 directories and 146 images in '/content/birds/train/MIKADO PHEASANT'. There are 0 directories and 148 images in '/content/birds/train/ELLIOTS PHEASANT'. There are 0 directories and 135 images in '/content/birds/train/MALLARD DUCK'. There are 0 directories and 124 images in '/content/birds/train/COCK OF THE ROCK'. There are 0 directories and 118 images in '/content/birds/train/CROWNED PIGEON'. There are 0 directories and 128 images in '/content/birds/train/BIRD OF PARADISE'. There are 0 directories and 233 images in '/content/birds/train/D-ARNAUDS BARBET'. There are 0 directories and 128 images in '/content/birds/train/SAMATRAN THRUSH'. There are 0 directories and 131 images in '/content/birds/train/LEARS MACAW'. There are 0 directories and 118 images in '/content/birds/train/EASTERN ROSELLA'. There are 0 directories and 217 images in '/content/birds/train/SWINHOES PHEASANT'. There are 0 directories and 128 images in '/content/birds/train/PURPLE FINCH'. There are 0 directories and 127 images in '/content/birds/train/RED FACED CORMORANT'. There are 0 directories and 120 images in '/content/birds/train/GREY PLOVER'. There are 0 directories and 127 images in '/content/birds/train/COMMON HOUSE MARTIN'. There are 0 directories and 111 images in '/content/birds/train/BLACK SKIMMER'. There are 0 directories and 131 images in '/content/birds/train/GO AWAY BIRD'. There are 0 directories and 141 images in '/content/birds/train/RED BROWED FINCH'. There are 0 directories and 136 images in '/content/birds/train/KING VULTURE'. There are 0 directories and 157 images in '/content/birds/train/ASIAN CRESTED IBIS'. There are 0 directories and 103 images in '/content/birds/train/BULWERS PHEASANT'. There are 0 directories and 143 images in '/content/birds/train/BAY-BREASTED WARBLER'. There are 0 directories and 144 images in '/content/birds/train/IMPERIAL SHAQ'. There are 0 directories and 118 images in '/content/birds/train/PELICAN'. There are 0 directories and 162 images in '/content/birds/train/GUINEA TURACO'. There are 0 directories and 155 images in '/content/birds/train/YELLOW CACIQUE'. There are 0 directories and 106 images in '/content/birds/train/EMU'. There are 0 directories and 177 images in '/content/birds/train/FLAME TANAGER'. There are 0 directories and 143 images in '/content/birds/train/JABIRU'. There are 0 directories and 200 images in '/content/birds/train/SORA'. There are 0 directories and 144 images in '/content/birds/train/WILD TURKEY'. There are 0 directories and 137 images in '/content/birds/train/TRUMPTER SWAN'. There are 0 directories and 126 images in '/content/birds/train/WILSONS BIRD OF PARADISE'. There are 0 directories and 132 images in '/content/birds/train/BARN SWALLOW'. There are 0 directories and 155 images in '/content/birds/train/GRAY CATBIRD'. There are 0 directories and 130 images in '/content/birds/train/GOULDIAN FINCH'. There are 0 directories and 158 images in '/content/birds/train/AMERICAN COOT'. There are 0 directories and 163 images in '/content/birds/train/CRESTED NUTHATCH'. There are 0 directories and 128 images in '/content/birds/train/PINK ROBIN'. There are 0 directories and 120 images in '/content/birds/train/STRIPPED SWALLOW'. There are 0 directories and 166 images in '/content/birds/train/COCKATOO'. There are 0 directories and 169 images in '/content/birds/train/VULTURINE GUINEAFOWL'. There are 0 directories and 130 images in '/content/birds/train/MANDRIN DUCK'. There are 0 directories and 167 images in '/content/birds/train/BLUE HERON'. There are 0 directories and 186 images in '/content/birds/train/INDIAN PITTA'. There are 0 directories and 161 images in '/content/birds/train/SRI LANKA BLUE MAGPIE'. There are 0 directories and 147 images in '/content/birds/train/GAMBELS QUAIL'. There are 0 directories and 155 images in '/content/birds/train/EURASIAN MAGPIE'. There are 0 directories and 175 images in '/content/birds/train/GLOSSY IBIS'. There are 0 directories and 135 images in '/content/birds/train/BLACK THROATED WARBLER'. There are 0 directories and 145 images in '/content/birds/train/NORTHERN GANNET'. There are 0 directories and 175 images in '/content/birds/train/HARPY EAGLE'. There are 0 directories and 129 images in '/content/birds/train/NICOBAR PIGEON'. There are 0 directories and 233 images in '/content/birds/train/OVENBIRD'. There are 0 directories and 142 images in '/content/birds/train/MAGPIE GOOSE'. There are 0 directories and 123 images in '/content/birds/train/OSTRICH'. There are 0 directories and 127 images in '/content/birds/train/OSPREY'. There are 0 directories and 132 images in '/content/birds/train/SNOWY EGRET'. There are 0 directories and 123 images in '/content/birds/train/REGENT BOWERBIRD'. There are 0 directories and 144 images in '/content/birds/train/ELEGANT TROGON'. There are 0 directories and 132 images in '/content/birds/train/ROCK DOVE'. There are 0 directories and 112 images in '/content/birds/train/NORTHERN GOSHAWK'. There are 0 directories and 137 images in '/content/birds/train/BLACK-NECKED GREBE'. There are 0 directories and 154 images in '/content/birds/train/PHILIPPINE EAGLE'. There are 0 directories and 113 images in '/content/birds/train/HAWAIIAN GOOSE'. There are 0 directories and 179 images in '/content/birds/train/AMERICAN PIPIT'. There are 0 directories and 133 images in '/content/birds/train/CAPUCHINBIRD'. There are 0 directories and 175 images in '/content/birds/train/SHOEBILL'. There are 0 directories and 133 images in '/content/birds/train/ALBATROSS'. There are 0 directories and 123 images in '/content/birds/train/GOLDEN EAGLE'. There are 0 directories and 119 images in '/content/birds/train/BARN OWL'. There are 0 directories and 156 images in '/content/birds/train/NORTHERN JACANA'. There are 0 directories and 138 images in '/content/birds/train/LILAC ROLLER'. There are 0 directories and 119 images in '/content/birds/train/PALILA'. There are 0 directories and 122 images in '/content/birds/train/CUBAN TODY'. There are 0 directories and 179 images in '/content/birds/train/AMERICAN AVOCET'. There are 0 directories and 150 images in '/content/birds/train/ANTBIRD'. There are 0 directories and 196 images in '/content/birds/train/NORTHERN PARULA'. There are 0 directories and 133 images in '/content/birds/train/RED HEADED WOODPECKER'. There are 0 directories and 160 images in '/content/birds/train/CANARY'. There are 0 directories and 130 images in '/content/birds/train/MALABAR HORNBILL'. There are 0 directories and 175 images in '/content/birds/train/WHITE TAILED TROPIC'. There are 0 directories and 197 images in '/content/birds/train/MARABOU STORK'. There are 0 directories and 122 images in '/content/birds/train/HORNBILL'. There are 0 directories and 138 images in '/content/birds/train/WHIMBREL'. There are 0 directories and 114 images in '/content/birds/train/CASSOWARY'. There are 0 directories and 121 images in '/content/birds/train/SPLENDID WREN'. There are 0 directories and 131 images in '/content/birds/train/BLACK FRANCOLIN'. There are 0 directories and 109 images in '/content/birds/train/PURPLE MARTIN'. There are 0 directories and 138 images in '/content/birds/train/WATTLED CURASSOW'. There are 0 directories and 155 images in '/content/birds/train/VERMILION FLYCATHER'. There are 0 directories and 149 images in '/content/birds/train/WHITE THROATED BEE EATER'. There are 0 directories and 138 images in '/content/birds/train/GREAT POTOO'. There are 0 directories and 130 images in '/content/birds/train/RED TAILED THRUSH'. There are 0 directories and 249 images in '/content/birds/train/HOUSE FINCH'. There are 0 directories and 152 images in '/content/birds/train/RING-NECKED PHEASANT'. There are 0 directories and 143 images in '/content/birds/train/KOOKABURRA'. There are 0 directories and 128 images in '/content/birds/train/EASTERN BLUEBIRD'. There are 0 directories and 181 images in '/content/birds/train/TREE SWALLOW'. There are 0 directories and 107 images in '/content/birds/train/GOLDEN PHEASANT'. There are 0 directories and 126 images in '/content/birds/train/PEREGRINE FALCON'. There are 0 directories and 201 images in '/content/birds/train/VIOLET GREEN SWALLOW'. There are 0 directories and 156 images in '/content/birds/train/GREEN JAY'. There are 0 directories and 138 images in '/content/birds/train/GUINEAFOWL'. There are 0 directories and 144 images in '/content/birds/train/SUPERB STARLING'. There are 0 directories and 138 images in '/content/birds/train/GILDED FLICKER'. There are 0 directories and 127 images in '/content/birds/train/DOWNY WOODPECKER'. There are 0 directories and 164 images in '/content/birds/train/SHORT BILLED DOWITCHER'. There are 0 directories and 214 images in '/content/birds/train/WOOD DUCK'. There are 0 directories and 160 images in '/content/birds/train/BEARDED BARBET'. There are 0 directories and 136 images in '/content/birds/train/TOUCHAN'. There are 0 directories and 107 images in '/content/birds/train/OKINAWA RAIL'. There are 0 directories and 115 images in '/content/birds/train/CALIFORNIA QUAIL'. There are 0 directories and 153 images in '/content/birds/train/DOUBLE BARRED FINCH'. There are 0 directories and 185 images in '/content/birds/train/BLUE GROUSE'. There are 0 directories and 176 images in '/content/birds/train/GOLDEN CHEEKED WARBLER'. There are 0 directories and 146 images in '/content/birds/train/CRESTED CARACARA'. There are 0 directories and 126 images in '/content/birds/train/HORNED SUNGEM'. There are 0 directories and 124 images in '/content/birds/train/GYRFALCON'. There are 0 directories and 135 images in '/content/birds/train/EURASIAN GOLDEN ORIOLE'. There are 0 directories and 165 images in '/content/birds/train/TOWNSENDS WARBLER'. There are 0 directories and 135 images in '/content/birds/train/TASMANIAN HEN'. There are 0 directories and 131 images in '/content/birds/train/MASKED LAPWING'. There are 0 directories and 151 images in '/content/birds/train/HIMALAYAN MONAL'. There are 0 directories and 125 images in '/content/birds/train/HOOPOES'. There are 0 directories and 137 images in '/content/birds/train/AFRICAN CROWNED CRANE'. There are 0 directories and 128 images in '/content/birds/train/GOLD WING WARBLER'. There are 0 directories and 103 images in '/content/birds/train/RED HEADED DUCK'. There are 0 directories and 128 images in '/content/birds/train/NORTHERN BALD IBIS'. There are 0 directories and 135 images in '/content/birds/train/STORK BILLED KINGFISHER'. There are 0 directories and 106 images in '/content/birds/train/CRESTED AUKLET'. There are 0 directories and 129 images in '/content/birds/train/EMPEROR PENGUIN'. There are 0 directories and 151 images in '/content/birds/train/RED BELLIED PITTA'. There are 0 directories and 144 images in '/content/birds/train/EVENING GROSBEAK'. There are 0 directories and 146 images in '/content/birds/train/GILA WOODPECKER'. There are 0 directories and 137 images in '/content/birds/train/CURL CRESTED ARACURI'. There are 0 directories and 163 images in '/content/birds/train/PAINTED BUNTIG'. There are 0 directories and 114 images in '/content/birds/train/BAR-TAILED GODWIT'. There are 0 directories and 109 images in '/content/birds/train/COMMON LOON'. There are 0 directories and 213 images in '/content/birds/train/CASPIAN TERN'. There are 0 directories and 118 images in '/content/birds/train/INCA TERN'. There are 0 directories and 168 images in '/content/birds/train/BLACK-THROATED SPARROW'. There are 0 directories and 140 images in '/content/birds/train/NORTHERN MOCKINGBIRD'. There are 0 directories and 129 images in '/content/birds/train/BORNEAN BRISTLEHEAD'. There are 0 directories and 117 images in '/content/birds/train/LARK BUNTING'. There are 0 directories and 147 images in '/content/birds/train/INDIGO BUNTING'. There are 0 directories and 136 images in '/content/birds/train/TAIWAN MAGPIE'. There are 0 directories and 163 images in '/content/birds/train/MALACHITE KINGFISHER'. There are 0 directories and 108 images in '/content/birds/train/TAKAHE'. There are 0 directories and 132 images in '/content/birds/train/BALI STARLING'. There are 0 directories and 125 images in '/content/birds/train/HOUSE SPARROW'. There are 0 directories and 141 images in '/content/birds/train/MYNA'. There are 0 directories and 133 images in '/content/birds/train/AMERICAN GOLDFINCH'. There are 0 directories and 135 images in '/content/birds/train/RUBY THROATED HUMMINGBIRD'. There are 0 directories and 117 images in '/content/birds/train/CINNAMON TEAL'. There are 0 directories and 146 images in '/content/birds/train/TIT MOUSE'. There are 0 directories and 149 images in '/content/birds/train/BLACK TAIL CRAKE'. There are 0 directories and 132 images in '/content/birds/train/RED HONEY CREEPER'. There are 0 directories and 126 images in '/content/birds/train/MOURNING DOVE'. There are 0 directories and 155 images in '/content/birds/train/HOATZIN'. There are 0 directories and 122 images in '/content/birds/train/CACTUS WREN'. There are 0 directories and 139 images in '/content/birds/train/NORTHERN FLICKER'. There are 0 directories and 157 images in '/content/birds/train/BOBOLINK'. There are 0 directories and 146 images in '/content/birds/train/VICTORIA CROWNED PIGEON'. There are 0 directories and 156 images in '/content/birds/train/TURQUOISE MOTMOT'. There are 0 directories and 157 images in '/content/birds/train/NOISY FRIARBIRD'. There are 0 directories and 107 images in '/content/birds/train/ROADRUNNER'. There are 0 directories and 135 images in '/content/birds/train/GOLDEN CHLOROPHONIA'. There are 0 directories and 193 images in '/content/birds/train/VARIED THRUSH'. There are 0 directories and 150 images in '/content/birds/train/FIRE TAILLED MYZORNIS'. There are 0 directories and 130 images in '/content/birds/train/NORTHERN SHOVELER'. There are 0 directories and 156 images in '/content/birds/train/RUFOUS KINGFISHER'. There are 0 directories and 175 images in '/content/birds/train/KILLDEAR'. There are 0 directories and 113 images in '/content/birds/train/HORNED GUAN'. There are 0 directories and 142 images in '/content/birds/train/GANG GANG COCKATOO'. There are 0 directories and 165 images in '/content/birds/train/BROWN THRASHER'. There are 0 directories and 197 images in '/content/birds/train/RED BEARDED BEE EATER'. There are 0 directories and 142 images in '/content/birds/train/BLACK & YELLOW bROADBILL'. There are 0 directories and 192 images in '/content/birds/train/SPOONBILL'. There are 0 directories and 135 images in '/content/birds/train/HOODED MERGANSER'. There are 0 directories and 144 images in '/content/birds/train/BEARDED REEDLING'. There are 0 directories and 106 images in '/content/birds/train/LONG-EARED OWL'. There are 0 directories and 190 images in '/content/birds/train/EASTERN MEADOWLARK'. There are 0 directories and 159 images in '/content/birds/train/TEAL DUCK'. There are 0 directories and 139 images in '/content/birds/train/AMERICAN REDSTART'. There are 0 directories and 180 images in '/content/birds/train/CEDAR WAXWING'. There are 0 directories and 156 images in '/content/birds/train/PEACOCK'. There are 0 directories and 149 images in '/content/birds/train/TURKEY VULTURE'. There are 0 directories and 184 images in '/content/birds/train/GREATOR SAGE GROUSE'. There are 0 directories and 122 images in '/content/birds/train/PARUS MAJOR'. There are 0 directories and 138 images in '/content/birds/train/SCARLET IBIS'. There are 0 directories and 141 images in '/content/birds/train/RAINBOW LORIKEET'. There are 0 directories and 152 images in '/content/birds/train/QUETZAL'. There are 275 directories and 0 images in '/content/birds/valid'. There are 0 directories and 5 images in '/content/birds/valid/SPOON BILED SANDPIPER'. There are 0 directories and 5 images in '/content/birds/valid/RED FACED WARBLER'. There are 0 directories and 5 images in '/content/birds/valid/UMBRELLA BIRD'. There are 0 directories and 5 images in '/content/birds/valid/COMMON POORWILL'. There are 0 directories and 5 images in '/content/birds/valid/CROW'. There are 0 directories and 5 images in '/content/birds/valid/BALD EAGLE'. There are 0 directories and 5 images in '/content/birds/valid/ENGGANO MYNA'. There are 0 directories and 5 images in '/content/birds/valid/BANDED BROADBILL'. There are 0 directories and 5 images in '/content/birds/valid/GOLDEN PIPIT'. There are 0 directories and 5 images in '/content/birds/valid/ANNAS HUMMINGBIRD'. There are 0 directories and 5 images in '/content/birds/valid/PUFFIN'. There are 0 directories and 5 images in '/content/birds/valid/BANANAQUIT'. There are 0 directories and 5 images in '/content/birds/valid/MALEO'. There are 0 directories and 5 images in '/content/birds/valid/KAKAPO'. There are 0 directories and 5 images in '/content/birds/valid/RED WINGED BLACKBIRD'. There are 0 directories and 5 images in '/content/birds/valid/BLACK SWAN'. There are 0 directories and 5 images in '/content/birds/valid/ALEXANDRINE PARAKEET'. There are 0 directories and 5 images in '/content/birds/valid/CALIFORNIA GULL'. There are 0 directories and 5 images in '/content/birds/valid/DARK EYED JUNCO'. There are 0 directories and 5 images in '/content/birds/valid/FRIGATE'. There are 0 directories and 5 images in '/content/birds/valid/YELLOW BELLIED FLOWERPECKER'. There are 0 directories and 5 images in '/content/birds/valid/CHARA DE COLLAR'. There are 0 directories and 5 images in '/content/birds/valid/OYSTER CATCHER'. There are 0 directories and 5 images in '/content/birds/valid/STEAMER DUCK'. There are 0 directories and 5 images in '/content/birds/valid/BARRED PUFFBIRD'. There are 0 directories and 5 images in '/content/birds/valid/INDIAN BUSTARD'. There are 0 directories and 5 images in '/content/birds/valid/SPANGLED COTINGA'. There are 0 directories and 5 images in '/content/birds/valid/PURPLE SWAMPHEN'. There are 0 directories and 5 images in '/content/birds/valid/OCELLATED TURKEY'. There are 0 directories and 5 images in '/content/birds/valid/STRAWBERRY FINCH'. There are 0 directories and 5 images in '/content/birds/valid/CALIFORNIA CONDOR'. There are 0 directories and 5 images in '/content/birds/valid/ARARIPE MANAKIN'. There are 0 directories and 5 images in '/content/birds/valid/NORTHERN CARDINAL'. There are 0 directories and 5 images in '/content/birds/valid/PURPLE GALLINULE'. There are 0 directories and 5 images in '/content/birds/valid/RAZORBILL'. There are 0 directories and 5 images in '/content/birds/valid/ROBIN'. There are 0 directories and 5 images in '/content/birds/valid/COMMON GRACKLE'. There are 0 directories and 5 images in '/content/birds/valid/WHITE CHEEKED TURACO'. There are 0 directories and 5 images in '/content/birds/valid/ROSY FACED LOVEBIRD'. There are 0 directories and 5 images in '/content/birds/valid/BLACK THROATED BUSHTIT'. There are 0 directories and 5 images in '/content/birds/valid/CAPE MAY WARBLER'. There are 0 directories and 5 images in '/content/birds/valid/COMMON FIRECREST'. There are 0 directories and 5 images in '/content/birds/valid/COUCHS KINGBIRD'. There are 0 directories and 5 images in '/content/birds/valid/SCARLET MACAW'. There are 0 directories and 5 images in '/content/birds/valid/BLACK-CAPPED CHICKADEE'. There are 0 directories and 5 images in '/content/birds/valid/RUFUOS MOTMOT'. There are 0 directories and 5 images in '/content/birds/valid/HELMET VANGA'. There are 0 directories and 5 images in '/content/birds/valid/EASTERN TOWEE'. There are 0 directories and 5 images in '/content/birds/valid/COMMON STARLING'. There are 0 directories and 5 images in '/content/birds/valid/WHITE NECKED RAVEN'. There are 0 directories and 5 images in '/content/birds/valid/ROUGH LEG BUZZARD'. There are 0 directories and 5 images in '/content/birds/valid/ANHINGA'. There are 0 directories and 5 images in '/content/birds/valid/BALTIMORE ORIOLE'. There are 0 directories and 5 images in '/content/birds/valid/YELLOW HEADED BLACKBIRD'. There are 0 directories and 5 images in '/content/birds/valid/AFRICAN FIREFINCH'. There are 0 directories and 5 images in '/content/birds/valid/SAND MARTIN'. There are 0 directories and 5 images in '/content/birds/valid/CLARKS NUTCRACKER'. There are 0 directories and 5 images in '/content/birds/valid/NORTHERN RED BISHOP'. There are 0 directories and 5 images in '/content/birds/valid/KIWI'. There are 0 directories and 5 images in '/content/birds/valid/FLAMINGO'. There are 0 directories and 5 images in '/content/birds/valid/BROWN NOODY'. There are 0 directories and 5 images in '/content/birds/valid/CARMINE BEE-EATER'. There are 0 directories and 5 images in '/content/birds/valid/GREEN MAGPIE'. There are 0 directories and 5 images in '/content/birds/valid/PARAKETT AKULET'. There are 0 directories and 5 images in '/content/birds/valid/BLACKBURNIAM WARBLER'. There are 0 directories and 5 images in '/content/birds/valid/GRAY PARTRIDGE'. There are 0 directories and 5 images in '/content/birds/valid/BLACK VULTURE'. There are 0 directories and 5 images in '/content/birds/valid/PARADISE TANAGER'. There are 0 directories and 5 images in '/content/birds/valid/BELTED KINGFISHER'. There are 0 directories and 5 images in '/content/birds/valid/RED WISKERED BULBUL'. There are 0 directories and 5 images in '/content/birds/valid/JAVA SPARROW'. There are 0 directories and 5 images in '/content/birds/valid/SMITHS LONGSPUR'. There are 0 directories and 5 images in '/content/birds/valid/MASKED BOOBY'. There are 0 directories and 5 images in '/content/birds/valid/CHUKAR PARTRIDGE'. There are 0 directories and 5 images in '/content/birds/valid/PYGMY KINGFISHER'. There are 0 directories and 5 images in '/content/birds/valid/CHIPPING SPARROW'. There are 0 directories and 5 images in '/content/birds/valid/BORNEAN LEAFBIRD'. There are 0 directories and 5 images in '/content/birds/valid/ROYAL FLYCATCHER'. There are 0 directories and 5 images in '/content/birds/valid/SNOWY OWL'. There are 0 directories and 5 images in '/content/birds/valid/VENEZUELIAN TROUPIAL'. There are 0 directories and 5 images in '/content/birds/valid/AMERICAN BITTERN'. There are 0 directories and 5 images in '/content/birds/valid/AMERICAN KESTREL'. There are 0 directories and 5 images in '/content/birds/valid/MIKADO PHEASANT'. There are 0 directories and 5 images in '/content/birds/valid/ELLIOTS PHEASANT'. There are 0 directories and 5 images in '/content/birds/valid/MALLARD DUCK'. There are 0 directories and 5 images in '/content/birds/valid/COCK OF THE ROCK'. There are 0 directories and 5 images in '/content/birds/valid/CROWNED PIGEON'. There are 0 directories and 5 images in '/content/birds/valid/BIRD OF PARADISE'. There are 0 directories and 5 images in '/content/birds/valid/D-ARNAUDS BARBET'. There are 0 directories and 5 images in '/content/birds/valid/SAMATRAN THRUSH'. There are 0 directories and 5 images in '/content/birds/valid/LEARS MACAW'. There are 0 directories and 5 images in '/content/birds/valid/EASTERN ROSELLA'. There are 0 directories and 5 images in '/content/birds/valid/SWINHOES PHEASANT'. There are 0 directories and 5 images in '/content/birds/valid/PURPLE FINCH'. There are 0 directories and 5 images in '/content/birds/valid/RED FACED CORMORANT'. There are 0 directories and 5 images in '/content/birds/valid/GREY PLOVER'. There are 0 directories and 5 images in '/content/birds/valid/COMMON HOUSE MARTIN'. There are 0 directories and 5 images in '/content/birds/valid/BLACK SKIMMER'. There are 0 directories and 5 images in '/content/birds/valid/GO AWAY BIRD'. There are 0 directories and 5 images in '/content/birds/valid/RED BROWED FINCH'. There are 0 directories and 5 images in '/content/birds/valid/KING VULTURE'. There are 0 directories and 5 images in '/content/birds/valid/ASIAN CRESTED IBIS'. There are 0 directories and 5 images in '/content/birds/valid/BULWERS PHEASANT'. There are 0 directories and 5 images in '/content/birds/valid/BAY-BREASTED WARBLER'. There are 0 directories and 5 images in '/content/birds/valid/IMPERIAL SHAQ'. There are 0 directories and 5 images in '/content/birds/valid/PELICAN'. There are 0 directories and 5 images in '/content/birds/valid/GUINEA TURACO'. There are 0 directories and 5 images in '/content/birds/valid/YELLOW CACIQUE'. There are 0 directories and 5 images in '/content/birds/valid/EMU'. There are 0 directories and 5 images in '/content/birds/valid/FLAME TANAGER'. There are 0 directories and 5 images in '/content/birds/valid/JABIRU'. There are 0 directories and 5 images in '/content/birds/valid/SORA'. There are 0 directories and 5 images in '/content/birds/valid/WILD TURKEY'. There are 0 directories and 5 images in '/content/birds/valid/TRUMPTER SWAN'. There are 0 directories and 5 images in '/content/birds/valid/WILSONS BIRD OF PARADISE'. There are 0 directories and 5 images in '/content/birds/valid/BARN SWALLOW'. There are 0 directories and 5 images in '/content/birds/valid/GRAY CATBIRD'. There are 0 directories and 5 images in '/content/birds/valid/GOULDIAN FINCH'. There are 0 directories and 5 images in '/content/birds/valid/AMERICAN COOT'. There are 0 directories and 5 images in '/content/birds/valid/CRESTED NUTHATCH'. There are 0 directories and 5 images in '/content/birds/valid/PINK ROBIN'. There are 0 directories and 5 images in '/content/birds/valid/STRIPPED SWALLOW'. There are 0 directories and 5 images in '/content/birds/valid/COCKATOO'. There are 0 directories and 5 images in '/content/birds/valid/VULTURINE GUINEAFOWL'. There are 0 directories and 5 images in '/content/birds/valid/MANDRIN DUCK'. There are 0 directories and 5 images in '/content/birds/valid/BLUE HERON'. There are 0 directories and 5 images in '/content/birds/valid/INDIAN PITTA'. There are 0 directories and 5 images in '/content/birds/valid/SRI LANKA BLUE MAGPIE'. There are 0 directories and 5 images in '/content/birds/valid/GAMBELS QUAIL'. There are 0 directories and 5 images in '/content/birds/valid/EURASIAN MAGPIE'. There are 0 directories and 5 images in '/content/birds/valid/GLOSSY IBIS'. There are 0 directories and 5 images in '/content/birds/valid/BLACK THROATED WARBLER'. There are 0 directories and 5 images in '/content/birds/valid/NORTHERN GANNET'. There are 0 directories and 5 images in '/content/birds/valid/HARPY EAGLE'. There are 0 directories and 5 images in '/content/birds/valid/NICOBAR PIGEON'. There are 0 directories and 5 images in '/content/birds/valid/OVENBIRD'. There are 0 directories and 5 images in '/content/birds/valid/MAGPIE GOOSE'. There are 0 directories and 5 images in '/content/birds/valid/OSTRICH'. There are 0 directories and 5 images in '/content/birds/valid/OSPREY'. There are 0 directories and 5 images in '/content/birds/valid/SNOWY EGRET'. There are 0 directories and 5 images in '/content/birds/valid/REGENT BOWERBIRD'. There are 0 directories and 5 images in '/content/birds/valid/ELEGANT TROGON'. There are 0 directories and 5 images in '/content/birds/valid/ROCK DOVE'. There are 0 directories and 5 images in '/content/birds/valid/NORTHERN GOSHAWK'. There are 0 directories and 5 images in '/content/birds/valid/BLACK-NECKED GREBE'. There are 0 directories and 5 images in '/content/birds/valid/PHILIPPINE EAGLE'. There are 0 directories and 5 images in '/content/birds/valid/HAWAIIAN GOOSE'. There are 0 directories and 5 images in '/content/birds/valid/AMERICAN PIPIT'. There are 0 directories and 5 images in '/content/birds/valid/CAPUCHINBIRD'. There are 0 directories and 5 images in '/content/birds/valid/SHOEBILL'. There are 0 directories and 5 images in '/content/birds/valid/ALBATROSS'. There are 0 directories and 5 images in '/content/birds/valid/GOLDEN EAGLE'. There are 0 directories and 5 images in '/content/birds/valid/BARN OWL'. There are 0 directories and 5 images in '/content/birds/valid/NORTHERN JACANA'. There are 0 directories and 5 images in '/content/birds/valid/LILAC ROLLER'. There are 0 directories and 5 images in '/content/birds/valid/PALILA'. There are 0 directories and 5 images in '/content/birds/valid/CUBAN TODY'. There are 0 directories and 5 images in '/content/birds/valid/AMERICAN AVOCET'. There are 0 directories and 5 images in '/content/birds/valid/ANTBIRD'. There are 0 directories and 5 images in '/content/birds/valid/NORTHERN PARULA'. There are 0 directories and 5 images in '/content/birds/valid/RED HEADED WOODPECKER'. There are 0 directories and 5 images in '/content/birds/valid/CANARY'. There are 0 directories and 5 images in '/content/birds/valid/MALABAR HORNBILL'. There are 0 directories and 5 images in '/content/birds/valid/WHITE TAILED TROPIC'. There are 0 directories and 5 images in '/content/birds/valid/MARABOU STORK'. There are 0 directories and 5 images in '/content/birds/valid/HORNBILL'. There are 0 directories and 5 images in '/content/birds/valid/WHIMBREL'. There are 0 directories and 5 images in '/content/birds/valid/CASSOWARY'. There are 0 directories and 5 images in '/content/birds/valid/SPLENDID WREN'. There are 0 directories and 5 images in '/content/birds/valid/BLACK FRANCOLIN'. There are 0 directories and 5 images in '/content/birds/valid/PURPLE MARTIN'. There are 0 directories and 5 images in '/content/birds/valid/WATTLED CURASSOW'. There are 0 directories and 5 images in '/content/birds/valid/VERMILION FLYCATHER'. There are 0 directories and 5 images in '/content/birds/valid/WHITE THROATED BEE EATER'. There are 0 directories and 5 images in '/content/birds/valid/GREAT POTOO'. There are 0 directories and 5 images in '/content/birds/valid/RED TAILED THRUSH'. There are 0 directories and 5 images in '/content/birds/valid/HOUSE FINCH'. There are 0 directories and 5 images in '/content/birds/valid/RING-NECKED PHEASANT'. There are 0 directories and 5 images in '/content/birds/valid/KOOKABURRA'. There are 0 directories and 5 images in '/content/birds/valid/EASTERN BLUEBIRD'. There are 0 directories and 5 images in '/content/birds/valid/TREE SWALLOW'. There are 0 directories and 5 images in '/content/birds/valid/GOLDEN PHEASANT'. There are 0 directories and 5 images in '/content/birds/valid/PEREGRINE FALCON'. There are 0 directories and 5 images in '/content/birds/valid/VIOLET GREEN SWALLOW'. There are 0 directories and 5 images in '/content/birds/valid/GREEN JAY'. There are 0 directories and 5 images in '/content/birds/valid/GUINEAFOWL'. There are 0 directories and 5 images in '/content/birds/valid/SUPERB STARLING'. There are 0 directories and 5 images in '/content/birds/valid/GILDED FLICKER'. There are 0 directories and 5 images in '/content/birds/valid/DOWNY WOODPECKER'. There are 0 directories and 5 images in '/content/birds/valid/SHORT BILLED DOWITCHER'. There are 0 directories and 5 images in '/content/birds/valid/WOOD DUCK'. There are 0 directories and 5 images in '/content/birds/valid/BEARDED BARBET'. There are 0 directories and 5 images in '/content/birds/valid/TOUCHAN'. There are 0 directories and 5 images in '/content/birds/valid/OKINAWA RAIL'. There are 0 directories and 5 images in '/content/birds/valid/CALIFORNIA QUAIL'. There are 0 directories and 5 images in '/content/birds/valid/DOUBLE BARRED FINCH'. There are 0 directories and 5 images in '/content/birds/valid/BLUE GROUSE'. There are 0 directories and 5 images in '/content/birds/valid/GOLDEN CHEEKED WARBLER'. There are 0 directories and 5 images in '/content/birds/valid/CRESTED CARACARA'. There are 0 directories and 5 images in '/content/birds/valid/HORNED SUNGEM'. There are 0 directories and 5 images in '/content/birds/valid/GYRFALCON'. There are 0 directories and 5 images in '/content/birds/valid/EURASIAN GOLDEN ORIOLE'. There are 0 directories and 5 images in '/content/birds/valid/TOWNSENDS WARBLER'. There are 0 directories and 5 images in '/content/birds/valid/TASMANIAN HEN'. There are 0 directories and 5 images in '/content/birds/valid/MASKED LAPWING'. There are 0 directories and 5 images in '/content/birds/valid/HIMALAYAN MONAL'. There are 0 directories and 5 images in '/content/birds/valid/HOOPOES'. There are 0 directories and 5 images in '/content/birds/valid/AFRICAN CROWNED CRANE'. There are 0 directories and 5 images in '/content/birds/valid/GOLD WING WARBLER'. There are 0 directories and 5 images in '/content/birds/valid/RED HEADED DUCK'. There are 0 directories and 5 images in '/content/birds/valid/NORTHERN BALD IBIS'. There are 0 directories and 5 images in '/content/birds/valid/STORK BILLED KINGFISHER'. There are 0 directories and 5 images in '/content/birds/valid/CRESTED AUKLET'. There are 0 directories and 5 images in '/content/birds/valid/EMPEROR PENGUIN'. There are 0 directories and 5 images in '/content/birds/valid/RED BELLIED PITTA'. There are 0 directories and 5 images in '/content/birds/valid/EVENING GROSBEAK'. There are 0 directories and 5 images in '/content/birds/valid/GILA WOODPECKER'. There are 0 directories and 5 images in '/content/birds/valid/CURL CRESTED ARACURI'. There are 0 directories and 5 images in '/content/birds/valid/PAINTED BUNTIG'. There are 0 directories and 5 images in '/content/birds/valid/BAR-TAILED GODWIT'. There are 0 directories and 5 images in '/content/birds/valid/COMMON LOON'. There are 0 directories and 5 images in '/content/birds/valid/CASPIAN TERN'. There are 0 directories and 5 images in '/content/birds/valid/INCA TERN'. There are 0 directories and 5 images in '/content/birds/valid/BLACK-THROATED SPARROW'. There are 0 directories and 5 images in '/content/birds/valid/NORTHERN MOCKINGBIRD'. There are 0 directories and 5 images in '/content/birds/valid/BORNEAN BRISTLEHEAD'. There are 0 directories and 5 images in '/content/birds/valid/LARK BUNTING'. There are 0 directories and 5 images in '/content/birds/valid/INDIGO BUNTING'. There are 0 directories and 5 images in '/content/birds/valid/TAIWAN MAGPIE'. There are 0 directories and 5 images in '/content/birds/valid/MALACHITE KINGFISHER'. There are 0 directories and 5 images in '/content/birds/valid/TAKAHE'. There are 0 directories and 5 images in '/content/birds/valid/BALI STARLING'. There are 0 directories and 5 images in '/content/birds/valid/HOUSE SPARROW'. There are 0 directories and 5 images in '/content/birds/valid/MYNA'. There are 0 directories and 5 images in '/content/birds/valid/AMERICAN GOLDFINCH'. There are 0 directories and 5 images in '/content/birds/valid/RUBY THROATED HUMMINGBIRD'. There are 0 directories and 5 images in '/content/birds/valid/CINNAMON TEAL'. There are 0 directories and 5 images in '/content/birds/valid/TIT MOUSE'. There are 0 directories and 5 images in '/content/birds/valid/BLACK TAIL CRAKE'. There are 0 directories and 5 images in '/content/birds/valid/RED HONEY CREEPER'. There are 0 directories and 5 images in '/content/birds/valid/MOURNING DOVE'. There are 0 directories and 5 images in '/content/birds/valid/HOATZIN'. There are 0 directories and 5 images in '/content/birds/valid/CACTUS WREN'. There are 0 directories and 5 images in '/content/birds/valid/NORTHERN FLICKER'. There are 0 directories and 5 images in '/content/birds/valid/BOBOLINK'. There are 0 directories and 5 images in '/content/birds/valid/VICTORIA CROWNED PIGEON'. There are 0 directories and 5 images in '/content/birds/valid/TURQUOISE MOTMOT'. There are 0 directories and 5 images in '/content/birds/valid/NOISY FRIARBIRD'. There are 0 directories and 5 images in '/content/birds/valid/ROADRUNNER'. There are 0 directories and 5 images in '/content/birds/valid/GOLDEN CHLOROPHONIA'. There are 0 directories and 5 images in '/content/birds/valid/VARIED THRUSH'. There are 0 directories and 5 images in '/content/birds/valid/FIRE TAILLED MYZORNIS'. There are 0 directories and 5 images in '/content/birds/valid/NORTHERN SHOVELER'. There are 0 directories and 5 images in '/content/birds/valid/RUFOUS KINGFISHER'. There are 0 directories and 5 images in '/content/birds/valid/KILLDEAR'. There are 0 directories and 5 images in '/content/birds/valid/HORNED GUAN'. There are 0 directories and 5 images in '/content/birds/valid/GANG GANG COCKATOO'. There are 0 directories and 5 images in '/content/birds/valid/BROWN THRASHER'. There are 0 directories and 5 images in '/content/birds/valid/RED BEARDED BEE EATER'. There are 0 directories and 5 images in '/content/birds/valid/BLACK & YELLOW bROADBILL'. There are 0 directories and 5 images in '/content/birds/valid/SPOONBILL'. There are 0 directories and 5 images in '/content/birds/valid/HOODED MERGANSER'. There are 0 directories and 5 images in '/content/birds/valid/BEARDED REEDLING'. There are 0 directories and 5 images in '/content/birds/valid/LONG-EARED OWL'. There are 0 directories and 5 images in '/content/birds/valid/EASTERN MEADOWLARK'. There are 0 directories and 5 images in '/content/birds/valid/TEAL DUCK'. There are 0 directories and 5 images in '/content/birds/valid/AMERICAN REDSTART'. There are 0 directories and 5 images in '/content/birds/valid/CEDAR WAXWING'. There are 0 directories and 5 images in '/content/birds/valid/PEACOCK'. There are 0 directories and 5 images in '/content/birds/valid/TURKEY VULTURE'. There are 0 directories and 5 images in '/content/birds/valid/GREATOR SAGE GROUSE'. There are 0 directories and 5 images in '/content/birds/valid/PARUS MAJOR'. There are 0 directories and 5 images in '/content/birds/valid/SCARLET IBIS'. There are 0 directories and 5 images in '/content/birds/valid/RAINBOW LORIKEET'. There are 0 directories and 5 images in '/content/birds/valid/QUETZAL'.
walk_through_dir("/content/birds/train")
There are 275 directories and 0 images in '/content/birds/train'. There are 0 directories and 144 images in '/content/birds/train/SPOON BILED SANDPIPER'. There are 0 directories and 167 images in '/content/birds/train/RED FACED WARBLER'. There are 0 directories and 144 images in '/content/birds/train/UMBRELLA BIRD'. There are 0 directories and 161 images in '/content/birds/train/COMMON POORWILL'. There are 0 directories and 107 images in '/content/birds/train/CROW'. There are 0 directories and 160 images in '/content/birds/train/BALD EAGLE'. There are 0 directories and 124 images in '/content/birds/train/ENGGANO MYNA'. There are 0 directories and 194 images in '/content/birds/train/BANDED BROADBILL'. There are 0 directories and 113 images in '/content/birds/train/GOLDEN PIPIT'. There are 0 directories and 139 images in '/content/birds/train/ANNAS HUMMINGBIRD'. There are 0 directories and 124 images in '/content/birds/train/PUFFIN'. There are 0 directories and 166 images in '/content/birds/train/BANANAQUIT'. There are 0 directories and 120 images in '/content/birds/train/MALEO'. There are 0 directories and 130 images in '/content/birds/train/KAKAPO'. There are 0 directories and 127 images in '/content/birds/train/RED WINGED BLACKBIRD'. There are 0 directories and 112 images in '/content/birds/train/BLACK SWAN'. There are 0 directories and 165 images in '/content/birds/train/ALEXANDRINE PARAKEET'. There are 0 directories and 109 images in '/content/birds/train/CALIFORNIA GULL'. There are 0 directories and 203 images in '/content/birds/train/DARK EYED JUNCO'. There are 0 directories and 105 images in '/content/birds/train/FRIGATE'. There are 0 directories and 129 images in '/content/birds/train/YELLOW BELLIED FLOWERPECKER'. There are 0 directories and 130 images in '/content/birds/train/CHARA DE COLLAR'. There are 0 directories and 207 images in '/content/birds/train/OYSTER CATCHER'. There are 0 directories and 109 images in '/content/birds/train/STEAMER DUCK'. There are 0 directories and 136 images in '/content/birds/train/BARRED PUFFBIRD'. There are 0 directories and 131 images in '/content/birds/train/INDIAN BUSTARD'. There are 0 directories and 112 images in '/content/birds/train/SPANGLED COTINGA'. There are 0 directories and 154 images in '/content/birds/train/PURPLE SWAMPHEN'. There are 0 directories and 118 images in '/content/birds/train/OCELLATED TURKEY'. There are 0 directories and 167 images in '/content/birds/train/STRAWBERRY FINCH'. There are 0 directories and 153 images in '/content/birds/train/CALIFORNIA CONDOR'. There are 0 directories and 155 images in '/content/birds/train/ARARIPE MANAKIN'. There are 0 directories and 130 images in '/content/birds/train/NORTHERN CARDINAL'. There are 0 directories and 128 images in '/content/birds/train/PURPLE GALLINULE'. There are 0 directories and 194 images in '/content/birds/train/RAZORBILL'. There are 0 directories and 147 images in '/content/birds/train/ROBIN'. There are 0 directories and 177 images in '/content/birds/train/COMMON GRACKLE'. There are 0 directories and 153 images in '/content/birds/train/WHITE CHEEKED TURACO'. There are 0 directories and 139 images in '/content/birds/train/ROSY FACED LOVEBIRD'. There are 0 directories and 122 images in '/content/birds/train/BLACK THROATED BUSHTIT'. There are 0 directories and 145 images in '/content/birds/train/CAPE MAY WARBLER'. There are 0 directories and 139 images in '/content/birds/train/COMMON FIRECREST'. There are 0 directories and 140 images in '/content/birds/train/COUCHS KINGBIRD'. There are 0 directories and 105 images in '/content/birds/train/SCARLET MACAW'. There are 0 directories and 133 images in '/content/birds/train/BLACK-CAPPED CHICKADEE'. There are 0 directories and 189 images in '/content/birds/train/RUFUOS MOTMOT'. There are 0 directories and 107 images in '/content/birds/train/HELMET VANGA'. There are 0 directories and 127 images in '/content/birds/train/EASTERN TOWEE'. There are 0 directories and 141 images in '/content/birds/train/COMMON STARLING'. There are 0 directories and 112 images in '/content/birds/train/WHITE NECKED RAVEN'. There are 0 directories and 127 images in '/content/birds/train/ROUGH LEG BUZZARD'. There are 0 directories and 147 images in '/content/birds/train/ANHINGA'. There are 0 directories and 137 images in '/content/birds/train/BALTIMORE ORIOLE'. There are 0 directories and 159 images in '/content/birds/train/YELLOW HEADED BLACKBIRD'. There are 0 directories and 140 images in '/content/birds/train/AFRICAN FIREFINCH'. There are 0 directories and 151 images in '/content/birds/train/SAND MARTIN'. There are 0 directories and 161 images in '/content/birds/train/CLARKS NUTCRACKER'. There are 0 directories and 135 images in '/content/birds/train/NORTHERN RED BISHOP'. There are 0 directories and 138 images in '/content/birds/train/KIWI'. There are 0 directories and 122 images in '/content/birds/train/FLAMINGO'. There are 0 directories and 129 images in '/content/birds/train/BROWN NOODY'. There are 0 directories and 121 images in '/content/birds/train/CARMINE BEE-EATER'. There are 0 directories and 176 images in '/content/birds/train/GREEN MAGPIE'. There are 0 directories and 130 images in '/content/birds/train/PARAKETT AKULET'. There are 0 directories and 134 images in '/content/birds/train/BLACKBURNIAM WARBLER'. There are 0 directories and 103 images in '/content/birds/train/GRAY PARTRIDGE'. There are 0 directories and 126 images in '/content/birds/train/BLACK VULTURE'. There are 0 directories and 176 images in '/content/birds/train/PARADISE TANAGER'. There are 0 directories and 125 images in '/content/birds/train/BELTED KINGFISHER'. There are 0 directories and 123 images in '/content/birds/train/RED WISKERED BULBUL'. There are 0 directories and 122 images in '/content/birds/train/JAVA SPARROW'. There are 0 directories and 116 images in '/content/birds/train/SMITHS LONGSPUR'. There are 0 directories and 132 images in '/content/birds/train/MASKED BOOBY'. There are 0 directories and 168 images in '/content/birds/train/CHUKAR PARTRIDGE'. There are 0 directories and 173 images in '/content/birds/train/PYGMY KINGFISHER'. There are 0 directories and 115 images in '/content/birds/train/CHIPPING SPARROW'. There are 0 directories and 116 images in '/content/birds/train/BORNEAN LEAFBIRD'. There are 0 directories and 142 images in '/content/birds/train/ROYAL FLYCATCHER'. There are 0 directories and 161 images in '/content/birds/train/SNOWY OWL'. There are 0 directories and 127 images in '/content/birds/train/VENEZUELIAN TROUPIAL'. There are 0 directories and 170 images in '/content/birds/train/AMERICAN BITTERN'. There are 0 directories and 130 images in '/content/birds/train/AMERICAN KESTREL'. There are 0 directories and 146 images in '/content/birds/train/MIKADO PHEASANT'. There are 0 directories and 148 images in '/content/birds/train/ELLIOTS PHEASANT'. There are 0 directories and 135 images in '/content/birds/train/MALLARD DUCK'. There are 0 directories and 124 images in '/content/birds/train/COCK OF THE ROCK'. There are 0 directories and 118 images in '/content/birds/train/CROWNED PIGEON'. There are 0 directories and 128 images in '/content/birds/train/BIRD OF PARADISE'. There are 0 directories and 233 images in '/content/birds/train/D-ARNAUDS BARBET'. There are 0 directories and 128 images in '/content/birds/train/SAMATRAN THRUSH'. There are 0 directories and 131 images in '/content/birds/train/LEARS MACAW'. There are 0 directories and 118 images in '/content/birds/train/EASTERN ROSELLA'. There are 0 directories and 217 images in '/content/birds/train/SWINHOES PHEASANT'. There are 0 directories and 128 images in '/content/birds/train/PURPLE FINCH'. There are 0 directories and 127 images in '/content/birds/train/RED FACED CORMORANT'. There are 0 directories and 120 images in '/content/birds/train/GREY PLOVER'. There are 0 directories and 127 images in '/content/birds/train/COMMON HOUSE MARTIN'. There are 0 directories and 111 images in '/content/birds/train/BLACK SKIMMER'. There are 0 directories and 131 images in '/content/birds/train/GO AWAY BIRD'. There are 0 directories and 141 images in '/content/birds/train/RED BROWED FINCH'. There are 0 directories and 136 images in '/content/birds/train/KING VULTURE'. There are 0 directories and 157 images in '/content/birds/train/ASIAN CRESTED IBIS'. There are 0 directories and 103 images in '/content/birds/train/BULWERS PHEASANT'. There are 0 directories and 143 images in '/content/birds/train/BAY-BREASTED WARBLER'. There are 0 directories and 144 images in '/content/birds/train/IMPERIAL SHAQ'. There are 0 directories and 118 images in '/content/birds/train/PELICAN'. There are 0 directories and 162 images in '/content/birds/train/GUINEA TURACO'. There are 0 directories and 155 images in '/content/birds/train/YELLOW CACIQUE'. There are 0 directories and 106 images in '/content/birds/train/EMU'. There are 0 directories and 177 images in '/content/birds/train/FLAME TANAGER'. There are 0 directories and 143 images in '/content/birds/train/JABIRU'. There are 0 directories and 200 images in '/content/birds/train/SORA'. There are 0 directories and 144 images in '/content/birds/train/WILD TURKEY'. There are 0 directories and 137 images in '/content/birds/train/TRUMPTER SWAN'. There are 0 directories and 126 images in '/content/birds/train/WILSONS BIRD OF PARADISE'. There are 0 directories and 132 images in '/content/birds/train/BARN SWALLOW'. There are 0 directories and 155 images in '/content/birds/train/GRAY CATBIRD'. There are 0 directories and 130 images in '/content/birds/train/GOULDIAN FINCH'. There are 0 directories and 158 images in '/content/birds/train/AMERICAN COOT'. There are 0 directories and 163 images in '/content/birds/train/CRESTED NUTHATCH'. There are 0 directories and 128 images in '/content/birds/train/PINK ROBIN'. There are 0 directories and 120 images in '/content/birds/train/STRIPPED SWALLOW'. There are 0 directories and 166 images in '/content/birds/train/COCKATOO'. There are 0 directories and 169 images in '/content/birds/train/VULTURINE GUINEAFOWL'. There are 0 directories and 130 images in '/content/birds/train/MANDRIN DUCK'. There are 0 directories and 167 images in '/content/birds/train/BLUE HERON'. There are 0 directories and 186 images in '/content/birds/train/INDIAN PITTA'. There are 0 directories and 161 images in '/content/birds/train/SRI LANKA BLUE MAGPIE'. There are 0 directories and 147 images in '/content/birds/train/GAMBELS QUAIL'. There are 0 directories and 155 images in '/content/birds/train/EURASIAN MAGPIE'. There are 0 directories and 175 images in '/content/birds/train/GLOSSY IBIS'. There are 0 directories and 135 images in '/content/birds/train/BLACK THROATED WARBLER'. There are 0 directories and 145 images in '/content/birds/train/NORTHERN GANNET'. There are 0 directories and 175 images in '/content/birds/train/HARPY EAGLE'. There are 0 directories and 129 images in '/content/birds/train/NICOBAR PIGEON'. There are 0 directories and 233 images in '/content/birds/train/OVENBIRD'. There are 0 directories and 142 images in '/content/birds/train/MAGPIE GOOSE'. There are 0 directories and 123 images in '/content/birds/train/OSTRICH'. There are 0 directories and 127 images in '/content/birds/train/OSPREY'. There are 0 directories and 132 images in '/content/birds/train/SNOWY EGRET'. There are 0 directories and 123 images in '/content/birds/train/REGENT BOWERBIRD'. There are 0 directories and 144 images in '/content/birds/train/ELEGANT TROGON'. There are 0 directories and 132 images in '/content/birds/train/ROCK DOVE'. There are 0 directories and 112 images in '/content/birds/train/NORTHERN GOSHAWK'. There are 0 directories and 137 images in '/content/birds/train/BLACK-NECKED GREBE'. There are 0 directories and 154 images in '/content/birds/train/PHILIPPINE EAGLE'. There are 0 directories and 113 images in '/content/birds/train/HAWAIIAN GOOSE'. There are 0 directories and 179 images in '/content/birds/train/AMERICAN PIPIT'. There are 0 directories and 133 images in '/content/birds/train/CAPUCHINBIRD'. There are 0 directories and 175 images in '/content/birds/train/SHOEBILL'. There are 0 directories and 133 images in '/content/birds/train/ALBATROSS'. There are 0 directories and 123 images in '/content/birds/train/GOLDEN EAGLE'. There are 0 directories and 119 images in '/content/birds/train/BARN OWL'. There are 0 directories and 156 images in '/content/birds/train/NORTHERN JACANA'. There are 0 directories and 138 images in '/content/birds/train/LILAC ROLLER'. There are 0 directories and 119 images in '/content/birds/train/PALILA'. There are 0 directories and 122 images in '/content/birds/train/CUBAN TODY'. There are 0 directories and 179 images in '/content/birds/train/AMERICAN AVOCET'. There are 0 directories and 150 images in '/content/birds/train/ANTBIRD'. There are 0 directories and 196 images in '/content/birds/train/NORTHERN PARULA'. There are 0 directories and 133 images in '/content/birds/train/RED HEADED WOODPECKER'. There are 0 directories and 160 images in '/content/birds/train/CANARY'. There are 0 directories and 130 images in '/content/birds/train/MALABAR HORNBILL'. There are 0 directories and 175 images in '/content/birds/train/WHITE TAILED TROPIC'. There are 0 directories and 197 images in '/content/birds/train/MARABOU STORK'. There are 0 directories and 122 images in '/content/birds/train/HORNBILL'. There are 0 directories and 138 images in '/content/birds/train/WHIMBREL'. There are 0 directories and 114 images in '/content/birds/train/CASSOWARY'. There are 0 directories and 121 images in '/content/birds/train/SPLENDID WREN'. There are 0 directories and 131 images in '/content/birds/train/BLACK FRANCOLIN'. There are 0 directories and 109 images in '/content/birds/train/PURPLE MARTIN'. There are 0 directories and 138 images in '/content/birds/train/WATTLED CURASSOW'. There are 0 directories and 155 images in '/content/birds/train/VERMILION FLYCATHER'. There are 0 directories and 149 images in '/content/birds/train/WHITE THROATED BEE EATER'. There are 0 directories and 138 images in '/content/birds/train/GREAT POTOO'. There are 0 directories and 130 images in '/content/birds/train/RED TAILED THRUSH'. There are 0 directories and 249 images in '/content/birds/train/HOUSE FINCH'. There are 0 directories and 152 images in '/content/birds/train/RING-NECKED PHEASANT'. There are 0 directories and 143 images in '/content/birds/train/KOOKABURRA'. There are 0 directories and 128 images in '/content/birds/train/EASTERN BLUEBIRD'. There are 0 directories and 181 images in '/content/birds/train/TREE SWALLOW'. There are 0 directories and 107 images in '/content/birds/train/GOLDEN PHEASANT'. There are 0 directories and 126 images in '/content/birds/train/PEREGRINE FALCON'. There are 0 directories and 201 images in '/content/birds/train/VIOLET GREEN SWALLOW'. There are 0 directories and 156 images in '/content/birds/train/GREEN JAY'. There are 0 directories and 138 images in '/content/birds/train/GUINEAFOWL'. There are 0 directories and 144 images in '/content/birds/train/SUPERB STARLING'. There are 0 directories and 138 images in '/content/birds/train/GILDED FLICKER'. There are 0 directories and 127 images in '/content/birds/train/DOWNY WOODPECKER'. There are 0 directories and 164 images in '/content/birds/train/SHORT BILLED DOWITCHER'. There are 0 directories and 214 images in '/content/birds/train/WOOD DUCK'. There are 0 directories and 160 images in '/content/birds/train/BEARDED BARBET'. There are 0 directories and 136 images in '/content/birds/train/TOUCHAN'. There are 0 directories and 107 images in '/content/birds/train/OKINAWA RAIL'. There are 0 directories and 115 images in '/content/birds/train/CALIFORNIA QUAIL'. There are 0 directories and 153 images in '/content/birds/train/DOUBLE BARRED FINCH'. There are 0 directories and 185 images in '/content/birds/train/BLUE GROUSE'. There are 0 directories and 176 images in '/content/birds/train/GOLDEN CHEEKED WARBLER'. There are 0 directories and 146 images in '/content/birds/train/CRESTED CARACARA'. There are 0 directories and 126 images in '/content/birds/train/HORNED SUNGEM'. There are 0 directories and 124 images in '/content/birds/train/GYRFALCON'. There are 0 directories and 135 images in '/content/birds/train/EURASIAN GOLDEN ORIOLE'. There are 0 directories and 165 images in '/content/birds/train/TOWNSENDS WARBLER'. There are 0 directories and 135 images in '/content/birds/train/TASMANIAN HEN'. There are 0 directories and 131 images in '/content/birds/train/MASKED LAPWING'. There are 0 directories and 151 images in '/content/birds/train/HIMALAYAN MONAL'. There are 0 directories and 125 images in '/content/birds/train/HOOPOES'. There are 0 directories and 137 images in '/content/birds/train/AFRICAN CROWNED CRANE'. There are 0 directories and 128 images in '/content/birds/train/GOLD WING WARBLER'. There are 0 directories and 103 images in '/content/birds/train/RED HEADED DUCK'. There are 0 directories and 128 images in '/content/birds/train/NORTHERN BALD IBIS'. There are 0 directories and 135 images in '/content/birds/train/STORK BILLED KINGFISHER'. There are 0 directories and 106 images in '/content/birds/train/CRESTED AUKLET'. There are 0 directories and 129 images in '/content/birds/train/EMPEROR PENGUIN'. There are 0 directories and 151 images in '/content/birds/train/RED BELLIED PITTA'. There are 0 directories and 144 images in '/content/birds/train/EVENING GROSBEAK'. There are 0 directories and 146 images in '/content/birds/train/GILA WOODPECKER'. There are 0 directories and 137 images in '/content/birds/train/CURL CRESTED ARACURI'. There are 0 directories and 163 images in '/content/birds/train/PAINTED BUNTIG'. There are 0 directories and 114 images in '/content/birds/train/BAR-TAILED GODWIT'. There are 0 directories and 109 images in '/content/birds/train/COMMON LOON'. There are 0 directories and 213 images in '/content/birds/train/CASPIAN TERN'. There are 0 directories and 118 images in '/content/birds/train/INCA TERN'. There are 0 directories and 168 images in '/content/birds/train/BLACK-THROATED SPARROW'. There are 0 directories and 140 images in '/content/birds/train/NORTHERN MOCKINGBIRD'. There are 0 directories and 129 images in '/content/birds/train/BORNEAN BRISTLEHEAD'. There are 0 directories and 117 images in '/content/birds/train/LARK BUNTING'. There are 0 directories and 147 images in '/content/birds/train/INDIGO BUNTING'. There are 0 directories and 136 images in '/content/birds/train/TAIWAN MAGPIE'. There are 0 directories and 163 images in '/content/birds/train/MALACHITE KINGFISHER'. There are 0 directories and 108 images in '/content/birds/train/TAKAHE'. There are 0 directories and 132 images in '/content/birds/train/BALI STARLING'. There are 0 directories and 125 images in '/content/birds/train/HOUSE SPARROW'. There are 0 directories and 141 images in '/content/birds/train/MYNA'. There are 0 directories and 133 images in '/content/birds/train/AMERICAN GOLDFINCH'. There are 0 directories and 135 images in '/content/birds/train/RUBY THROATED HUMMINGBIRD'. There are 0 directories and 117 images in '/content/birds/train/CINNAMON TEAL'. There are 0 directories and 146 images in '/content/birds/train/TIT MOUSE'. There are 0 directories and 149 images in '/content/birds/train/BLACK TAIL CRAKE'. There are 0 directories and 132 images in '/content/birds/train/RED HONEY CREEPER'. There are 0 directories and 126 images in '/content/birds/train/MOURNING DOVE'. There are 0 directories and 155 images in '/content/birds/train/HOATZIN'. There are 0 directories and 122 images in '/content/birds/train/CACTUS WREN'. There are 0 directories and 139 images in '/content/birds/train/NORTHERN FLICKER'. There are 0 directories and 157 images in '/content/birds/train/BOBOLINK'. There are 0 directories and 146 images in '/content/birds/train/VICTORIA CROWNED PIGEON'. There are 0 directories and 156 images in '/content/birds/train/TURQUOISE MOTMOT'. There are 0 directories and 157 images in '/content/birds/train/NOISY FRIARBIRD'. There are 0 directories and 107 images in '/content/birds/train/ROADRUNNER'. There are 0 directories and 135 images in '/content/birds/train/GOLDEN CHLOROPHONIA'. There are 0 directories and 193 images in '/content/birds/train/VARIED THRUSH'. There are 0 directories and 150 images in '/content/birds/train/FIRE TAILLED MYZORNIS'. There are 0 directories and 130 images in '/content/birds/train/NORTHERN SHOVELER'. There are 0 directories and 156 images in '/content/birds/train/RUFOUS KINGFISHER'. There are 0 directories and 175 images in '/content/birds/train/KILLDEAR'. There are 0 directories and 113 images in '/content/birds/train/HORNED GUAN'. There are 0 directories and 142 images in '/content/birds/train/GANG GANG COCKATOO'. There are 0 directories and 165 images in '/content/birds/train/BROWN THRASHER'. There are 0 directories and 197 images in '/content/birds/train/RED BEARDED BEE EATER'. There are 0 directories and 142 images in '/content/birds/train/BLACK & YELLOW bROADBILL'. There are 0 directories and 192 images in '/content/birds/train/SPOONBILL'. There are 0 directories and 135 images in '/content/birds/train/HOODED MERGANSER'. There are 0 directories and 144 images in '/content/birds/train/BEARDED REEDLING'. There are 0 directories and 106 images in '/content/birds/train/LONG-EARED OWL'. There are 0 directories and 190 images in '/content/birds/train/EASTERN MEADOWLARK'. There are 0 directories and 159 images in '/content/birds/train/TEAL DUCK'. There are 0 directories and 139 images in '/content/birds/train/AMERICAN REDSTART'. There are 0 directories and 180 images in '/content/birds/train/CEDAR WAXWING'. There are 0 directories and 156 images in '/content/birds/train/PEACOCK'. There are 0 directories and 149 images in '/content/birds/train/TURKEY VULTURE'. There are 0 directories and 184 images in '/content/birds/train/GREATOR SAGE GROUSE'. There are 0 directories and 122 images in '/content/birds/train/PARUS MAJOR'. There are 0 directories and 138 images in '/content/birds/train/SCARLET IBIS'. There are 0 directories and 141 images in '/content/birds/train/RAINBOW LORIKEET'. There are 0 directories and 152 images in '/content/birds/train/QUETZAL'.
# labels of the images
classes = []
for dir in os.listdir("/content/birds/train/"):
classes.append(dir)
len(classes)
275
Classes¶
classes = np.array(classes)
classes
array(['SPOON BILED SANDPIPER', 'RED FACED WARBLER', 'UMBRELLA BIRD', 'COMMON POORWILL', 'CROW', 'BALD EAGLE', 'ENGGANO MYNA', 'BANDED BROADBILL', 'GOLDEN PIPIT', 'ANNAS HUMMINGBIRD', 'PUFFIN', 'BANANAQUIT', 'MALEO', 'KAKAPO', 'RED WINGED BLACKBIRD', 'BLACK SWAN', 'ALEXANDRINE PARAKEET', 'CALIFORNIA GULL', 'DARK EYED JUNCO', 'FRIGATE', 'YELLOW BELLIED FLOWERPECKER', 'CHARA DE COLLAR', 'OYSTER CATCHER', 'STEAMER DUCK', 'BARRED PUFFBIRD', 'INDIAN BUSTARD', 'SPANGLED COTINGA', 'PURPLE SWAMPHEN', 'OCELLATED TURKEY', 'STRAWBERRY FINCH', 'CALIFORNIA CONDOR', 'ARARIPE MANAKIN', 'NORTHERN CARDINAL', 'PURPLE GALLINULE', 'RAZORBILL', 'ROBIN', 'COMMON GRACKLE', 'WHITE CHEEKED TURACO', 'ROSY FACED LOVEBIRD', 'BLACK THROATED BUSHTIT', 'CAPE MAY WARBLER', 'COMMON FIRECREST', 'COUCHS KINGBIRD', 'SCARLET MACAW', 'BLACK-CAPPED CHICKADEE', 'RUFUOS MOTMOT', 'HELMET VANGA', 'EASTERN TOWEE', 'COMMON STARLING', 'WHITE NECKED RAVEN', 'ROUGH LEG BUZZARD', 'ANHINGA', 'BALTIMORE ORIOLE', 'YELLOW HEADED BLACKBIRD', 'AFRICAN FIREFINCH', 'SAND MARTIN', 'CLARKS NUTCRACKER', 'NORTHERN RED BISHOP', 'KIWI', 'FLAMINGO', 'BROWN NOODY', 'CARMINE BEE-EATER', 'GREEN MAGPIE', 'PARAKETT AKULET', 'BLACKBURNIAM WARBLER', 'GRAY PARTRIDGE', 'BLACK VULTURE', 'PARADISE TANAGER', 'BELTED KINGFISHER', 'RED WISKERED BULBUL', 'JAVA SPARROW', 'SMITHS LONGSPUR', 'MASKED BOOBY', 'CHUKAR PARTRIDGE', 'PYGMY KINGFISHER', 'CHIPPING SPARROW', 'BORNEAN LEAFBIRD', 'ROYAL FLYCATCHER', 'SNOWY OWL', 'VENEZUELIAN TROUPIAL', 'AMERICAN BITTERN', 'AMERICAN KESTREL', 'MIKADO PHEASANT', 'ELLIOTS PHEASANT', 'MALLARD DUCK', 'COCK OF THE ROCK', 'CROWNED PIGEON', 'BIRD OF PARADISE', 'D-ARNAUDS BARBET', 'SAMATRAN THRUSH', 'LEARS MACAW', 'EASTERN ROSELLA', 'SWINHOES PHEASANT', 'PURPLE FINCH', 'RED FACED CORMORANT', 'GREY PLOVER', 'COMMON HOUSE MARTIN', 'BLACK SKIMMER', 'GO AWAY BIRD', 'RED BROWED FINCH', 'KING VULTURE', 'ASIAN CRESTED IBIS', 'BULWERS PHEASANT', 'BAY-BREASTED WARBLER', 'IMPERIAL SHAQ', 'PELICAN', 'GUINEA TURACO', 'YELLOW CACIQUE', 'EMU', 'FLAME TANAGER', 'JABIRU', 'SORA', 'WILD TURKEY', 'TRUMPTER SWAN', 'WILSONS BIRD OF PARADISE', 'BARN SWALLOW', 'GRAY CATBIRD', 'GOULDIAN FINCH', 'AMERICAN COOT', 'CRESTED NUTHATCH', 'PINK ROBIN', 'STRIPPED SWALLOW', 'COCKATOO', 'VULTURINE GUINEAFOWL', 'MANDRIN DUCK', 'BLUE HERON', 'INDIAN PITTA', 'SRI LANKA BLUE MAGPIE', 'GAMBELS QUAIL', 'EURASIAN MAGPIE', 'GLOSSY IBIS', 'BLACK THROATED WARBLER', 'NORTHERN GANNET', 'HARPY EAGLE', 'NICOBAR PIGEON', 'OVENBIRD', 'MAGPIE GOOSE', 'OSTRICH', 'OSPREY', 'SNOWY EGRET', 'REGENT BOWERBIRD', 'ELEGANT TROGON', 'ROCK DOVE', 'NORTHERN GOSHAWK', 'BLACK-NECKED GREBE', 'PHILIPPINE EAGLE', 'HAWAIIAN GOOSE', 'AMERICAN PIPIT', 'CAPUCHINBIRD', 'SHOEBILL', 'ALBATROSS', 'GOLDEN EAGLE', 'BARN OWL', 'NORTHERN JACANA', 'LILAC ROLLER', 'PALILA', 'CUBAN TODY', 'AMERICAN AVOCET', 'ANTBIRD', 'NORTHERN PARULA', 'RED HEADED WOODPECKER', 'CANARY', 'MALABAR HORNBILL', 'WHITE TAILED TROPIC', 'MARABOU STORK', 'HORNBILL', 'WHIMBREL', 'CASSOWARY', 'SPLENDID WREN', 'BLACK FRANCOLIN', 'PURPLE MARTIN', 'WATTLED CURASSOW', 'VERMILION FLYCATHER', 'WHITE THROATED BEE EATER', 'GREAT POTOO', 'RED TAILED THRUSH', 'HOUSE FINCH', 'RING-NECKED PHEASANT', 'KOOKABURRA', 'EASTERN BLUEBIRD', 'TREE SWALLOW', 'GOLDEN PHEASANT', 'PEREGRINE FALCON', 'VIOLET GREEN SWALLOW', 'GREEN JAY', 'GUINEAFOWL', 'SUPERB STARLING', 'GILDED FLICKER', 'DOWNY WOODPECKER', 'SHORT BILLED DOWITCHER', 'WOOD DUCK', 'BEARDED BARBET', 'TOUCHAN', 'OKINAWA RAIL', 'CALIFORNIA QUAIL', 'DOUBLE BARRED FINCH', 'BLUE GROUSE', 'GOLDEN CHEEKED WARBLER', 'CRESTED CARACARA', 'HORNED SUNGEM', 'GYRFALCON', 'EURASIAN GOLDEN ORIOLE', 'TOWNSENDS WARBLER', 'TASMANIAN HEN', 'MASKED LAPWING', 'HIMALAYAN MONAL', 'HOOPOES', 'AFRICAN CROWNED CRANE', 'GOLD WING WARBLER', 'RED HEADED DUCK', 'NORTHERN BALD IBIS', 'STORK BILLED KINGFISHER', 'CRESTED AUKLET', 'EMPEROR PENGUIN', 'RED BELLIED PITTA', 'EVENING GROSBEAK', 'GILA WOODPECKER', 'CURL CRESTED ARACURI', 'PAINTED BUNTIG', 'BAR-TAILED GODWIT', 'COMMON LOON', 'CASPIAN TERN', 'INCA TERN', 'BLACK-THROATED SPARROW', 'NORTHERN MOCKINGBIRD', 'BORNEAN BRISTLEHEAD', 'LARK BUNTING', 'INDIGO BUNTING', 'TAIWAN MAGPIE', 'MALACHITE KINGFISHER', 'TAKAHE', 'BALI STARLING', 'HOUSE SPARROW', 'MYNA', 'AMERICAN GOLDFINCH', 'RUBY THROATED HUMMINGBIRD', 'CINNAMON TEAL', 'TIT MOUSE', 'BLACK TAIL CRAKE', 'RED HONEY CREEPER', 'MOURNING DOVE', 'HOATZIN', 'CACTUS WREN', 'NORTHERN FLICKER', 'BOBOLINK', 'VICTORIA CROWNED PIGEON', 'TURQUOISE MOTMOT', 'NOISY FRIARBIRD', 'ROADRUNNER', 'GOLDEN CHLOROPHONIA', 'VARIED THRUSH', 'FIRE TAILLED MYZORNIS', 'NORTHERN SHOVELER', 'RUFOUS KINGFISHER', 'KILLDEAR', 'HORNED GUAN', 'GANG GANG COCKATOO', 'BROWN THRASHER', 'RED BEARDED BEE EATER', 'BLACK & YELLOW bROADBILL', 'SPOONBILL', 'HOODED MERGANSER', 'BEARDED REEDLING', 'LONG-EARED OWL', 'EASTERN MEADOWLARK', 'TEAL DUCK', 'AMERICAN REDSTART', 'CEDAR WAXWING', 'PEACOCK', 'TURKEY VULTURE', 'GREATOR SAGE GROUSE', 'PARUS MAJOR', 'SCARLET IBIS', 'RAINBOW LORIKEET', 'QUETZAL'], dtype='<U27')
Preprocessing the data¶
# Preprocess img function
IMG_SIZE = (224, 224)
def load_and_prep(filepath):
img_path = tf.io.read_file(filepath)
img = tf.io.decode_image(img_path)
img = tf.image.resize(img, IMG_SIZE)
return img
# Setting up directories
train_dir = "/content/birds/train/"
test_dir = "/content/birds/test/"
# Randomly visualizing images from the train dataset
random_class = random.choice(classes)
random_file_path = train_dir + random_class
random_img_path = random_file_path + "/" + random.choice(os.listdir(random_file_path))
label = random_class
# plotting the image
img = load_and_prep(random_img_path)
plt.imshow(img / 255)
plt.axis(False)
plt.title(label, color="green");
Randomly viualizing multiple images¶
# Randomly visualizing multiple random images from train dataset
plt.figure(figsize=(17, 12))
for i in range(9):
random_class = random.choice(classes)
random_file_path = train_dir + random_class
random_img_path = random_file_path + "/" + random.choice(os.listdir(random_file_path))
label = random_class
# plot
img = load_and_prep(random_img_path)
plt.subplot(3, 3, i+1)
plt.imshow(img / 255.)
plt.axis(False)
plt.title(label, color="green");
# Randomly visualizing multiple random images from test dataset
plt.figure(figsize=(17, 12))
for i in range(9):
random_class = random.choice(classes)
random_file_path = test_dir + random_class
random_img_path = random_file_path + "/" + random.choice(os.listdir(random_file_path))
label = random_class
# Plotting the images
img = load_and_prep(random_img_path)
plt.subplot(3, 3, i+1)
plt.imshow(img / 255.)
plt.axis(False)
plt.title(label, color="green");
Data Augmentation layer¶
# Creating data augmentation layer
data_augmentation = tf.keras.Sequential([
preprocessing.RandomFlip("horizontal"),
preprocessing.RandomRotation(0.2),
preprocessing.RandomZoom(0.2),
preprocessing.RandomHeight(0.2),
preprocessing.RandomWidth(0.2)
], name="data_augmentation_layer")
# Visualizing random augmented image
random_class = random.choice(classes)
random_file_path = train_dir + random_class
random_img_path = random_file_path + "/" + random.choice(os.listdir(random_file_path))
img = load_and_prep(random_img_path)
aug_img = data_augmentation(tf.expand_dims(img, axis=0))
aug_img = tf.image.resize(aug_img[0], IMG_SIZE)
plt.figure(figsize=(10, 7))
# Plotting orignal image
plt.subplot(1, 2, 1)
plt.axis(False)
plt.imshow(img / 255)
plt.title(f"Original Image: {random_class}", color="green")
# Plotting augmented image
plt.subplot(1, 2, 2)
plt.axis(False)
plt.imshow(aug_img / 255)
plt.title(f"Augmented Image: {random_class}", color="blue");
Visualizing multiple augmented images¶
# Visualizing multiple randomly augmented images
plt.figure(figsize=(17, 12))
for i in range(1, 12, 2):
random_class = random.choice(classes)
random_file_path = train_dir + random_class
random_img_path = random_file_path + "/" + random.choice(os.listdir(random_file_path))
img = load_and_prep(random_img_path)
aug_img = data_augmentation(tf.expand_dims(img, axis=0))
aug_img = tf.image.resize(aug_img[0], IMG_SIZE)
# Plotting original image
plt.subplot(3, 4, i)
plt.axis(False)
plt.imshow(img / 255)
plt.title(f"Original Image: \n{random_class}", color="green")
# Plotting augmented image
plt.subplot(3, 4, i+1)
plt.axis(False)
plt.imshow(aug_img / 255)
plt.title(f"Augmented Image: \n{random_class}", color="blue");
# Setting up data generator
data_gen = ImageDataGenerator()
Setting up data¶
# Setting up train test and validation data
train_data = data_gen.flow_from_directory("/content/birds/train",
IMG_SIZE,
seed=42)
valid_data = data_gen.flow_from_directory("/content/birds/valid",
IMG_SIZE,
seed=42)
Found 39364 images belonging to 275 classes. Found 1375 images belonging to 275 classes.
len(train_data), len(valid_data)
(1231, 43)
Model 1¶
# Setting up base model
base_model = tf.keras.applications.EfficientNetB0(include_top=False)
base_model.trainable = False
# Setting input layer
inputs = tf.keras.layers.Input(shape=(224, 224, 3), name="input_layer")
x = data_augmentation(inputs)
x = base_model(x, training=False)
x = tf.keras.layers.GlobalAveragePooling2D(name="global_average_pooling")(x)
outputs = tf.keras.layers.Dense(len(classes), activation="softmax", name="output_layer")(x)
model_1 = tf.keras.Model(inputs, outputs)
# Compiling the model
model_1.compile(loss=tf.keras.losses.categorical_crossentropy,
optimizer=tf.keras.optimizers.Adam(),
metrics=["accuracy"])
# Fitting the model
history_1 = model_1.fit(train_data,
epochs=5,
steps_per_epoch=len(train_data),
validation_data=valid_data,
validation_steps=len(valid_data))
Downloading data from https://storage.googleapis.com/keras-applications/efficientnetb0_notop.h5 16711680/16705208 [==============================] - 0s 0us/step 16719872/16705208 [==============================] - 0s 0us/step Epoch 1/5 1231/1231 [==============================] - 275s 195ms/step - loss: 1.4926 - accuracy: 0.7296 - val_loss: 0.3233 - val_accuracy: 0.9535 Epoch 2/5 1231/1231 [==============================] - 163s 132ms/step - loss: 0.5062 - accuracy: 0.8880 - val_loss: 0.1742 - val_accuracy: 0.9680 Epoch 3/5 1231/1231 [==============================] - 135s 109ms/step - loss: 0.3718 - accuracy: 0.9117 - val_loss: 0.1465 - val_accuracy: 0.9702 Epoch 4/5 1231/1231 [==============================] - 123s 100ms/step - loss: 0.2968 - accuracy: 0.9267 - val_loss: 0.1161 - val_accuracy: 0.9724 Epoch 5/5 1231/1231 [==============================] - 115s 93ms/step - loss: 0.2503 - accuracy: 0.9377 - val_loss: 0.1046 - val_accuracy: 0.9767
Loss curves¶
plot_loss_curves(history_1)
model_1.evaluate(test_data)
43/43 [==============================] - 3s 75ms/step - loss: 0.0913 - accuracy: 0.9811
[0.09126093983650208, 0.9810909032821655]
Saving and loading the model¶
# model_1.save("/content/drive/MyDrive/Bird-Species-Recognition")
model_1 = tf.keras.models.load_model("/content/drive/MyDrive/Bird-Species-Recognition")
WARNING:absl:Importing a function (__inference_block6c_se_reduce_layer_call_and_return_conditional_losses_82846) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block5b_activation_layer_call_and_return_conditional_losses_43957) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block1a_activation_layer_call_and_return_conditional_losses_42562) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6d_expand_activation_layer_call_and_return_conditional_losses_44730) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block4b_activation_layer_call_and_return_conditional_losses_80017) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6a_se_reduce_layer_call_and_return_conditional_losses_82083) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block7a_se_reduce_layer_call_and_return_conditional_losses_83656) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6d_se_reduce_layer_call_and_return_conditional_losses_83251) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block5a_expand_activation_layer_call_and_return_conditional_losses_80734) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block4c_expand_activation_layer_call_and_return_conditional_losses_43626) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block3a_activation_layer_call_and_return_conditional_losses_43029) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block4a_se_reduce_layer_call_and_return_conditional_losses_43384) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block2a_expand_activation_layer_call_and_return_conditional_losses_77974) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference__wrapped_model_34631) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block7a_se_reduce_layer_call_and_return_conditional_losses_44956) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block4a_activation_layer_call_and_return_conditional_losses_43343) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_top_activation_layer_call_and_return_conditional_losses_45037) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block2b_activation_layer_call_and_return_conditional_losses_78447) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block3a_se_reduce_layer_call_and_return_conditional_losses_78940) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block5b_expand_activation_layer_call_and_return_conditional_losses_81092) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6b_se_reduce_layer_call_and_return_conditional_losses_44473) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block7a_activation_layer_call_and_return_conditional_losses_44915) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block3b_activation_layer_call_and_return_conditional_losses_43175) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block5c_expand_activation_layer_call_and_return_conditional_losses_81497) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6b_expand_activation_layer_call_and_return_conditional_losses_44408) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6c_activation_layer_call_and_return_conditional_losses_82780) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6b_se_reduce_layer_call_and_return_conditional_losses_82441) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block2a_se_reduce_layer_call_and_return_conditional_losses_78155) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_efficientnetb0_layer_call_and_return_conditional_losses_75168) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_model_layer_call_and_return_conditional_losses_64914) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block3a_expand_activation_layer_call_and_return_conditional_losses_42998) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block3b_se_reduce_layer_call_and_return_conditional_losses_79298) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6a_activation_layer_call_and_return_conditional_losses_44286) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6a_se_reduce_layer_call_and_return_conditional_losses_44327) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block2b_expand_activation_layer_call_and_return_conditional_losses_42837) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block2b_activation_layer_call_and_return_conditional_losses_42861) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block3b_expand_activation_layer_call_and_return_conditional_losses_43151) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block5b_se_reduce_layer_call_and_return_conditional_losses_43998) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block4a_se_reduce_layer_call_and_return_conditional_losses_79725) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block4b_expand_activation_layer_call_and_return_conditional_losses_79924) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6a_activation_layer_call_and_return_conditional_losses_82017) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block2b_expand_activation_layer_call_and_return_conditional_losses_78354) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block5c_activation_layer_call_and_return_conditional_losses_44118) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block3a_activation_layer_call_and_return_conditional_losses_78874) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block7a_expand_activation_layer_call_and_return_conditional_losses_83497) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block5a_activation_layer_call_and_return_conditional_losses_43811) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block5c_se_reduce_layer_call_and_return_conditional_losses_44159) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block4c_activation_layer_call_and_return_conditional_losses_80422) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6d_activation_layer_call_and_return_conditional_losses_44754) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block5b_expand_activation_layer_call_and_return_conditional_losses_43933) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6c_expand_activation_layer_call_and_return_conditional_losses_82687) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_stem_activation_layer_call_and_return_conditional_losses_77616) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6a_expand_activation_layer_call_and_return_conditional_losses_81902) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_model_layer_call_and_return_conditional_losses_66899) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block5c_activation_layer_call_and_return_conditional_losses_81590) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block4b_se_reduce_layer_call_and_return_conditional_losses_80083) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block2a_activation_layer_call_and_return_conditional_losses_42715) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block2a_expand_activation_layer_call_and_return_conditional_losses_42684) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block3b_expand_activation_layer_call_and_return_conditional_losses_79139) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block4c_se_reduce_layer_call_and_return_conditional_losses_80488) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6c_expand_activation_layer_call_and_return_conditional_losses_44569) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6b_activation_layer_call_and_return_conditional_losses_82375) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_stem_activation_layer_call_and_return_conditional_losses_42538) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block1a_se_reduce_layer_call_and_return_conditional_losses_42603) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block3a_se_reduce_layer_call_and_return_conditional_losses_43070) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block7a_expand_activation_layer_call_and_return_conditional_losses_44891) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block7a_activation_layer_call_and_return_conditional_losses_83590) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block5b_se_reduce_layer_call_and_return_conditional_losses_81251) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block5c_expand_activation_layer_call_and_return_conditional_losses_44094) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block2a_activation_layer_call_and_return_conditional_losses_78089) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block1a_se_reduce_layer_call_and_return_conditional_losses_77775) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block5c_se_reduce_layer_call_and_return_conditional_losses_81656) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block4b_expand_activation_layer_call_and_return_conditional_losses_43465) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_efficientnetb0_layer_call_and_return_conditional_losses_56905) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block4c_activation_layer_call_and_return_conditional_losses_43650) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_top_activation_layer_call_and_return_conditional_losses_83855) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block4c_se_reduce_layer_call_and_return_conditional_losses_43691) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block4a_expand_activation_layer_call_and_return_conditional_losses_43312) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6b_activation_layer_call_and_return_conditional_losses_44432) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block4b_se_reduce_layer_call_and_return_conditional_losses_43530) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block3a_expand_activation_layer_call_and_return_conditional_losses_78759) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6c_activation_layer_call_and_return_conditional_losses_44593) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_efficientnetb0_layer_call_and_return_conditional_losses_71797) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6c_se_reduce_layer_call_and_return_conditional_losses_44634) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block5a_se_reduce_layer_call_and_return_conditional_losses_80893) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block5a_se_reduce_layer_call_and_return_conditional_losses_43852) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block2a_se_reduce_layer_call_and_return_conditional_losses_42756) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block2b_se_reduce_layer_call_and_return_conditional_losses_78513) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6b_expand_activation_layer_call_and_return_conditional_losses_82282) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block5a_activation_layer_call_and_return_conditional_losses_80827) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block3b_se_reduce_layer_call_and_return_conditional_losses_43216) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block2b_se_reduce_layer_call_and_return_conditional_losses_42902) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6d_activation_layer_call_and_return_conditional_losses_83185) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block4c_expand_activation_layer_call_and_return_conditional_losses_80329) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block3b_activation_layer_call_and_return_conditional_losses_79232) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block5a_expand_activation_layer_call_and_return_conditional_losses_43787) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block4b_activation_layer_call_and_return_conditional_losses_43489) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block4a_expand_activation_layer_call_and_return_conditional_losses_79544) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block1a_activation_layer_call_and_return_conditional_losses_77709) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_efficientnetb0_layer_call_and_return_conditional_losses_53230) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6d_se_reduce_layer_call_and_return_conditional_losses_44795) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_efficientnetb0_layer_call_and_return_conditional_losses_76921) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_efficientnetb0_layer_call_and_return_conditional_losses_73550) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6a_expand_activation_layer_call_and_return_conditional_losses_44255) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block6d_expand_activation_layer_call_and_return_conditional_losses_83092) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block5b_activation_layer_call_and_return_conditional_losses_81185) with ops with unsaved custom gradients. Will likely fail if a gradient is requested. WARNING:absl:Importing a function (__inference_block4a_activation_layer_call_and_return_conditional_losses_79659) with ops with unsaved custom gradients. Will likely fail if a gradient is requested.
Working with the test data¶
test_data = data_gen.flow_from_directory("/content/birds/test",
IMG_SIZE,
seed=42)
Found 1375 images belonging to 275 classes.
# setting up test files
test_filepaths = test_data.filepaths
test_filepaths[:20]
['/content/birds/test/AFRICAN CROWNED CRANE/1.jpg', '/content/birds/test/AFRICAN CROWNED CRANE/2.jpg', '/content/birds/test/AFRICAN CROWNED CRANE/3.jpg', '/content/birds/test/AFRICAN CROWNED CRANE/4.jpg', '/content/birds/test/AFRICAN CROWNED CRANE/5.jpg', '/content/birds/test/AFRICAN FIREFINCH/1.jpg', '/content/birds/test/AFRICAN FIREFINCH/2.jpg', '/content/birds/test/AFRICAN FIREFINCH/3.jpg', '/content/birds/test/AFRICAN FIREFINCH/4.jpg', '/content/birds/test/AFRICAN FIREFINCH/5.jpg', '/content/birds/test/ALBATROSS/1.jpg', '/content/birds/test/ALBATROSS/2.jpg', '/content/birds/test/ALBATROSS/3.jpg', '/content/birds/test/ALBATROSS/4.jpg', '/content/birds/test/ALBATROSS/5.jpg', '/content/birds/test/ALEXANDRINE PARAKEET/1.jpg', '/content/birds/test/ALEXANDRINE PARAKEET/2.jpg', '/content/birds/test/ALEXANDRINE PARAKEET/3.jpg', '/content/birds/test/ALEXANDRINE PARAKEET/4.jpg', '/content/birds/test/ALEXANDRINE PARAKEET/5.jpg']
true_test_arr = []
for elem in test_filepaths:
label = elem.split("/")[4]
true_test_labels = true_test_arr.append(label)
true_test_arr[100:125]
['BANDED BROADBILL', 'BANDED BROADBILL', 'BANDED BROADBILL', 'BANDED BROADBILL', 'BANDED BROADBILL', 'BAR-TAILED GODWIT', 'BAR-TAILED GODWIT', 'BAR-TAILED GODWIT', 'BAR-TAILED GODWIT', 'BAR-TAILED GODWIT', 'BARN OWL', 'BARN OWL', 'BARN OWL', 'BARN OWL', 'BARN OWL', 'BARN SWALLOW', 'BARN SWALLOW', 'BARN SWALLOW', 'BARN SWALLOW', 'BARN SWALLOW', 'BARRED PUFFBIRD', 'BARRED PUFFBIRD', 'BARRED PUFFBIRD', 'BARRED PUFFBIRD', 'BARRED PUFFBIRD']
df_test = pd.DataFrame({"filepaths": test_filepaths,
"True labels": true_test_arr})
df_test.head()
filepaths | True labels | |
---|---|---|
0 | /content/birds/test/AFRICAN CROWNED CRANE/1.jpg | AFRICAN CROWNED CRANE |
1 | /content/birds/test/AFRICAN CROWNED CRANE/2.jpg | AFRICAN CROWNED CRANE |
2 | /content/birds/test/AFRICAN CROWNED CRANE/3.jpg | AFRICAN CROWNED CRANE |
3 | /content/birds/test/AFRICAN CROWNED CRANE/4.jpg | AFRICAN CROWNED CRANE |
4 | /content/birds/test/AFRICAN CROWNED CRANE/5.jpg | AFRICAN CROWNED CRANE |
df_test.tail()
filepaths | True labels | |
---|---|---|
1370 | /content/birds/test/YELLOW HEADED BLACKBIRD/1.jpg | YELLOW HEADED BLACKBIRD |
1371 | /content/birds/test/YELLOW HEADED BLACKBIRD/2.jpg | YELLOW HEADED BLACKBIRD |
1372 | /content/birds/test/YELLOW HEADED BLACKBIRD/3.jpg | YELLOW HEADED BLACKBIRD |
1373 | /content/birds/test/YELLOW HEADED BLACKBIRD/4.jpg | YELLOW HEADED BLACKBIRD |
1374 | /content/birds/test/YELLOW HEADED BLACKBIRD/5.jpg | YELLOW HEADED BLACKBIRD |
len(df_test)
1375
test_data_df = data_gen.flow_from_dataframe(df_test,
x_col="filepaths",
y_col="True labels",
shuffle=False)
len(test_data_df)
Found 1375 validated image filenames belonging to 275 classes.
43
Predicting on test data¶
pred_prob = model_1.predict(test_data_df)
pred_prob
array([[9.9941075e-01, 2.9920429e-08, 1.1370213e-08, ..., 3.8718586e-08, 9.1441244e-08, 2.8301442e-10], [9.9973291e-01, 5.9085334e-11, 2.1789726e-09, ..., 1.8176391e-10, 6.7992483e-09, 8.2576126e-11], [9.9978036e-01, 2.6546161e-09, 4.4781725e-09, ..., 4.3104230e-08, 2.6348534e-08, 1.5350127e-08], ..., [2.0982929e-08, 7.5287367e-08, 9.5092023e-10, ..., 3.4542260e-04, 3.2742792e-05, 9.9260145e-01], [5.8194716e-09, 3.6814286e-05, 3.8229541e-07, ..., 2.6979256e-05, 1.5570906e-06, 8.2947415e-01], [4.9322918e-10, 1.5191077e-09, 4.0287357e-11, ..., 6.2447219e-07, 8.6690108e-07, 9.9904555e-01]], dtype=float32)
pred_indices = pred_prob.argmax(axis=1)
pred_indices
array([ 0, 0, 0, ..., 274, 274, 274])
train_data.class_indices
{'AFRICAN CROWNED CRANE': 0, 'AFRICAN FIREFINCH': 1, 'ALBATROSS': 2, 'ALEXANDRINE PARAKEET': 3, 'AMERICAN AVOCET': 4, 'AMERICAN BITTERN': 5, 'AMERICAN COOT': 6, 'AMERICAN GOLDFINCH': 7, 'AMERICAN KESTREL': 8, 'AMERICAN PIPIT': 9, 'AMERICAN REDSTART': 10, 'ANHINGA': 11, 'ANNAS HUMMINGBIRD': 12, 'ANTBIRD': 13, 'ARARIPE MANAKIN': 14, 'ASIAN CRESTED IBIS': 15, 'BALD EAGLE': 16, 'BALI STARLING': 17, 'BALTIMORE ORIOLE': 18, 'BANANAQUIT': 19, 'BANDED BROADBILL': 20, 'BAR-TAILED GODWIT': 21, 'BARN OWL': 22, 'BARN SWALLOW': 23, 'BARRED PUFFBIRD': 24, 'BAY-BREASTED WARBLER': 25, 'BEARDED BARBET': 26, 'BEARDED REEDLING': 27, 'BELTED KINGFISHER': 28, 'BIRD OF PARADISE': 29, 'BLACK & YELLOW bROADBILL': 30, 'BLACK FRANCOLIN': 31, 'BLACK SKIMMER': 32, 'BLACK SWAN': 33, 'BLACK TAIL CRAKE': 34, 'BLACK THROATED BUSHTIT': 35, 'BLACK THROATED WARBLER': 36, 'BLACK VULTURE': 37, 'BLACK-CAPPED CHICKADEE': 38, 'BLACK-NECKED GREBE': 39, 'BLACK-THROATED SPARROW': 40, 'BLACKBURNIAM WARBLER': 41, 'BLUE GROUSE': 42, 'BLUE HERON': 43, 'BOBOLINK': 44, 'BORNEAN BRISTLEHEAD': 45, 'BORNEAN LEAFBIRD': 46, 'BROWN NOODY': 47, 'BROWN THRASHER': 48, 'BULWERS PHEASANT': 49, 'CACTUS WREN': 50, 'CALIFORNIA CONDOR': 51, 'CALIFORNIA GULL': 52, 'CALIFORNIA QUAIL': 53, 'CANARY': 54, 'CAPE MAY WARBLER': 55, 'CAPUCHINBIRD': 56, 'CARMINE BEE-EATER': 57, 'CASPIAN TERN': 58, 'CASSOWARY': 59, 'CEDAR WAXWING': 60, 'CHARA DE COLLAR': 61, 'CHIPPING SPARROW': 62, 'CHUKAR PARTRIDGE': 63, 'CINNAMON TEAL': 64, 'CLARKS NUTCRACKER': 65, 'COCK OF THE ROCK': 66, 'COCKATOO': 67, 'COMMON FIRECREST': 68, 'COMMON GRACKLE': 69, 'COMMON HOUSE MARTIN': 70, 'COMMON LOON': 71, 'COMMON POORWILL': 72, 'COMMON STARLING': 73, 'COUCHS KINGBIRD': 74, 'CRESTED AUKLET': 75, 'CRESTED CARACARA': 76, 'CRESTED NUTHATCH': 77, 'CROW': 78, 'CROWNED PIGEON': 79, 'CUBAN TODY': 80, 'CURL CRESTED ARACURI': 81, 'D-ARNAUDS BARBET': 82, 'DARK EYED JUNCO': 83, 'DOUBLE BARRED FINCH': 84, 'DOWNY WOODPECKER': 85, 'EASTERN BLUEBIRD': 86, 'EASTERN MEADOWLARK': 87, 'EASTERN ROSELLA': 88, 'EASTERN TOWEE': 89, 'ELEGANT TROGON': 90, 'ELLIOTS PHEASANT': 91, 'EMPEROR PENGUIN': 92, 'EMU': 93, 'ENGGANO MYNA': 94, 'EURASIAN GOLDEN ORIOLE': 95, 'EURASIAN MAGPIE': 96, 'EVENING GROSBEAK': 97, 'FIRE TAILLED MYZORNIS': 98, 'FLAME TANAGER': 99, 'FLAMINGO': 100, 'FRIGATE': 101, 'GAMBELS QUAIL': 102, 'GANG GANG COCKATOO': 103, 'GILA WOODPECKER': 104, 'GILDED FLICKER': 105, 'GLOSSY IBIS': 106, 'GO AWAY BIRD': 107, 'GOLD WING WARBLER': 108, 'GOLDEN CHEEKED WARBLER': 109, 'GOLDEN CHLOROPHONIA': 110, 'GOLDEN EAGLE': 111, 'GOLDEN PHEASANT': 112, 'GOLDEN PIPIT': 113, 'GOULDIAN FINCH': 114, 'GRAY CATBIRD': 115, 'GRAY PARTRIDGE': 116, 'GREAT POTOO': 117, 'GREATOR SAGE GROUSE': 118, 'GREEN JAY': 119, 'GREEN MAGPIE': 120, 'GREY PLOVER': 121, 'GUINEA TURACO': 122, 'GUINEAFOWL': 123, 'GYRFALCON': 124, 'HARPY EAGLE': 125, 'HAWAIIAN GOOSE': 126, 'HELMET VANGA': 127, 'HIMALAYAN MONAL': 128, 'HOATZIN': 129, 'HOODED MERGANSER': 130, 'HOOPOES': 131, 'HORNBILL': 132, 'HORNED GUAN': 133, 'HORNED SUNGEM': 134, 'HOUSE FINCH': 135, 'HOUSE SPARROW': 136, 'IMPERIAL SHAQ': 137, 'INCA TERN': 138, 'INDIAN BUSTARD': 139, 'INDIAN PITTA': 140, 'INDIGO BUNTING': 141, 'JABIRU': 142, 'JAVA SPARROW': 143, 'KAKAPO': 144, 'KILLDEAR': 145, 'KING VULTURE': 146, 'KIWI': 147, 'KOOKABURRA': 148, 'LARK BUNTING': 149, 'LEARS MACAW': 150, 'LILAC ROLLER': 151, 'LONG-EARED OWL': 152, 'MAGPIE GOOSE': 153, 'MALABAR HORNBILL': 154, 'MALACHITE KINGFISHER': 155, 'MALEO': 156, 'MALLARD DUCK': 157, 'MANDRIN DUCK': 158, 'MARABOU STORK': 159, 'MASKED BOOBY': 160, 'MASKED LAPWING': 161, 'MIKADO PHEASANT': 162, 'MOURNING DOVE': 163, 'MYNA': 164, 'NICOBAR PIGEON': 165, 'NOISY FRIARBIRD': 166, 'NORTHERN BALD IBIS': 167, 'NORTHERN CARDINAL': 168, 'NORTHERN FLICKER': 169, 'NORTHERN GANNET': 170, 'NORTHERN GOSHAWK': 171, 'NORTHERN JACANA': 172, 'NORTHERN MOCKINGBIRD': 173, 'NORTHERN PARULA': 174, 'NORTHERN RED BISHOP': 175, 'NORTHERN SHOVELER': 176, 'OCELLATED TURKEY': 177, 'OKINAWA RAIL': 178, 'OSPREY': 179, 'OSTRICH': 180, 'OVENBIRD': 181, 'OYSTER CATCHER': 182, 'PAINTED BUNTIG': 183, 'PALILA': 184, 'PARADISE TANAGER': 185, 'PARAKETT AKULET': 186, 'PARUS MAJOR': 187, 'PEACOCK': 188, 'PELICAN': 189, 'PEREGRINE FALCON': 190, 'PHILIPPINE EAGLE': 191, 'PINK ROBIN': 192, 'PUFFIN': 193, 'PURPLE FINCH': 194, 'PURPLE GALLINULE': 195, 'PURPLE MARTIN': 196, 'PURPLE SWAMPHEN': 197, 'PYGMY KINGFISHER': 198, 'QUETZAL': 199, 'RAINBOW LORIKEET': 200, 'RAZORBILL': 201, 'RED BEARDED BEE EATER': 202, 'RED BELLIED PITTA': 203, 'RED BROWED FINCH': 204, 'RED FACED CORMORANT': 205, 'RED FACED WARBLER': 206, 'RED HEADED DUCK': 207, 'RED HEADED WOODPECKER': 208, 'RED HONEY CREEPER': 209, 'RED TAILED THRUSH': 210, 'RED WINGED BLACKBIRD': 211, 'RED WISKERED BULBUL': 212, 'REGENT BOWERBIRD': 213, 'RING-NECKED PHEASANT': 214, 'ROADRUNNER': 215, 'ROBIN': 216, 'ROCK DOVE': 217, 'ROSY FACED LOVEBIRD': 218, 'ROUGH LEG BUZZARD': 219, 'ROYAL FLYCATCHER': 220, 'RUBY THROATED HUMMINGBIRD': 221, 'RUFOUS KINGFISHER': 222, 'RUFUOS MOTMOT': 223, 'SAMATRAN THRUSH': 224, 'SAND MARTIN': 225, 'SCARLET IBIS': 226, 'SCARLET MACAW': 227, 'SHOEBILL': 228, 'SHORT BILLED DOWITCHER': 229, 'SMITHS LONGSPUR': 230, 'SNOWY EGRET': 231, 'SNOWY OWL': 232, 'SORA': 233, 'SPANGLED COTINGA': 234, 'SPLENDID WREN': 235, 'SPOON BILED SANDPIPER': 236, 'SPOONBILL': 237, 'SRI LANKA BLUE MAGPIE': 238, 'STEAMER DUCK': 239, 'STORK BILLED KINGFISHER': 240, 'STRAWBERRY FINCH': 241, 'STRIPPED SWALLOW': 242, 'SUPERB STARLING': 243, 'SWINHOES PHEASANT': 244, 'TAIWAN MAGPIE': 245, 'TAKAHE': 246, 'TASMANIAN HEN': 247, 'TEAL DUCK': 248, 'TIT MOUSE': 249, 'TOUCHAN': 250, 'TOWNSENDS WARBLER': 251, 'TREE SWALLOW': 252, 'TRUMPTER SWAN': 253, 'TURKEY VULTURE': 254, 'TURQUOISE MOTMOT': 255, 'UMBRELLA BIRD': 256, 'VARIED THRUSH': 257, 'VENEZUELIAN TROUPIAL': 258, 'VERMILION FLYCATHER': 259, 'VICTORIA CROWNED PIGEON': 260, 'VIOLET GREEN SWALLOW': 261, 'VULTURINE GUINEAFOWL': 262, 'WATTLED CURASSOW': 263, 'WHIMBREL': 264, 'WHITE CHEEKED TURACO': 265, 'WHITE NECKED RAVEN': 266, 'WHITE TAILED TROPIC': 267, 'WHITE THROATED BEE EATER': 268, 'WILD TURKEY': 269, 'WILSONS BIRD OF PARADISE': 270, 'WOOD DUCK': 271, 'YELLOW BELLIED FLOWERPECKER': 272, 'YELLOW CACIQUE': 273, 'YELLOW HEADED BLACKBIRD': 274}
labels = []
for elem in train_data.class_indices.keys():
labels.append(elem)
labels[:10]
['AFRICAN CROWNED CRANE', 'AFRICAN FIREFINCH', 'ALBATROSS', 'ALEXANDRINE PARAKEET', 'AMERICAN AVOCET', 'AMERICAN BITTERN', 'AMERICAN COOT', 'AMERICAN GOLDFINCH', 'AMERICAN KESTREL', 'AMERICAN PIPIT']
pred_labels = []
for index in pred_indices:
pred_labels.append(labels[index])
pred_labels[:5]
['AFRICAN CROWNED CRANE', 'AFRICAN CROWNED CRANE', 'AFRICAN CROWNED CRANE', 'AFRICAN CROWNED CRANE', 'AFRICAN CROWNED CRANE']
df_test = pd.DataFrame({"filepaths": test_filepaths,
"True labels": true_test_arr,
"Pred labels": pred_labels})
df_test.head()
filepaths | True labels | Pred labels | |
---|---|---|---|
0 | /content/birds/test/AFRICAN CROWNED CRANE/1.jpg | AFRICAN CROWNED CRANE | AFRICAN CROWNED CRANE |
1 | /content/birds/test/AFRICAN CROWNED CRANE/2.jpg | AFRICAN CROWNED CRANE | AFRICAN CROWNED CRANE |
2 | /content/birds/test/AFRICAN CROWNED CRANE/3.jpg | AFRICAN CROWNED CRANE | AFRICAN CROWNED CRANE |
3 | /content/birds/test/AFRICAN CROWNED CRANE/4.jpg | AFRICAN CROWNED CRANE | AFRICAN CROWNED CRANE |
4 | /content/birds/test/AFRICAN CROWNED CRANE/5.jpg | AFRICAN CROWNED CRANE | AFRICAN CROWNED CRANE |
df_test[:50]
filepaths | True labels | Pred labels | |
---|---|---|---|
0 | /content/birds/test/AFRICAN CROWNED CRANE/1.jpg | AFRICAN CROWNED CRANE | AFRICAN CROWNED CRANE |
1 | /content/birds/test/AFRICAN CROWNED CRANE/2.jpg | AFRICAN CROWNED CRANE | AFRICAN CROWNED CRANE |
2 | /content/birds/test/AFRICAN CROWNED CRANE/3.jpg | AFRICAN CROWNED CRANE | AFRICAN CROWNED CRANE |
3 | /content/birds/test/AFRICAN CROWNED CRANE/4.jpg | AFRICAN CROWNED CRANE | AFRICAN CROWNED CRANE |
4 | /content/birds/test/AFRICAN CROWNED CRANE/5.jpg | AFRICAN CROWNED CRANE | AFRICAN CROWNED CRANE |
5 | /content/birds/test/AFRICAN FIREFINCH/1.jpg | AFRICAN FIREFINCH | AFRICAN FIREFINCH |
6 | /content/birds/test/AFRICAN FIREFINCH/2.jpg | AFRICAN FIREFINCH | AFRICAN FIREFINCH |
7 | /content/birds/test/AFRICAN FIREFINCH/3.jpg | AFRICAN FIREFINCH | AFRICAN FIREFINCH |
8 | /content/birds/test/AFRICAN FIREFINCH/4.jpg | AFRICAN FIREFINCH | AFRICAN FIREFINCH |
9 | /content/birds/test/AFRICAN FIREFINCH/5.jpg | AFRICAN FIREFINCH | AFRICAN FIREFINCH |
10 | /content/birds/test/ALBATROSS/1.jpg | ALBATROSS | ALBATROSS |
11 | /content/birds/test/ALBATROSS/2.jpg | ALBATROSS | ALBATROSS |
12 | /content/birds/test/ALBATROSS/3.jpg | ALBATROSS | ALBATROSS |
13 | /content/birds/test/ALBATROSS/4.jpg | ALBATROSS | ALBATROSS |
14 | /content/birds/test/ALBATROSS/5.jpg | ALBATROSS | ALBATROSS |
15 | /content/birds/test/ALEXANDRINE PARAKEET/1.jpg | ALEXANDRINE PARAKEET | ALEXANDRINE PARAKEET |
16 | /content/birds/test/ALEXANDRINE PARAKEET/2.jpg | ALEXANDRINE PARAKEET | ALEXANDRINE PARAKEET |
17 | /content/birds/test/ALEXANDRINE PARAKEET/3.jpg | ALEXANDRINE PARAKEET | ALEXANDRINE PARAKEET |
18 | /content/birds/test/ALEXANDRINE PARAKEET/4.jpg | ALEXANDRINE PARAKEET | ALEXANDRINE PARAKEET |
19 | /content/birds/test/ALEXANDRINE PARAKEET/5.jpg | ALEXANDRINE PARAKEET | ALEXANDRINE PARAKEET |
20 | /content/birds/test/AMERICAN AVOCET/1.jpg | AMERICAN AVOCET | AMERICAN AVOCET |
21 | /content/birds/test/AMERICAN AVOCET/2.jpg | AMERICAN AVOCET | AMERICAN AVOCET |
22 | /content/birds/test/AMERICAN AVOCET/3.jpg | AMERICAN AVOCET | AMERICAN AVOCET |
23 | /content/birds/test/AMERICAN AVOCET/4.jpg | AMERICAN AVOCET | AMERICAN AVOCET |
24 | /content/birds/test/AMERICAN AVOCET/5.jpg | AMERICAN AVOCET | AMERICAN AVOCET |
25 | /content/birds/test/AMERICAN BITTERN/1.jpg | AMERICAN BITTERN | AMERICAN BITTERN |
26 | /content/birds/test/AMERICAN BITTERN/2.jpg | AMERICAN BITTERN | AMERICAN BITTERN |
27 | /content/birds/test/AMERICAN BITTERN/3.jpg | AMERICAN BITTERN | AMERICAN BITTERN |
28 | /content/birds/test/AMERICAN BITTERN/4.jpg | AMERICAN BITTERN | AMERICAN BITTERN |
29 | /content/birds/test/AMERICAN BITTERN/5.jpg | AMERICAN BITTERN | AMERICAN BITTERN |
30 | /content/birds/test/AMERICAN COOT/1.jpg | AMERICAN COOT | AMERICAN COOT |
31 | /content/birds/test/AMERICAN COOT/2.jpg | AMERICAN COOT | AMERICAN COOT |
32 | /content/birds/test/AMERICAN COOT/3.jpg | AMERICAN COOT | AMERICAN COOT |
33 | /content/birds/test/AMERICAN COOT/4.jpg | AMERICAN COOT | AMERICAN COOT |
34 | /content/birds/test/AMERICAN COOT/5.jpg | AMERICAN COOT | AMERICAN COOT |
35 | /content/birds/test/AMERICAN GOLDFINCH/1.jpg | AMERICAN GOLDFINCH | AMERICAN GOLDFINCH |
36 | /content/birds/test/AMERICAN GOLDFINCH/2.jpg | AMERICAN GOLDFINCH | AMERICAN GOLDFINCH |
37 | /content/birds/test/AMERICAN GOLDFINCH/3.jpg | AMERICAN GOLDFINCH | AMERICAN GOLDFINCH |
38 | /content/birds/test/AMERICAN GOLDFINCH/4.jpg | AMERICAN GOLDFINCH | AMERICAN GOLDFINCH |
39 | /content/birds/test/AMERICAN GOLDFINCH/5.jpg | AMERICAN GOLDFINCH | AMERICAN GOLDFINCH |
40 | /content/birds/test/AMERICAN KESTREL/1.jpg | AMERICAN KESTREL | AMERICAN KESTREL |
41 | /content/birds/test/AMERICAN KESTREL/2.jpg | AMERICAN KESTREL | AMERICAN KESTREL |
42 | /content/birds/test/AMERICAN KESTREL/3.jpg | AMERICAN KESTREL | AMERICAN KESTREL |
43 | /content/birds/test/AMERICAN KESTREL/4.jpg | AMERICAN KESTREL | AMERICAN KESTREL |
44 | /content/birds/test/AMERICAN KESTREL/5.jpg | AMERICAN KESTREL | AMERICAN KESTREL |
45 | /content/birds/test/AMERICAN PIPIT/1.jpg | AMERICAN PIPIT | AMERICAN PIPIT |
46 | /content/birds/test/AMERICAN PIPIT/2.jpg | AMERICAN PIPIT | AMERICAN PIPIT |
47 | /content/birds/test/AMERICAN PIPIT/3.jpg | AMERICAN PIPIT | AMERICAN PIPIT |
48 | /content/birds/test/AMERICAN PIPIT/4.jpg | AMERICAN PIPIT | AMERICAN PIPIT |
49 | /content/birds/test/AMERICAN PIPIT/5.jpg | AMERICAN PIPIT | AMERICAN PIPIT |
df_test.to_csv("test-paths.csv")
To visualize confusion graph¶
fp = "/content/birds/test/ALBATROSS/2.jpg"
fp1 = "/content/birds/test/BLUE HERON/3.jpg"
fp2 = "/content/birds/test/ANHINGA/3.jpg"
img = load_and_prep(fp1) # Change filepath
pred = model_1.predict(tf.expand_dims(img, axis=0))
labels_ = np.array(labels)
# Find the top 10 prediction confidence indexes
top_10_pred_indexes = pred[0].argsort()[-10:][::-1]
# Find the top 10 prediction confidence values
top_10_pred_values = pred[0][top_10_pred_indexes]
# Find the top 10 prediction labels
top_10_pred_labels = labels_[top_10_pred_indexes]
pred_label = labels[int(pred.argmax(axis=1))]
true_label = fp1.split("/")[4] # Change filepath
# Setup plot
top_plot = plt.bar(np.arange(len(top_10_pred_labels)),
top_10_pred_values,
color="grey")
plt.xticks(np.arange(len(top_10_pred_labels)),
labels=top_10_pred_labels,
rotation="vertical")
# Change color of true label
if np.isin(true_label, top_10_pred_labels):
top_plot[np.argmax(top_10_pred_labels == true_label)].set_color("green")
else:
pass
Function for confusion graph¶
# Creating a function for the same we did above
def pred_plot_conf(filepath, model=model_1, labels=labels):
"""
Plots the top 10 highest prediction confidences along with
the truth label for the given filepath.
"""
# getting the variables ready
img = load_and_prep(filepath)
pred = model.predict(tf.expand_dims(img, axis=0))
labels_ = np.array(labels)
# Find the top 10 prediction confidence indexes
top_10_pred_indexes = pred[0].argsort()[-10:][::-1]
# Find the top 10 prediction confidence values
top_10_pred_values = pred[0][top_10_pred_indexes]
# Find the top 10 prediction labels
top_10_pred_labels = labels_[top_10_pred_indexes]
# labels
pred_label = labels[int(pred.argmax(axis=1))]
true_label = filepath.split("/")[4]
# Setup plot
top_plot = plt.bar(np.arange(len(top_10_pred_labels)),
top_10_pred_values,
color="grey")
plt.xticks(np.arange(len(top_10_pred_labels)),
labels=top_10_pred_labels,
rotation="vertical")
# Change color of true label
if np.isin(true_label, top_10_pred_labels):
top_plot[np.argmax(top_10_pred_labels == true_label)].set_color("green")
else:
pass
# Checking the function
fp = "/content/birds/test/ALBATROSS/2.jpg"
pred_plot_conf(fp)
Insights with confusion graph¶
Plotting image with confusion graph, predictions, actual label and prediction probability.
# Plotting image with conf graph
random_test_fp = random.choice(test_filepaths)
img = load_and_prep(random_test_fp)
pred = model_1.predict(tf.expand_dims(img, axis=0))
labels_ = np.array(labels)
prediction_prob = f"{pred.max() * 100:.2f}"
pred_label = labels[int(pred.argmax(axis=1))]
true_label = random_test_fp.split("/")[4]
plt.figure(figsize=(11, 5))
# Plotting the image
plt.subplot(1, 2, 1)
plt.imshow(img/255)
plt.axis(False)
c = "green" if true_label == pred_label else "red"
plt.title(f"Actual: {true_label} \nPred: {pred_label}, Prob: {prediction_prob}%", color=c);
# Plotting the confusion graph
plt.subplot(1, 2, 2)
pred_plot_conf(random_test_fp)
plt.title(f"Confusion graph for: \n{true_label}", color="blue");
# Functionalizing the above plot
def plot_img_conf(filepath, model=model_1, label=labels):
"""
Plots the confusion graph and image along with
prediction probabilites.
"""
img = load_and_prep(filepath)
pred = model.predict(tf.expand_dims(img, axis=0))
labels_ = np.array(labels)
prediction_prob = f"{pred.max() * 100:.2f}"
pred_label = labels[int(pred.argmax(axis=1))]
true_label = filepath.split("/")[4]
plt.figure(figsize=(11, 5))
# Plotting the image
plt.subplot(1, 2, 1)
plt.imshow(img/255)
plt.axis(False)
c = "green" if true_label == pred_label else "red"
plt.title(f"Actual: {true_label} \nPred: {pred_label}, Prob: {prediction_prob}%", color=c)
# Plotting the confusion graph
plt.subplot(1, 2, 2)
pred_plot_conf(filepath)
plt.title(f"Confusion graph for: \n{true_label}", color="blue");
# Checking the function
plot_img_conf(fp1)
def img_pred(filepath, model=model_1, labels=labels):
"""
plots the image with actual class, pred class
and pred probability
"""
img = load_and_prep(filepath)
pred = model.predict(tf.expand_dims(img, axis=0))
labels_ = np.array(labels)
prediction_prob = f"{pred.max() * 100:.2f}"
pred_label = labels[int(pred.argmax(axis=1))]
true_label = filepath.split("/")[4]
plt.imshow(img/255)
plt.axis(False)
c = "green" if true_label == pred_label else "red"
plt.title(f"Actual: {true_label} \nPred: {pred_label}, Prob: {prediction_prob}%", color=c);
img_pred(fp1)
Insights with confusion graphs for multiple images¶
Visualizing multiple plots with confusion graph
plt.figure(figsize=(16, 15))
for i in range(1, 12, 2):
rfp = random.choice(test_filepaths)
# plotting image
plt.subplot(3, 4, i)
img_pred(rfp)
# plotting conf graph
plt.subplot(3, 4, i+1)
pred_plot_conf(rfp)
plt.tight_layout(h_pad=1.0)
plt.show();
df_test.head()
filepaths | True labels | Pred labels | |
---|---|---|---|
0 | /content/birds/test/AFRICAN CROWNED CRANE/1.jpg | AFRICAN CROWNED CRANE | AFRICAN CROWNED CRANE |
1 | /content/birds/test/AFRICAN CROWNED CRANE/2.jpg | AFRICAN CROWNED CRANE | AFRICAN CROWNED CRANE |
2 | /content/birds/test/AFRICAN CROWNED CRANE/3.jpg | AFRICAN CROWNED CRANE | AFRICAN CROWNED CRANE |
3 | /content/birds/test/AFRICAN CROWNED CRANE/4.jpg | AFRICAN CROWNED CRANE | AFRICAN CROWNED CRANE |
4 | /content/birds/test/AFRICAN CROWNED CRANE/5.jpg | AFRICAN CROWNED CRANE | AFRICAN CROWNED CRANE |
true_l = np.array(true_test_arr)
pred_l = np.array(pred_labels)
check = true_l == pred_l
array([ True, True, True, ..., True, True, True])
preds_prob = []
len(pred_prob[1])
for i in range(len(pred_prob)):
preds_prob.append(pred_prob[i].max())
preds_prob[885:900]
[0.4214398, 0.93495345, 0.86977863, 0.99739146, 0.9950511, 0.9684955, 0.99907434, 0.969774, 0.9918247, 0.9996039, 0.565093, 0.8035624, 0.9875438, 0.9774302, 0.9018332]
Working with wrongly predicted images¶
fp = []
true = []
preds = []
prob_wrong = []
for i in range(len(check)):
if not check[i]:
fp.append(test_filepaths[i])
true.append(true_test_arr[i])
preds.append(pred_labels[i])
prob_wrong.append(preds_prob[i])
len(fp), len(true), len(preds), len(prob_wrong)
(23, 23, 23, 23)
# Data frame for wrong predictions
df_test_wrong = pd.DataFrame({"filepaths": fp,
"True labels": true,
"Pred labels": preds,
"Pred prob": prob_wrong})
df_test_wrong.head()
filepaths | True labels | Pred labels | Pred prob | |
---|---|---|---|---|
0 | /content/birds/test/BARN OWL/2.jpg | BARN OWL | SNOWY OWL | 0.939433 |
1 | /content/birds/test/BLACK SKIMMER/2.jpg | BLACK SKIMMER | CALIFORNIA GULL | 0.237657 |
2 | /content/birds/test/BLACKBURNIAM WARBLER/5.jpg | BLACKBURNIAM WARBLER | TOWNSENDS WARBLER | 0.402566 |
3 | /content/birds/test/CALIFORNIA GULL/1.jpg | CALIFORNIA GULL | ALBATROSS | 0.791357 |
4 | /content/birds/test/CRESTED NUTHATCH/1.jpg | CRESTED NUTHATCH | TIT MOUSE | 0.699400 |
Dataframe for wrong images¶
df_test_wrong
filepaths | True labels | Pred labels | Pred prob | |
---|---|---|---|---|
0 | /content/birds/test/BARN OWL/2.jpg | BARN OWL | SNOWY OWL | 0.939433 |
1 | /content/birds/test/BLACK SKIMMER/2.jpg | BLACK SKIMMER | CALIFORNIA GULL | 0.237657 |
2 | /content/birds/test/BLACKBURNIAM WARBLER/5.jpg | BLACKBURNIAM WARBLER | TOWNSENDS WARBLER | 0.402566 |
3 | /content/birds/test/CALIFORNIA GULL/1.jpg | CALIFORNIA GULL | ALBATROSS | 0.791357 |
4 | /content/birds/test/CRESTED NUTHATCH/1.jpg | CRESTED NUTHATCH | TIT MOUSE | 0.699400 |
5 | /content/birds/test/CRESTED NUTHATCH/2.jpg | CRESTED NUTHATCH | TIT MOUSE | 0.977929 |
6 | /content/birds/test/CROWNED PIGEON/2.jpg | CROWNED PIGEON | VICTORIA CROWNED PIGEON | 0.993989 |
7 | /content/birds/test/CROWNED PIGEON/3.jpg | CROWNED PIGEON | VICTORIA CROWNED PIGEON | 0.813827 |
8 | /content/birds/test/CROWNED PIGEON/5.jpg | CROWNED PIGEON | VICTORIA CROWNED PIGEON | 0.665272 |
9 | /content/birds/test/FRIGATE/4.jpg | FRIGATE | SCARLET IBIS | 0.679762 |
10 | /content/birds/test/GILDED FLICKER/1.jpg | GILDED FLICKER | NORTHERN FLICKER | 0.623433 |
11 | /content/birds/test/GREAT POTOO/1.jpg | GREAT POTOO | COMMON POORWILL | 0.945877 |
12 | /content/birds/test/HOODED MERGANSER/1.jpg | HOODED MERGANSER | BELTED KINGFISHER | 0.223974 |
13 | /content/birds/test/MALACHITE KINGFISHER/1.jpg | MALACHITE KINGFISHER | PYGMY KINGFISHER | 0.902210 |
14 | /content/birds/test/MALACHITE KINGFISHER/4.jpg | MALACHITE KINGFISHER | PYGMY KINGFISHER | 0.517748 |
15 | /content/birds/test/MALACHITE KINGFISHER/5.jpg | MALACHITE KINGFISHER | PYGMY KINGFISHER | 0.642336 |
16 | /content/birds/test/NORTHERN JACANA/5.jpg | NORTHERN JACANA | BLACK TAIL CRAKE | 0.842543 |
17 | /content/birds/test/PELICAN/2.jpg | PELICAN | MARABOU STORK | 0.229378 |
18 | /content/birds/test/RUFOUS KINGFISHER/3.jpg | RUFOUS KINGFISHER | PYGMY KINGFISHER | 0.979517 |
19 | /content/birds/test/SAMATRAN THRUSH/3.jpg | SAMATRAN THRUSH | BEARDED REEDLING | 0.169860 |
20 | /content/birds/test/SAMATRAN THRUSH/4.jpg | SAMATRAN THRUSH | COUCHS KINGBIRD | 0.412300 |
21 | /content/birds/test/TOUCHAN/2.jpg | TOUCHAN | CURL CRESTED ARACURI | 0.392801 |
22 | /content/birds/test/TURKEY VULTURE/2.jpg | TURKEY VULTURE | ASIAN CRESTED IBIS | 0.553743 |
# Exporting to a csv file
df_test_wrong.to_csv("Wrong-preds.csv")
{"filepaths": fp,
"True labels": true,
"Pred labels": preds,
"Pred prob": prob_wrong})
Insights for wrong images¶
# Plotting the wrong predictions
plt.figure(figsize=(17, 12))
choice = np.random.randint(0, 23, 9)
for i in range(9):
filepath = fp[choice[i]]
true_label = true[choice[i]]
pred_label = preds[choice[i]]
pred_prob = f"{prob_wrong[choice[i]].max() * 100:.2f}"
img = load_and_prep(filepath)
plt.subplot(3, 3, i+1)
plt.imshow(img/255)
plt.axis(False)
plt.title(f"Actual: {true_label} \nPred: {pred_label}, Prob: {pred_prob}%", color="red");
Insights with confusion graphs for wrong images¶
# Plotting the wrong predictions with conf
wrong_fp_arr = np.random.choice(fp, 12)
plt.figure(figsize=(16, 15))
for i in range(1, 12, 2):
rfp = wrong_fp_arr[i]
# plotting image
plt.subplot(3, 4, i)
img_pred(rfp)
# plotting conf graph
plt.subplot(3, 4, i+1)
pred_plot_conf(rfp)
plt.tight_layout(h_pad=1.0)
plt.show();