Jovian
⭐️
Sign In

Create own dataset from Google Images

In [47]:
from fastai.vision import *
from fastai.widgets import *

Create directory and upload url files into your server

In [24]:
folder='chimpanzee'
file = 'urls_chimpanzee.csv'
In [28]:
folder = 'gorilla'
file = 'urls_gorilla.csv'
In [31]:
folder = 'orangutan'
file = 'urls_orangutan.csv'
In [34]:
folder = 'capuchin'
file = 'urls_capuchin.csv'
In [11]:
path = Path('data/monkeys')
In [35]:

dest = path/folder
dest.mkdir(parents=True, exist_ok=True)
In [22]:
path.ls()
Out[22]:
[PosixPath('data/monkeys/gorilla'),
 PosixPath('data/monkeys/capuchin'),
 PosixPath('data/monkeys/orangutan'),
 PosixPath('data/monkeys/chimpanzee')]
In [19]:
##!mv data/monkeys/urls_orangutan.csv data/monkeys/orangutan/

Download images

In [3]:
classes = ['chimpanzee', 'gorilla', 'orangutan', 'capuchin']
In [36]:
download_images(path/file, dest)
Error x-raw-image:///641230a1731f76166ded3f030d7a39ca3ff9510dab963385bab37a3ef6ffc7c8 No connection adapters were found for 'x-raw-image:///641230a1731f76166ded3f030d7a39ca3ff9510dab963385bab37a3ef6ffc7c8' Error x-raw-image:///430f85138d533065d1d8d1fbfda3126d13fa96a7af3f52294a8f7c0a1d08017b No connection adapters were found for 'x-raw-image:///430f85138d533065d1d8d1fbfda3126d13fa96a7af3f52294a8f7c0a1d08017b' Error x-raw-image:///acbe54feaf63b61cfb04fce19eebf4726c8a91e55df02248dd32eedac40c653f No connection adapters were found for 'x-raw-image:///acbe54feaf63b61cfb04fce19eebf4726c8a91e55df02248dd32eedac40c653f' Error https://cdn.vox-cdn.com/thumbor/6_HUTpo6OX5YG2K--tZIq3MA938=/2x0:599x336/1600x900/cdn.vox-cdn.com/uploads/chorus_image/image/51400323/monkey2.0.gif HTTPSConnectionPool(host='cdn.vox-cdn.com', port=443): Read timed out. (read timeout=4) Error x-raw-image:///6ac0172e376b4206fc18064bca7c675591677da28f473066f45f318edf0dc34d No connection adapters were found for 'x-raw-image:///6ac0172e376b4206fc18064bca7c675591677da28f473066f45f318edf0dc34d' Error http://planetofthemonkeys.com/wp-content/uploads/2013/08/kappori-capuchin.jpg HTTPConnectionPool(host='planetofthemonkeys.com', port=80): Max retries exceeded with url: /wp-content/uploads/2013/08/kappori-capuchin.jpg (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7fc248886080>, 'Connection to planetofthemonkeys.com timed out. (connect timeout=4)'))
Verify the images
In [37]:
for c in classes:
    print(c)
    verify_images(path/c)
chimpanzee
cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000384.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000644.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000743.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000477.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000123.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000717.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000382.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000106.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000136.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000737.jpg'>
/home/ubuntu/anaconda3/lib/python3.6/site-packages/PIL/Image.py:984: UserWarning: Couldn't allocate palette entry for transparency "for transparency")
int() argument must be a string, a bytes-like object or a number, not 'tuple' cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000670.jpg'>
/home/ubuntu/anaconda3/lib/python3.6/site-packages/PIL/Image.py:984: UserWarning: Couldn't allocate palette entry for transparency "for transparency")
int() argument must be a string, a bytes-like object or a number, not 'tuple' cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000461.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000661.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000142.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000732.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000310.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000627.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000044.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000679.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000292.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000688.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000261.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000214.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000727.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000531.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000103.jpg'> Corrupt EXIF data. Expecting to read 4 bytes but only got 0. cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000130.png'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000397.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000744.jpg'>
/home/ubuntu/anaconda3/lib/python3.6/site-packages/PIL/Image.py:984: UserWarning: Couldn't allocate palette entry for transparency "for transparency")
int() argument must be a string, a bytes-like object or a number, not 'tuple' cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000128.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000651.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000566.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000498.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000203.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000721.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000422.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000414.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000399.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000182.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000006.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000217.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000667.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000611.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000592.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000215.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000607.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000720.gif'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000356.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000752.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000325.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000750.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000572.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000047.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000316.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000195.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000634.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000699.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000403.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000653.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000668.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000324.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000610.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000511.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000683.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000588.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000536.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000418.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000401.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000706.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000236.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000749.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000628.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000068.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000153.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000708.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000702.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000025.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000122.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000739.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000313.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000251.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000562.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000264.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000108.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000020.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000156.png'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000073.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/chimpanzee/00000449.jpg'> gorilla
cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000205.jpg'>
/home/ubuntu/anaconda3/lib/python3.6/site-packages/PIL/Image.py:984: UserWarning: Couldn't allocate palette entry for transparency "for transparency")
int() argument must be a string, a bytes-like object or a number, not 'tuple' cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000371.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000537.jpg'>
/home/ubuntu/anaconda3/lib/python3.6/site-packages/PIL/Image.py:984: UserWarning: Couldn't allocate palette entry for transparency "for transparency")
int() argument must be a string, a bytes-like object or a number, not 'tuple' cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000105.png'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000089.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000645.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000214.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000531.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000429.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000043.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000473.jpg'>
/home/ubuntu/anaconda3/lib/python3.6/site-packages/PIL/Image.py:931: UserWarning: Palette images with Transparency expressed in bytes should be converted to RGBA images 'to RGBA images')
cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000250.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000487.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000631.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000160.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000651.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000127.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000484.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000540.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000297.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000607.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000594.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000030.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000347.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000560.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000239.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000684.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000668.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000097.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000324.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000593.png'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000320.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000692.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000471.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000442.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000334.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000224.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000479.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000458.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000647.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000245.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000321.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000037.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000313.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000641.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000485.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000488.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000219.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000686.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/gorilla/00000374.jpg'> orangutan
cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000477.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000383.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000046.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000237.jpeg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000589.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000678.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000434.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000671.jpg'> data/monkeys/orangutan/00000727.JPG: Removing corrupt EXIF data cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000041.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000531.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000075.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000565.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000637.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000512.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000448.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000626.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000240.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000369.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000119.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000611.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000077.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000431.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000572.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000452.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000244.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000247.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000337.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000511.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000364.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000536.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000525.png'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000600.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000122.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000302.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000462.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000323.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000319.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000066.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/orangutan/00000449.jpg'> capuchin cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000441.jpg'>
/home/ubuntu/anaconda3/lib/python3.6/site-packages/PIL/Image.py:984: UserWarning: Couldn't allocate palette entry for transparency "for transparency")
int() argument must be a string, a bytes-like object or a number, not 'tuple'
/home/ubuntu/anaconda3/lib/python3.6/site-packages/PIL/Image.py:984: UserWarning: Couldn't allocate palette entry for transparency "for transparency")
int() argument must be a string, a bytes-like object or a number, not 'tuple' cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000393.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000043.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000125.JPG'>
/home/ubuntu/anaconda3/lib/python3.6/site-packages/PIL/Image.py:984: UserWarning: Couldn't allocate palette entry for transparency "for transparency")
int() argument must be a string, a bytes-like object or a number, not 'tuple' cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000469.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000072.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000527.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000338.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000508.png'> cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000569.jpg'>
/home/ubuntu/anaconda3/lib/python3.6/site-packages/PIL/Image.py:984: UserWarning: Couldn't allocate palette entry for transparency "for transparency")
int() argument must be a string, a bytes-like object or a number, not 'tuple' cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000258.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000277.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000622.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000427.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000606.jpg'>
/home/ubuntu/anaconda3/lib/python3.6/site-packages/PIL/Image.py:984: UserWarning: Couldn't allocate palette entry for transparency "for transparency")
int() argument must be a string, a bytes-like object or a number, not 'tuple' cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000255.jpg'>
/home/ubuntu/anaconda3/lib/python3.6/site-packages/PIL/Image.py:984: UserWarning: Couldn't allocate palette entry for transparency "for transparency")
int() argument must be a string, a bytes-like object or a number, not 'tuple' cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000466.jpg'>
/home/ubuntu/anaconda3/lib/python3.6/site-packages/PIL/Image.py:984: UserWarning: Couldn't allocate palette entry for transparency "for transparency")
int() argument must be a string, a bytes-like object or a number, not 'tuple' cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000212.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000246.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000321.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000503.jpg'> cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000092.jpg'> Corrupt EXIF data. Expecting to read 4 bytes but only got 0. cannot identify image file <_io.BufferedReader name='data/monkeys/capuchin/00000374.jpg'>

View data

In [4]:
np.random.seed(42) # Set random seed to fixed beforehand to ensure we
# get the same validation set always
In [3]:
!ls data/
monkeys
In [8]:
!ls data/monkeys/gorilla/
00000000.jpg 00000139.jpg 00000279.jpg 00000418.jpg 00000562.jpg 00000001.jpg 00000140.jpg 00000280.jpg 00000419.jpg 00000563.jpg 00000002.jpg 00000141.jpg 00000281.jpg 00000420.jpg 00000564.jpg 00000003.jpg 00000142.jpg 00000282.jpg 00000421.jpg 00000565.jpg 00000004.jpg 00000143.jpg 00000283.jpg 00000422.jpg 00000566.jpg 00000005.jpg 00000144.jpeg 00000284.jpg 00000423.jpg 00000567.jpg 00000006.jpg 00000145.jpg 00000285.jpg 00000424.jpg 00000568.jpg 00000007.jpg 00000146.jpg 00000286.jpg 00000425.jpg 00000569.ashx 00000008.jpg 00000147.jpg 00000287.jpg 00000426.jpg 00000570.jpg 00000009.jpg 00000148.jpg 00000288.jpg 00000427.jpg 00000571.jpg 00000010.jpg 00000149.jpg 00000289.jpg 00000428.jpg 00000572.jpg 00000011.jpg 00000150.jpg 00000290.jpg 00000430.jpg 00000573.jpg 00000012.jpg 00000151.jpg 00000291.jpg 00000431.jpg 00000574.jpg 00000013.jpg 00000152.jpg 00000292.jpg 00000432.jpg 00000575.jpg 00000014.jpg 00000153.jpg 00000293.jpg 00000433.jpg 00000576.jpg 00000015.jpg 00000154.jpg 00000294.jpg 00000434.jpeg 00000577.jpg 00000016.jpg 00000155.jpg 00000295.jpg 00000435.jpg 00000578.jpg 00000017.jpg 00000156.jpg 00000296.jpg 00000436.jpg 00000579.jpg 00000018.jpg 00000157.jpg 00000298.jpg 00000437.jpg 00000580.jpg 00000019.jpg 00000158.jpg 00000299.jpg 00000438.jpg 00000581.jpg 00000020.jpg 00000159.jpg 00000300.jpg 00000439.jpg 00000582.jpg 00000021.jpg 00000161.jpg 00000301.jpg 00000440.png 00000583.jpg 00000022.jpg 00000162.jpg 00000302.jpg 00000441.jpg 00000584.jpg 00000023.jpg 00000163.jpg 00000303.jpg 00000443.jpg 00000585.jpg 00000024.jpg 00000164.jpg 00000304.jpg 00000444.jpg 00000586.jpg 00000025.jpg 00000165.jpg 00000305.jpg 00000445.jpg 00000587.jpg 00000026.jpg 00000166.jpg 00000306.jpg 00000446.jpg 00000588.jpg 00000027.jpg 00000167.jpg 00000307.jpeg 00000447.jpg 00000589.jpg 00000028.jpg 00000168.jpg 00000308.jpg 00000448.jpg 00000590.png 00000031.jpg 00000169.jpg 00000309.jpg 00000449.jpg 00000591.jpg 00000032.jpg 00000170.jpg 00000310.jpg 00000450.jpg 00000592.jpg 00000033.jpg 00000171.jpg 00000311.jpg 00000451.jpg 00000595.jpg 00000034.jpg 00000172.jpg 00000312.jpg 00000452.ashx 00000596.jpg 00000035.jpg 00000173.jpg 00000314.ashx 00000453.jpg 00000597.jpg 00000036.jpg 00000174.jpg 00000315.jpg 00000454.jpg 00000598.jpg 00000038.jpg 00000175.jpg 00000317.jpg 00000455.jpg 00000599.jpg 00000039.jpg 00000176.jpg 00000318.jpg 00000456.jpg 00000600.jpg 00000040.jpg 00000177.jpg 00000319.jpg 00000457.jpg 00000601.jpg 00000041.jpg 00000178.jpg 00000322.jpg 00000459.jpg 00000602.jpg 00000042.jpg 00000179.jpg 00000323.jpg 00000460.jpg 00000603.jpg 00000044.JPG 00000180.jpg 00000325.jpg 00000461.jpg 00000604.jpg 00000045.jpg 00000181.jpg 00000326.jpg 00000462.jpg 00000605.jpg 00000046.jpg 00000182.jpg 00000327.jpg 00000463.jpg 00000606.jpg 00000047.jpg 00000183.jpg 00000328.jpg 00000464.jpg 00000608.jpg 00000048.jpg 00000184.jpg 00000329.jpg 00000465.jpg 00000609.jpg 00000049.jpg 00000185.jpg 00000330.jpg 00000466.jpg 00000610.jpg 00000050.jpg 00000186.jpg 00000331.jpg 00000467.jpg 00000611.jpg 00000051.jpg 00000187.jpg 00000332.jpg 00000468.jpg 00000612.ashx 00000052.jpg 00000188.jpg 00000333.jpg 00000469.jpg 00000613.jpg 00000053.jpg 00000189.jpg 00000335.jpg 00000470.jpg 00000614.jpg 00000054.jpg 00000190.jpeg 00000336.aspx 00000472.jpg 00000615.jpg 00000055.jpg 00000191.jpg 00000337.JPG 00000474.jpg 00000616.jpg 00000056.jpg 00000192.jpg 00000338.jpg 00000475.jpg 00000617.jpg 00000057.jpeg 00000193.jpg 00000339.jpg 00000476.jpg 00000618.jpg 00000058.jpg 00000194.jpg 00000340.jpg 00000477.jpg 00000619.jpeg 00000059.jpg 00000195.jpg 00000341.jpg 00000478.jpg 00000620.jpg 00000060.jpg 00000196.jpg 00000342.jpg 00000480.jpg 00000621.jpg 00000061.jpg 00000197.jpg 00000343.jpg 00000481.jpg 00000622.jpg 00000062.jpg 00000198.jpg 00000344.jpg 00000482.jpg 00000623.jpg 00000063.jpg 00000199.jpg 00000345.jpg 00000483.jpg 00000624.jpg 00000064.jpg 00000200.jpg 00000346.jpg 00000486.jpg 00000625.jpg 00000065.jpg 00000201.jpg 00000348.jpeg 00000490.jpg 00000626.jpeg 00000066.jpg 00000202.jpg 00000349.jpg 00000491.jpg 00000627.jpg 00000067.jpg 00000203.jpg 00000350.img 00000492.jpg 00000628.jpg 00000068.jpg 00000204.JPG 00000351.jpg 00000493.jpg 00000629.jpg 00000069.jpg 00000206.jpg 00000352.jpg 00000494.jpg 00000630.jpg 00000070.jpg 00000207.jpg 00000353.jpg 00000495.jpg 00000632.jpg 00000071.jpg 00000208.jpg 00000354.jpg 00000496.jpg 00000633.jpg 00000072.jpg 00000209.jpg 00000355.jpeg 00000497.jpg 00000634.jpg 00000073.jpg 00000211.jpg 00000356.png 00000498.jpg 00000635.jpg 00000074.jpg 00000212.jpg 00000357.jpg 00000499.jpg 00000636.jpg 00000075.jpg 00000213.jpg 00000358.jpg 00000500.jpg 00000637.jpg 00000076.jpg 00000215.jpg 00000359.jpg 00000501.jpeg 00000638.ashx 00000078.jpg 00000216.jpg 00000360.jpg 00000502.jpg 00000639.jpg 00000079.jpg 00000217.jpg 00000361.jpg 00000503.jpg 00000640.jpg 00000080.PNG 00000218.jpg 00000362.jpg 00000504.jpg 00000642.jpg 00000081.jpg 00000220.jpg 00000363.jpg 00000505.jpg 00000643.jpg 00000082.png 00000221.jpg 00000364.jpg 00000506.jpg 00000644.jpg 00000083.jpg 00000222.jpg 00000365.jpg 00000507.jpg 00000646.jpg 00000084.jpg 00000223.jpg 00000366.jpg 00000508.jpg 00000648.jpg 00000085.jpg 00000225.jpg 00000367.jpg 00000509.jpg 00000649.jpg 00000086.jpg 00000226.jpeg 00000368.jpg 00000510.jpg 00000650.jpg 00000087.jpg 00000227.jpg 00000369.jpg 00000511.jpg 00000652.jpg 00000088.jpg 00000228.jpg 00000370.jpg 00000512.jpg 00000653.jpg 00000090.png 00000229.ashx 00000372.jpg 00000513.jpg 00000654.jpg 00000091.jpg 00000230.jpg 00000373.jpg 00000514.jpg 00000655.jpg 00000092.jpg 00000231.jpg 00000375.jpg 00000515.jpg 00000656.jpg 00000093.jpg 00000232.jpg 00000376.jpg 00000516.jpg 00000657.jpg 00000094.jpg 00000233.jpg 00000377.jpg 00000517.jpg 00000658.jpg 00000095.jpg 00000234.jpg 00000378.jpg 00000518.jpg 00000659.jpg 00000096.jpg 00000235.jpg 00000379.jpg 00000519.ashx 00000660.jpg 00000098.jpg 00000236.jpg 00000380.jpg 00000520.jpg 00000661.jpg 00000099.jpg 00000237.jpg 00000381.jpg 00000521.jpg 00000662.jpg 00000100.JPG 00000238.jpg 00000382.jpg 00000522.jpg 00000663.jpg 00000101.jpg 00000240.jpg 00000383.jpg 00000523.jpg 00000664.ashx 00000102.ashx 00000241.jpg 00000384.jpeg 00000524.jpg 00000665.jpg 00000103.jpg 00000242.jpg 00000385.png 00000525.jpg 00000666.jpg 00000104.jpg 00000243.jpg 00000386.jpg 00000526.jpg 00000667.jpg 00000106.jpg 00000244.jpg 00000387.PNG 00000527.jpg 00000669.jpg 00000107.jpg 00000246.jpg 00000388.jpeg 00000528.png 00000670.jpg 00000108.jpg 00000247.jpg 00000389.jpg 00000529.jpg 00000671.jpg 00000109.jpg 00000248.jpg 00000390.jpg 00000530.jpg 00000672.jpg 00000110.jpg 00000249.jpg 00000391.jpg 00000532.jpg 00000673.jpg 00000111.jpg 00000251.jpg 00000392.jpg 00000533.jpg 00000674.jpg 00000112.jpg 00000252.jpg 00000393.ashx 00000534.jpg 00000675.jpg 00000113.jpg 00000253.jpg 00000394.jpg 00000535.jpg 00000676.jpg 00000114.png 00000254.jpg 00000395.jpg 00000536.jpg 00000677.jpg 00000115.jpg 00000256.jpg 00000396.jpg 00000538.jpg 00000678.jpg 00000116.jpg 00000257.jpg 00000397.jpg 00000539.jpg 00000679.jpg 00000117.jpg 00000258.jpg 00000398.jpg 00000541.jpg 00000680.jpg 00000118.jpg 00000259.jpeg 00000399.jpg 00000542.jpg 00000681.jpg 00000119.jpg 00000260.jpg 00000400.jpg 00000543.jpg 00000682.jpg 00000120.jpg 00000261.jpg 00000401.jpg 00000544.jpg 00000683.jpg 00000121.jpg 00000262.jpg 00000402.jpg 00000545.jpg 00000685.jpg 00000123.jpg 00000263.jpg 00000403.jpg 00000546.jpg 00000687.ashx 00000124.jpg 00000264.jpg 00000404.jpg 00000547.jpg 00000688.jpg 00000125.jpg 00000265.jpg 00000405.png 00000548.jpg 00000689.JPG 00000126.jpg 00000266.jpg 00000406.jpg 00000549.jpg 00000690.jpg 00000128.jpg 00000267.jpg 00000407.jpg 00000550.jpg 00000691.jpg 00000129.jpg 00000269.jpg 00000408.jpg 00000551.jpg 00000693.jpg 00000130.jpg 00000270.jpg 00000409.jpg 00000552.jpg 00000694.ashx 00000131.jpg 00000271.jpg 00000410.jpg 00000553.jpg 00000695.jpg 00000132.jpg 00000272.jpg 00000411.jpg 00000554.jpg 00000696.jpg 00000133.jpg 00000273.jpg 00000412.jpg 00000555.jpg 00000697.jpg 00000134.jpg 00000274.jpg 00000413.jpg 00000556.jpg 00000698.jpg 00000135.jpg 00000275.jpg 00000414.jpg 00000557.jpg 00000699.jpg 00000136.jpg 00000276.jpg 00000415.jpg 00000558.jpg 00000700.jpg 00000137.jpg 00000277.jpg 00000416.jpg 00000559.jpg 00000701.ashx 00000138.jpg 00000278.jpg 00000417.jpg 00000561.jpg 00000702.jpg
In [12]:
path = 'data/monkeys'
In [15]:
# Always create a validation set 
# uses the default batch size of 32
data = ImageDataBunch.from_folder(path, train=".", valid_pct=0.2,
        ds_tfms=get_transforms(), size=224).normalize(imagenet_stats)
In [16]:
data.classes
Out[16]:
['capuchin', 'chimpanzee', 'gorilla', 'orangutan']
In [17]:
data.show_batch(rows=3, figsize=(7,8))
Notebook Image
In [22]:
data.classes, data.c, len(data.train_ds), len(data.valid_ds)
Out[22]:
(['capuchin', 'chimpanzee', 'gorilla', 'orangutan'], 4, 2088, 521)

Train model

In [24]:
learn = cnn_learner(data, models.resnet34, metrics=[error_rate, accuracy])
In [26]:
learn.fit_one_cycle(6)
In [27]:
learn.save('stage-1')
In [28]:
learn.unfreeze()
In [29]:
learn.lr_find()
LR Finder is complete, type {learner_name}.recorder.plot() to see the graph.
In [31]:
learn.recorder.plot()
Notebook Image
In [32]:
learn.fit_one_cycle(2, max_lr=slice(1e-5, 1e-4))
In [33]:
learn.save('stage-2')

Interpretation

In [35]:
interp = ClassificationInterpretation.from_learner(learn)
In [36]:
interp.plot_confusion_matrix()
Notebook Image
In [37]:
interp.most_confused()
Out[37]:
[('gorilla', 'chimpanzee', 6),
 ('chimpanzee', 'gorilla', 5),
 ('capuchin', 'chimpanzee', 3),
 ('orangutan', 'chimpanzee', 3),
 ('chimpanzee', 'capuchin', 2),
 ('orangutan', 'capuchin', 2),
 ('gorilla', 'orangutan', 1)]
In [44]:
len(top_loss_paths)
Out[44]:
521
In [34]:
doc(ClassificationInterpretation)
In [23]:
doc(cnn_learner)
In [18]:
doc(ImageDataBunch)
In [21]:
doc(DataBunch)

Cleaning up the bad data

In [40]:
losses,idxs = interp.top_losses()
In [45]:
top_loss_paths = data.valid_ds.x[idxs]
In [51]:
ds, idxs = DatasetFormatter.from_toplosses(learn, ds_type=DatasetType.Train)
In [55]:
ImageCleaner(ds, idxs, path)
HBox(children=(VBox(children=(Image(value=b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x00d\x00d\x00\x00\xff…
Button(button_style='primary', description='Next Batch', layout=Layout(width='auto'), style=ButtonStyle())
In [59]:
!ls ./data/monkeys
capuchin cleaned.csv models urls_capuchin.csv urls_gorilla.csv chimpanzee gorilla orangutan urls_chimpanzee.csv urls_orangutan.csv
In [70]:
db = ImageList.from_csv(path, 'cleaned.csv', folder='.').split_none().label_from_df().transform(get_transforms(), size=224).databunch()
In [71]:
learn_cln = cnn_learner(db, models.resnet34, metrics=['error_rate','accuracy'])
In [72]:
learn_cln.load('stage-2')
Out[72]:
Learner(data=ImageDataBunch;

Train: LabelList (1956 items)
x: ImageList
Image (3, 224, 224),Image (3, 224, 224),Image (3, 224, 224),Image (3, 224, 224),Image (3, 224, 224)
y: CategoryList
gorilla,gorilla,gorilla,gorilla,gorilla
Path: data/monkeys;

Valid: LabelList (0 items)
x: ImageList

y: CategoryList

Path: data/monkeys;

Test: None, model=Sequential(
  (0): Sequential(
    (0): Conv2d(3, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)
    (1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (2): ReLU(inplace)
    (3): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
    (4): Sequential(
      (0): BasicBlock(
        (conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(inplace)
        (conv2): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      )
      (1): BasicBlock(
        (conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(inplace)
        (conv2): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      )
      (2): BasicBlock(
        (conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(inplace)
        (conv2): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      )
    )
    (5): Sequential(
      (0): BasicBlock(
        (conv1): Conv2d(64, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
        (bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(inplace)
        (conv2): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (downsample): Sequential(
          (0): Conv2d(64, 128, kernel_size=(1, 1), stride=(2, 2), bias=False)
          (1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        )
      )
      (1): BasicBlock(
        (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(inplace)
        (conv2): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      )
      (2): BasicBlock(
        (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(inplace)
        (conv2): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      )
      (3): BasicBlock(
        (conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(inplace)
        (conv2): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      )
    )
    (6): Sequential(
      (0): BasicBlock(
        (conv1): Conv2d(128, 256, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
        (bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(inplace)
        (conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (downsample): Sequential(
          (0): Conv2d(128, 256, kernel_size=(1, 1), stride=(2, 2), bias=False)
          (1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        )
      )
      (1): BasicBlock(
        (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(inplace)
        (conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      )
      (2): BasicBlock(
        (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(inplace)
        (conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      )
      (3): BasicBlock(
        (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(inplace)
        (conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      )
      (4): BasicBlock(
        (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(inplace)
        (conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      )
      (5): BasicBlock(
        (conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(inplace)
        (conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      )
    )
    (7): Sequential(
      (0): BasicBlock(
        (conv1): Conv2d(256, 512, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
        (bn1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(inplace)
        (conv2): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn2): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (downsample): Sequential(
          (0): Conv2d(256, 512, kernel_size=(1, 1), stride=(2, 2), bias=False)
          (1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        )
      )
      (1): BasicBlock(
        (conv1): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(inplace)
        (conv2): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn2): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      )
      (2): BasicBlock(
        (conv1): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
        (relu): ReLU(inplace)
        (conv2): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
        (bn2): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      )
    )
  )
  (1): Sequential(
    (0): AdaptiveConcatPool2d(
      (ap): AdaptiveAvgPool2d(output_size=1)
      (mp): AdaptiveMaxPool2d(output_size=1)
    )
    (1): Flatten()
    (2): BatchNorm1d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (3): Dropout(p=0.25)
    (4): Linear(in_features=1024, out_features=512, bias=True)
    (5): ReLU(inplace)
    (6): BatchNorm1d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (7): Dropout(p=0.5)
    (8): Linear(in_features=512, out_features=4, bias=True)
  )
), opt_func=functools.partial(<class 'torch.optim.adam.Adam'>, betas=(0.9, 0.99)), loss_func=FlattenedLoss of CrossEntropyLoss(), metrics=['error_rate', 'accuracy'], true_wd=True, bn_wd=True, wd=0.01, train_bn=True, path=PosixPath('data/monkeys'), model_dir='models', callback_fns=[functools.partial(<class 'fastai.basic_train.Recorder'>, add_time=True, silent=False)], callbacks=[], layer_groups=[Sequential(
  (0): Conv2d(3, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)
  (1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (2): ReLU(inplace)
  (3): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
  (4): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (5): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (6): ReLU(inplace)
  (7): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (8): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (9): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (10): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (11): ReLU(inplace)
  (12): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (13): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (14): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (15): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (16): ReLU(inplace)
  (17): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (18): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (19): Conv2d(64, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
  (20): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (21): ReLU(inplace)
  (22): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (23): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (24): Conv2d(64, 128, kernel_size=(1, 1), stride=(2, 2), bias=False)
  (25): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (26): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (27): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (28): ReLU(inplace)
  (29): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (30): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (31): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (32): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (33): ReLU(inplace)
  (34): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (35): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (36): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (37): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (38): ReLU(inplace)
  (39): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (40): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
), Sequential(
  (0): Conv2d(128, 256, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
  (1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (2): ReLU(inplace)
  (3): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (4): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (5): Conv2d(128, 256, kernel_size=(1, 1), stride=(2, 2), bias=False)
  (6): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (7): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (8): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (9): ReLU(inplace)
  (10): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (11): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (12): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (13): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (14): ReLU(inplace)
  (15): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (16): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (17): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (18): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (19): ReLU(inplace)
  (20): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (21): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (22): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (23): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (24): ReLU(inplace)
  (25): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (26): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (27): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (28): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (29): ReLU(inplace)
  (30): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (31): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (32): Conv2d(256, 512, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
  (33): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (34): ReLU(inplace)
  (35): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (36): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (37): Conv2d(256, 512, kernel_size=(1, 1), stride=(2, 2), bias=False)
  (38): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (39): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (40): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (41): ReLU(inplace)
  (42): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (43): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (44): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (45): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (46): ReLU(inplace)
  (47): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
  (48): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
), Sequential(
  (0): AdaptiveAvgPool2d(output_size=1)
  (1): AdaptiveMaxPool2d(output_size=1)
  (2): Flatten()
  (3): BatchNorm1d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (4): Dropout(p=0.25)
  (5): Linear(in_features=1024, out_features=512, bias=True)
  (6): ReLU(inplace)
  (7): BatchNorm1d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (8): Dropout(p=0.5)
  (9): Linear(in_features=512, out_features=4, bias=True)
)], add_time=True, silent=None)
In [75]:
ds, idxs = DatasetFormatter.from_toplosses(learn_cln)
In [69]:
ImageCleaner(ds, idxs, path)
HBox(children=(VBox(children=(Image(value=b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x00d\x00d\x00\x00\xff…
Button(button_style='primary', description='Next Batch', layout=Layout(width='auto'), style=ButtonStyle())
In [87]:
path = Path('data/monkeys')
In [90]:
!ls data/monkeys/chimpanzee
00000000.jpg 00000367.jpg 00000001.jpg 00000368.jpg 00000002.jpg 00000369.jpg 00000003.jpg 00000370.jpg 00000004.jpg 00000371.png 00000005.jpg 00000372.jpg 00000007.jpg 00000373.png 00000008.jpeg 00000374.jpg 00000009.jpg 00000375.jpg 00000010.jpg 00000376.jpg 00000011.jpg 00000377.jpg 00000012.jpg 00000378.jpg 00000013.jpg 00000379.jpg 00000014.jpg 00000380.aDs4ODk5NztqOzE4MDQ2OzEyMDA7NjAwMDszMzc1 00000015.jpg 00000381.png 00000016.jpg 00000383.jpg 00000017.jpg 00000385.jpg 00000018.jpg 00000386.jpg 00000019.jpg 00000387.jpeg 00000021.png 00000388.jpg 00000022.jpg 00000389.jpg 00000024.jpg 00000390.jpg 00000026.jpg 00000391.jpg 00000027.jpg 00000392.jpg 00000028.jpg 00000393.jpg 00000029.jpg 00000394.jpg 00000030.jpg 00000395.jpg 00000031.jpg 00000396.jpg 00000032.jpg 00000398.jpg 00000033.jpg 00000400.jpg 00000034.jpg 00000402.jpg 00000035.JPG 00000404.jpg 00000036.jpg 00000405.jpg 00000037.jpg 00000406.jpg 00000038.jpg 00000407.jpg 00000039.jpg 00000408.jpg 00000040.jpg 00000409.jpg 00000041.jpg 00000410.jpg 00000042.jpg 00000411.jpg 00000043.jpg 00000412.jpg 00000045.jpg 00000413.jpg 00000046.jpg 00000415.jpg 00000048.jpg 00000416.jpg 00000049.jpg 00000417.jpg 00000050.jpg 00000419.jpg 00000051.jpg 00000420.jpg 00000052.jpeg 00000421.jpg 00000053.jpeg 00000424.jpg 00000054.jpg 00000425.jpg 00000055.jpg 00000426.jpg 00000056.jpg 00000427.jpg 00000057.jpg 00000428.jpg 00000058.jpg 00000429.jpg 00000059.jpg 00000430.do 00000060.jpeg 00000431.jpg 00000061.jpg 00000432.jpg 00000062.jpg 00000433.jpg 00000063.jpg 00000434.webp 00000064.jpg 00000435.jpg 00000065.jpg 00000436.jpg 00000066.jpg 00000437.png 00000067.jpg 00000438.jpg 00000069.jpg 00000439.jpg 00000070.jpg 00000440.jpg 00000071.jpg 00000441.jpg 00000072.jpg 00000442.jpg 00000074.jpg 00000443.jpeg 00000075.jpg 00000444.jpg 00000076.jpg 00000445.jpg 00000077.jpg 00000446.jpg 00000078.jpg 00000447.jpg 00000079.jpg 00000448.png 00000080.jpg 00000450.jpg 00000081.jpg 00000451.php 00000082.jpg 00000452.jpg 00000083.jpg 00000453.jpg 00000084.jpg 00000454.jpg 00000085.jpg 00000455.jpg 00000086.jpg 00000456.jpg 00000087.jpg 00000457.jpeg 00000088.jpg 00000458.jpg 00000089.jpg 00000459.jpg 00000090.jpg 00000460.jpg 00000091.jpg 00000462.jpg 00000092.jpg 00000463.jpg 00000093.jpg 00000464.jpg 00000094.jpg 00000465.jpg 00000095.jpg 00000466.png 00000096.jpg 00000467.jpg 00000097.jpg 00000468.jpg 00000099.jpg 00000469.jpg 00000100.jpg 00000470.jpg 00000101.jpg 00000471.jpg 00000102.jpg 00000472.aDs4ODk5ODtqOzE4MDQ2OzEyMDA7NTc0OzMyMw 00000104.jpg 00000473.jpg 00000105.jpg 00000474.jpg 00000107.jpg 00000475.jpg 00000109.jpeg 00000476.jpg 00000110.jpg 00000478.jpg 00000111.jpg 00000479.jpg 00000112.jpg 00000480.jpg 00000113.jpg 00000481.jpg 00000114.jpg 00000482.jpg 00000115.jpg 00000483.jpg 00000116.jpg 00000484.jpg 00000117.jpg 00000485.jpg 00000118.jpg 00000486.jpg 00000119.jpg 00000487.jpg 00000120.jpg 00000488.jpg 00000121.jpg 00000489.jpg 00000124.jpg 00000490.jpg 00000125.jpg 00000491.jpg 00000126.jpg 00000492.jpg 00000127.jpg 00000493.jpg 00000129.jpg 00000494.jpeg 00000131.jpg 00000495.jpg 00000132.jpg 00000496.jpg 00000133.jpg 00000497.jpg 00000134.jpg 00000499.jpg 00000135.jpg 00000500.jpg 00000137.jpg 00000501.jpg 00000138.jpg 00000502.jpg 00000139.jpg 00000503.jpg 00000141.jpg 00000504.jpg 00000143.jpg 00000506.jpg 00000144.jpg 00000507.jpg 00000145.jpg 00000508.gif 00000146.jpg 00000509.jpg 00000147.jpg 00000510.jpg 00000148.jpg 00000512.jpg 00000149.jpg 00000513.jpg 00000150.jpg 00000514.jpg 00000151.jpg 00000516.jpg 00000152.jpg 00000517.jpg 00000154.jpg 00000518.jpg 00000155.jpg 00000519.jpg 00000157.jpg 00000520.jpg 00000158.JPG 00000521.jpg 00000159.jpg 00000522.jpg 00000160.jpg 00000523.jpg 00000161.jpg 00000524.jpg 00000162.jpg 00000525.jpg 00000163.jpg 00000526.jpg 00000164.jpg 00000527.jpg 00000165.jpg 00000528.jpg 00000166.jpg 00000529.jpg 00000167.jpg 00000530.png 00000168.jpg 00000532.jpg 00000169.jpg 00000533.jpg 00000170.jpg 00000535.jpg 00000171.jpg 00000537.jpg 00000172.jpg 00000538.jpg 00000173.jpg 00000539.jpg 00000174.png 00000540.jpg 00000175.jpg 00000541.jpg 00000176.jpeg 00000542.jpg 00000177.jpg 00000543.jpg 00000178.jpg 00000544.jpg 00000179.jpg 00000545.png 00000180.jpg 00000546.jpg 00000181.jpg 00000547.jpg 00000183.jpg 00000548.jpg 00000184.jpg 00000549.png 00000185.jpg 00000550.jpg 00000186.jpg 00000551.jpg 00000187.jpg 00000552.jpg 00000188.jpg 00000553.jpg 00000189.jpg 00000554.jpg 00000190.jpg 00000555.jpg 00000191.jpg 00000556.jpg 00000192.jpg 00000557.jpg 00000193.jpg 00000558.jpg 00000194.jpg 00000559.jpg 00000196.jpg 00000560.jpg 00000197.jpg 00000561.aDs4OTAwMDtqOzE4MDQ2OzEyMDA7MzY0MDsyNDI2 00000198.jpg 00000563.jpg 00000199.jpg 00000564.jpg 00000200.jpg 00000565.jpg 00000201.jpg 00000567.jpg 00000202.jpg 00000568.jpg 00000204.jpg 00000569.jpg 00000205.png 00000570.jpg 00000206.jpg 00000571.jpg 00000207.jpg 00000573.jpg 00000208.jpg 00000574.jpg 00000209.jpg 00000575.jpg 00000210.jpg 00000576.jpg 00000211.jpg 00000577.jpg 00000212.jpg 00000578.jpg 00000213.jpg 00000579.jpg 00000216.jpg 00000580.jpg 00000218.jpg 00000581.jpg 00000219.jpg 00000582.jpg 00000220.jpg 00000583.jpg 00000221.jpg 00000584.jpg 00000222.jpg 00000585.jpg 00000223.jpg 00000586.jpg 00000224.jpg 00000587.jpg 00000225.jpg 00000589.jpg 00000226.jpg 00000590.jpg 00000227.jpg 00000591.jpg 00000228.jpg 00000593.jpg 00000229.jpg 00000594.jpg 00000230.jpg 00000595.jpg 00000231.jpeg 00000596.jpg 00000232.png 00000597.png 00000233.jpeg 00000598.jpg 00000234.jpg 00000599.jpg 00000235.jpg 00000600.jpg 00000237.jpg 00000601.jpg 00000238.jpg 00000603.jpg 00000239.jpg 00000604.jpg 00000240.jpg 00000605.jpg 00000241.jpg 00000606.jpg 00000242.jpg 00000608.jpg 00000243.jpg 00000609.jpg 00000244.jpg 00000612.jpg 00000245.jpg 00000613.jpg 00000246.jpg 00000614.jpg 00000247.jpg 00000615.jpeg 00000248.jpg 00000616.jpg 00000249.jpg 00000617.jpg 00000250.jpg 00000618.jpg 00000252.jpg 00000619.jpg 00000253.jpg 00000620.jpg 00000254.jpg 00000621.jpg 00000255.png 00000622.jpg 00000256.jpg 00000623.jpg 00000257.jpg 00000624.jpg 00000258.jpg 00000625.jpg 00000259.jpg 00000626.jpg 00000260.jpg 00000629.jpg 00000262.jpg 00000630.jpg 00000263.jpg 00000631.jpg 00000265.jpg 00000632.jpg 00000266.jpeg 00000633.jpg 00000267.jpg 00000635.jpg 00000268.jpg 00000636.jpg 00000269.jpg 00000638.aDs4ODk5OTtqOzE4MDQ2OzEyMDA7NTc0OzM4Mg 00000270.jpg 00000639.jpg 00000271.jpg 00000640.png 00000272.jpeg 00000641.jpg 00000273.jpg 00000642.jpg 00000274.jpg 00000643.jpg 00000275.jpg 00000645.jpg 00000276.jpg 00000646.jpg 00000277.jpeg 00000648.jpg 00000278.jpg 00000649.jpg 00000279.jpeg 00000650.png 00000280.jpg 00000652.jpg 00000281.jpg 00000654.jpg 00000282.png 00000655.jpg 00000283.jpg 00000656.jpg 00000284.jpg 00000657.jpg 00000285.jpg 00000658.jpg 00000286.jpg 00000659.jpg 00000287.jpg 00000660.jpg 00000288.jpg 00000662.jpg 00000289.jpg 00000663.jpg 00000290.jpg 00000664.jpg 00000291.jpg 00000665.jpeg 00000293.jpg 00000666.jpg 00000294.jpg 00000669.jpg 00000295.jpg 00000671.jpg 00000296.jpg 00000672.jpg 00000297.jpg 00000673.jpg 00000298.jpg 00000674.jpg 00000299.png 00000675.jpg 00000300.jpg 00000676.jpg 00000301.jpg 00000677.jpg 00000302.jpg 00000678.jpg 00000303.jpg 00000680.jpg 00000304.png 00000681.jpg 00000305.jpeg 00000682.jpg 00000306.jpg 00000684.jpg 00000308.jpg 00000685.jpg 00000309.jpg 00000686.jpg 00000311.jpg 00000687.jpg 00000312.jpg 00000689.jpg 00000314.jpg 00000690.jpg 00000315.jpg 00000691.jpeg 00000317.jpg 00000692.jpg 00000318.jpeg 00000693.jpg 00000319.jpg 00000694.jpg 00000320.jpg 00000695.jpg 00000321.jpg 00000696.jpg 00000322.jpg 00000697.jpg 00000323.jpg 00000698.jpg 00000326.jpg 00000700.jpg 00000327.jpg 00000701.jpg 00000328.jpg 00000703.jpeg 00000329.jpg 00000704.jpg 00000330.jpg 00000705.jpg 00000331.jpg 00000707.jpg 00000332.jpg 00000709.jpg 00000333.jpg 00000710.jpg 00000334.jpg 00000711.jpg 00000335.jpg 00000712.jpg 00000336.jpg 00000713.jpg 00000337.jpg 00000714.jpg 00000338.jpg 00000715.jpg 00000339.jpg 00000716.jpg 00000340.jpg 00000718.jpg 00000341.jpg 00000719.jpg 00000342.jpg 00000722.jpg 00000343.jpg 00000723.jpeg 00000344.jpeg 00000724.jpg 00000345.jpg 00000725.jpg 00000346.jpg 00000726.jpg 00000347.jpg 00000728.jpg 00000348.jpg 00000729.jpg 00000349.jpg 00000730.jpg 00000350.jpg 00000731.jpg 00000351.jpg 00000733.jpg 00000352.jpg 00000734.jpg 00000353.jpg 00000735.jpg 00000354.jpg 00000736.jpg 00000355.jpg 00000738.jpg 00000357.jpg 00000740.JPG 00000358.jpg 00000741.jpg 00000359.jpg 00000742.jpg 00000360.jpg 00000745.jpg 00000361.jpg 00000746.jpg 00000362.jpg 00000747.jpg 00000363.png 00000748.jpg 00000364.jpg 00000751.jpg 00000365.jpg 00000753.jpg 00000366.jpg 00000754.jpg
In [119]:
img = open_image(path/'gorilla'/'00000025.jpg'); img
Out[119]: