{"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_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# Download Validation Set\nAs the ILSVRC dataset is only available using kaggle and you can only download the whole DB using the CLI and the web page, I found a way to download only the validation set I needed. ","metadata":{}},{"cell_type":"markdown","source":"1. Lets be sure that the DB is in the folder:  You should see a list of 10 images called `ILSVRC2012_val_xxxxxxxx.JPEG`","metadata":{}},{"cell_type":"code","source":"! ls /kaggle/input/imagenet-object-localization-challenge/ILSVRC/Data/CLS-LOC/val | tail","metadata":{"execution":{"iopub.status.busy":"2022-11-26T13:11:36.06018Z","iopub.execute_input":"2022-11-26T13:11:36.061278Z","iopub.status.idle":"2022-11-26T13:11:39.702174Z","shell.execute_reply.started":"2022-11-26T13:11:36.06115Z","shell.execute_reply":"2022-11-26T13:11:39.700321Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"![imagenet-dir](https://github.com/joao-parana/machine-learning-articles/raw/main/images/imagenet-dir.png)\n","metadata":{}},{"cell_type":"markdown","source":"","metadata":{}},{"cell_type":"markdown","source":"2. Lets compress the images into a `val.tar.gz` file. This will take a while...","metadata":{}},{"cell_type":"code","source":"!tar -czf val.tar.gz /kaggle/input/imagenet-object-localization-challenge/ILSVRC/Data/CLS-LOC/val","metadata":{"execution":{"iopub.status.busy":"2022-11-26T13:11:54.195714Z","iopub.execute_input":"2022-11-26T13:11:54.196203Z","iopub.status.idle":"2022-11-26T13:22:52.561979Z","shell.execute_reply.started":"2022-11-26T13:11:54.196161Z","shell.execute_reply":"2022-11-26T13:22:52.558343Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!ls -la val.tar.gz","metadata":{"execution":{"iopub.status.busy":"2022-11-26T13:51:36.032775Z","iopub.execute_input":"2022-11-26T13:51:36.034242Z","iopub.status.idle":"2022-11-26T13:51:37.120166Z","shell.execute_reply.started":"2022-11-26T13:51:36.034179Z","shell.execute_reply":"2022-11-26T13:51:37.118498Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"3. An now let's generate a hyperlink to the compressed file.","metadata":{}},{"cell_type":"code","source":"from IPython.display import FileLink\n\nFileLink(r'val.tar.gz')","metadata":{"execution":{"iopub.status.busy":"2022-11-26T13:51:54.187445Z","iopub.execute_input":"2022-11-26T13:51:54.18793Z","iopub.status.idle":"2022-11-26T13:51:54.199717Z","shell.execute_reply.started":"2022-11-26T13:51:54.187878Z","shell.execute_reply":"2022-11-26T13:51:54.19847Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Now just click in the hyperlink above and the download will start!. (app 6GB)\n\n\nFin!","metadata":{}}]}