#!/usr/bin/env python # coding: utf-8 # In[1]: get_ipython().run_line_magic('reload_ext', 'autoreload') get_ipython().run_line_magic('autoreload', '2') # In[2]: from ktrain.vision.caption import ImageCaptioner from ktrain import vision # In[3]: ic = ImageCaptioner() # In[4]: get_ipython().system('wget https://free-images.com/md/1855/new_york_skyline_usa.jpg -O /tmp/new_york.jpg -q') get_ipython().system('wget https://free-images.com/md/556a/netherlands_landscape_sky_clouds.jpg -O /tmp/netherlands.jpg -q') get_ipython().system('wget https://free-images.com/md/86a4/aroma_aromatic_beverage_bio.jpg -O /tmp/coffee.jpg -q') get_ipython().system('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') # In[6]: vision.show_image('/tmp/netherlands.jpg') ic.caption('/tmp/netherlands.jpg') # In[7]: vision.show_image('/tmp/coffee.jpg') ic.caption('/tmp/coffee.jpg') # In[8]: vision.show_image('/tmp/squirrel.jpg') ic.caption('/tmp/squirrel.jpg') # Well, I guess it kind of looks like cat??? `¯\_(ツ)_/¯` # In[ ]: