{"cells":[{"metadata":{"trusted":true},"cell_type":"code","source":"# Prepare the python environment\nwith open('requirements.txt', 'w') as file:\n    file.write('''\\\nKeras==2.2.4\ntensorflow<1.15.2\nclick\nmatplotlib\nnumpy\npandas\nPillow\nscikit-image==0.15.0\nscikit-learn\nscipy''')\n\n!conda env create --file requirements.txt -n myenv","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# copy code and pre-trained model\n!cp -r ../input/keras-o-o-code/* ./","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","trusted":true},"cell_type":"code","source":"# load and extract dataset into data/\n!apt install p7zip-full -y\n!7z x ../input/diabetic-retinopathy-detection/test.zip.001 \"-i!test/111*.jpeg\" # restrict extracted file to about 100 for the disk restriction\n!mkdir data\n!mv test data/test","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# pre-process the testing images\n!python3 convert.py --crop_size 512 --convert_directory data/test_medium --extension jpg --directory data/test","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# run the model testing code\n!bash -c 'source activate myenv; python eval_nn.py --cnf configs/c_512_4x4_32.py --weights_from weights/o_O-DR-detector-c_512_4x4_32.h5'","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat":4,"nbformat_minor":4}