add imagenet
This commit is contained in:
parent
ab409da89e
commit
c1c6226f7f
@ -26,7 +26,7 @@ pip install requirements.txt
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
### Prepare Dataset
|
### Prepare Dataset
|
||||||
The cifar10 dataset can be downloaded automatically by torchvision. But the imagenet dataset should be downloaded manually and put in the right place, refer to [dataset.py](https://github.com/chunbaobao/Deep-JSCC-PyTorch/blob/main/dataset.py#L28). And run:
|
The cifar10 dataset can be downloaded automatically by torchvision. But the imagenet dataset should be downloaded manually from [ImageNet website](https://image-net.org/) and put in the right place, refer to [dataset.py](https://github.com/chunbaobao/Deep-JSCC-PyTorch/blob/main/dataset.py#L28). And run:
|
||||||
```
|
```
|
||||||
python dataset.py
|
python dataset.py
|
||||||
```
|
```
|
||||||
|
|||||||
@ -23,9 +23,10 @@ class Vanilla(Dataset):
|
|||||||
def main():
|
def main():
|
||||||
data_path = './Dataset'
|
data_path = './Dataset'
|
||||||
os.makedirs(data_path, exist_ok=True)
|
os.makedirs(data_path, exist_ok=True)
|
||||||
|
# ILSVRC2012_img_train.tar and ILSVRC2012_img_val.tar should be downloaded from https://image-net.org/
|
||||||
if not os.path.exists('./Dataset/ILSVRC2012_img_train.tar') or not os.path.exists('./Dataset/ILSVRC2012_img_val.tar'):
|
if not os.path.exists('./Dataset/ILSVRC2012_img_train.tar') or not os.path.exists('./Dataset/ILSVRC2012_img_val.tar'):
|
||||||
print('Please download the dataset from http://www.image-net.org/challenges/LSVRC/2012/downloads and put it in ./Dataset')
|
print('ILSVRC2012_img_train.tar and ILSVRC2012_img_val.tar should be downloaded from https://image-net.org/')
|
||||||
|
print('Please download the dataset from https://image-net.org/challenges/LSVRC/2012/2012-downloads and put it in ./Dataset')
|
||||||
raise Exception('not find dataset')
|
raise Exception('not find dataset')
|
||||||
phases = ['train', 'val']
|
phases = ['train', 'val']
|
||||||
for phase in phases:
|
for phase in phases:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user