{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"markdown","source":"This kernel will produce a subset of the NIH chest x-ray dataset, containing only the images that has bbox annotations and diagnosed as pneumonia. Great for evaluating your model before submitting!\nCommit the kernel and download the resulting output files. There are not that many, about 200."},{"metadata":{"trusted":true,"_uuid":"0035d18fe59253d81639edd01f914a077407add1"},"cell_type":"code","source":"!grep  -i pneu ../input/data/BBox_List_2017.csv>pneumonia.csv","execution_count":null,"outputs":[]},{"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","trusted":true},"cell_type":"code","source":"import glob\nimport zipfile\ninf = open(\"pneumonia.csv\", \"r\")\nmyzip = zipfile.ZipFile('nih_pneumonia.zip', 'w')\nfor l in inf:\n    print(l)\n    r = l[:-1].split(\",\")\n    print(r[0])\n    fn = glob.glob(\"../input/data/images_*/images/\"+r[0])\n    myzip.write(fn[0], arcname=r[0])\nmyzip.close()\n    \n    ","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"1e63a654de6e43a87f63467a76be75b5057a6d54"},"cell_type":"code","source":"ls -l ","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.6.6","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":1}