Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could you please give me an example of arranging ILSVRC2014 dataset? #70

Open
TalentedMUSE opened this issue May 24, 2022 · 7 comments
Open

Comments

@TalentedMUSE
Copy link

I have downloaded ILSVRC2014 and it looks like this:
image
Then I untar the training set, it looks like this:
image


So how to arrange them? Could you give me an example?(For example, the COCO dataset is usually arranged like this: annotations、train2017、val2017)


I am in urgent need and many thanks to you~~

@Saba-Aly
Copy link

Hello did you get an idea about the data arrangements? As I am having problem in validation dataset.

@Xglbrilliant
Copy link

Hello, can you provide the link to download the imagenet2014 dataset?

@czjghost
Copy link

Hello, can you provide the link to download the imagenet2014 dataset?

https://image-net.org/challenges/LSVRC/2014/2014-downloads.php

@czjghost
Copy link

czjghost commented Apr 16, 2023

I also have problem about the arrangement of ILSVRC2014 in this project, it seems that author maybe use ILSVRC2012 rather than ILSVRC2014 ?

update 2023.4.20:
By downloading the ILSVRC2012 and splitting test dataset into the format in "ImageNet_LT_test.txt", the code runs successfully.

dataset holder

|--ImageNet
    |--train
        |--n01440764
        ..
    |--val
        |--n01440764
        ..

Note that, places365 keeps the original file structure, and renaming the holder is enough.

@butcher1226
Copy link

I also have problem about the arrangement of ILSVRC2014 in this project, it seems that author maybe use ILSVRC2012 rather than ILSVRC2014 ?

update 2023.4.20: By downloading the ILSVRC2012 and splitting test dataset into the format in "ImageNet_LT_test.txt", the code runs successfully.

dataset holder

|--ImageNet
    |--train
        |--n01440764
        ..
    |--val
        |--n01440764
        ..

Note that, places365 keeps the original file structure, and renaming the holder is enough.

Sorry to bother, could you tell how to split test dataset into the format in "ImageNet_LT_test.txt", since ILSVRC2012_img_test_v10102019.tar doesn't have the arctecture like test/n01440764

@XRui-Y
Copy link

XRui-Y commented May 15, 2023

我对这个项目中 ILSVRC2014 的安排也有疑问,似乎作者可能使用 ILSVRC2012 而不是 ILSVRC2014 ?
2023.4.20更新:通过下载ILSVRC2012并将测试数据集拆分为“ImageNet_LT_test.txt”中的格式,代码运行成功。
数据集持有者

|--ImageNet
    |--train
        |--n01440764
        ..
    |--val
        |--n01440764
        ..

我对这个项目中 ILSVRC2014 的安排也有疑问,似乎作者可能使用 ILSVRC2012 而不是 ILSVRC2014 ?

2023.4.20更新: 通过下载ILSVRC2012并将测试数据集拆分为“ImageNet_LT_test.txt”中的格式,代码运行成功。

数据集持有者

|--ImageNet
    |--train
        |--n01440764
        ..
    |--val
        |--n01440764
        ..

请注意,places365 保留了原始文件结构,重命名 holder
你好,打扰下,能分享下你是如何将数据集拆分成如下结构的吗
|--ImageNet
|--train
|--n01440764
..
|--val
|--n01440764
..

@czjghost
Copy link

czjghost commented May 30, 2023

Hello, I am coming, about the dataset, first, you should download the original ILSVRC2012, specially, only downloading Training images (Task 1 & 2) and Validation images (all tasks) are enough:
image
In this project, you need to download the corresponding ImageNet-LT and Places-LT from here. Hence, the current structure of "./data" is:

|--data
    |--ImageNet_LT_open
        |--ILSVRC2010_val_00020390.JPEG
        ..
    |--ImageNet_LT_open.txt
    |--ImageNet_LT_test.txt
    |--ImageNet_LT_train.txt
    |--ImageNet_LT_val.txt
        ..

Then, we decompress files “ILSVRC2012_img_train.tar” and “ILSVRC2012_img_val.tar”. Note that, "ILSVRC2012_img_test.tar" is not used in this project. Now, we finish decompression (ILSVRC2012_img_train.tar -> train, ILSVRC2012_img_val.tar -> val_tar):

|--large_scale_dataset
    |--ImageNet
        |--train
        |--val_tar

Then, run the following code to generate test dataset (i.e., val):

import os
from shutil import copy

root = "./oltr/data/ImageNet_LT/ImageNet_LT_test.txt"
source_root = "./large_scale_dataset/ImageNet/val_tar"
target_root = "./large_scale_dataset/ImageNet/val"

with open(root, 'r') as f:
    while True:
        line = f.readline()
        if len(line) <= 1:
            break
        line = line.strip('\n')
        line = line.split(' ')[0]
        file_seq = line.split('/')
        pre_holder = file_seq[1]
        basename = file_seq[-1]
        target = target_root + "/" + pre_holder
        os.makedirs(target, exist_ok=True)
        source = source_root + "/" + basename
        os.makedirs(target, exist_ok=True)
        copy(source, target + "/" + basename)

Finally, you can see the structure in ""./large_scale_dataset/ImageNet/":

|--large_scale_dataset
    |--ImageNet
        |--train
        |--val_tar
        |--val

And the "val" holder( see the following image) is the corresponding test dataset, the "train" holder contains both the training and validation datasets.
image

I try to look back upon full process of generating those holders, if it lacks something, please tell me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants