In [1]:
%reload_ext autoreload
%autoreload 2
In [2]:
from ktrain.vision.caption import ImageCaptioner
from ktrain import vision
In [3]:
ic = ImageCaptioner()
In [4]:
!wget https://free-images.com/md/1855/new_york_skyline_usa.jpg -O /tmp/new_york.jpg -q
!wget https://free-images.com/md/556a/netherlands_landscape_sky_clouds.jpg -O /tmp/netherlands.jpg -q
!wget https://free-images.com/md/86a4/aroma_aromatic_beverage_bio.jpg -O /tmp/coffee.jpg -q
!wget https://free-images.com/md/176d/squirrel_tail_bushy_tail.jpg -O /tmp/squirrel.jpg -q
In [5]:
vision.show_image('/tmp/new_york.jpg')
ic.caption('/tmp/new_york.jpg')
Out[5]:
'a large body of water with a city skyline'
In [6]:
vision.show_image('/tmp/netherlands.jpg')
ic.caption('/tmp/netherlands.jpg')
Out[6]:
'a grassy field with a boat on the water'
In [7]:
vision.show_image('/tmp/coffee.jpg')
ic.caption('/tmp/coffee.jpg')
Out[7]:
'a cup of coffee sitting on top of a table'
In [8]:
vision.show_image('/tmp/squirrel.jpg')
ic.caption('/tmp/squirrel.jpg')
Out[8]:
'a cat standing on top of a wooden fence'

Well, I guess it kind of looks like cat??? ¯\_(ツ)_/¯

In [ ]: