This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # script to fully prepare ImageNet dataset | |
| ## 1. Download the data | |
| # get ILSVRC2012_img_val.tar (about 6.3 GB). MD5: 29b22e2961454d5413ddabcf34fc5622 | |
| # wget https://image-net.org/data/ILSVRC/2012/ILSVRC2012_img_val.tar | |
| # get ILSVRC2012_img_train.tar (about 138 GB). MD5: 1d675b47d978889d74fa0da5fadfb00e | |
| # wget https://image-net.org/data/ILSVRC/2012/ILSVRC2012_img_train.tar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pickle | |
| import lmdb | |
| from torch.utils.data import Dataset, DataLoader | |
| import os | |
| from tqdm import tqdm | |
| def _dumps_pickle(obj) -> bytes: | |
| return pickle.dumps(obj) |