{"metadata": {"language_info": {"mimetype": "text/x-python", "pygments_lexer": "ipython3", "codemirror_mode": {"name": "ipython", "version": 3}, "nbconvert_exporter": "python", "name": "python", "file_extension": ".py", "version": "3.6.1"}, "kernelspec": {"language": "python", "name": "python3", "display_name": "Python 3"}}, "nbformat": 4, "nbformat_minor": 0, "cells": [{"metadata": {"collapsed": false, "_cell_guid": "605f1ca9-27a8-434a-bc5a-92bc472e79a3", "_uuid": "8018636b051e1b903066c21ad9ca01f76f2f3b82", "_execution_state": "idle"}, "execution_count": null, "outputs": [], "source": "Simple preview of car images and their respective masks", "cell_type": "markdown"}, {"metadata": {"collapsed": false, "_cell_guid": "a97105da-df3d-4ed2-9337-523e1328c3d2", "_uuid": "9cc9824e026457899a38b1e902edb352c4a2cd63", "trusted": false, "_execution_state": "idle"}, "execution_count": null, "outputs": [], "source": "\nimport os\nimport cv2\nfrom matplotlib import pyplot as plt\nfrom PIL import Image\n\n%matplotlib inline\n\ntrain_images = [x for x in os.listdir('../input/train') if x.endswith('.jpg')]\n\nfig = plt.figure(figsize=(20, 30))\n\nfor i,f in enumerate(train_images[:5]):  # look at first 5 \n    car = f.split('.')[0]\n    img = cv2.imread('../input/train/{0}.jpg'.format(car), 1)\n    mask = Image.open('../input/train_masks/{0}_mask.gif'.format(car))\n\n\n    fig.add_subplot(5, 2, 2*i+1)\n    plt.imshow(img)\n\n    fig.add_subplot(5, 2, 2*i+2)\n    plt.imshow(mask)", "cell_type": "code"}, {"metadata": {"collapsed": false, "_cell_guid": "2ff041f3-f7e3-440a-b5d1-12d613ab74d9", "_uuid": "ab13392d6da4804ea7087ac7374f744f95eb0247", "trusted": false, "_execution_state": "idle"}, "execution_count": null, "outputs": [], "source": "", "cell_type": "code"}]}