Skip to content

What is the class name of the image? #8

Description

@Gyu007

Hello. I am conducting research using the dataset, and I would like to ask about the names of the 40 classes taken from ImageNet because they are not listed separately.

If possible, please let me know the actual class names or indices of ImageNet!

Activity

  1. ZiyiTsang commented on Mar 16, 2025

    @ZiyiTsang

    Hi, I am also doing this kind of research. May I know if you solve this problem? Do you get the image class name?

  2. Gyu007 commented on Mar 17, 2025

    @Gyu007
    Author

    Hello. I checked the object ID (n0.......etc) and found it by comparing it with the object class name of ImageNet.

  3. ZiyiTsang commented on Mar 18, 2025

    @ZiyiTsang

    Thanks so much for your explanation. It answered my doubts.

  4. MRWang88 commented on Apr 25, 2026

    @MRWang88

    Hello. I checked the object ID (n0.......etc) and found it by comparing it with the object class name of ImageNet.

    Hello, could you please provide me with an example? When I load data from the file eeg_55_95_std.pth, I notice that data for some subjects contains 1,996 trials instead of the expected 2,000. Thank you very much for your help!

  5. MRWang88 commented on Apr 28, 2026

    @MRWang88

    I have learned how to pair images with EEG data, as shown in the code below:

    import torch
    import numpy as np
    from pathlib import Path
    import os
    
    
    block_splits_by_image_all = "xxx/block_splits_by_image_all.pth"
    block_splits_by_image_single = "xxx/block_splits_by_image_single.pth"
    eeg_55_95_std = "xxx/EEG_ImageNet1/eeg_55_95_std.pth"
    eeg_signals_raw_with_mean_std = "xxx/eeg_signals_raw_with_mean_std.pth"
    
    data_image_all = torch.load(block_splits_by_image_all)
    data_image_single = torch.load(block_splits_by_image_single)
    data_eeg_std = torch.load(eeg_55_95_std)
    data_eeg_raw = torch.load(eeg_signals_raw_with_mean_std)
    
    all_images = data_eeg_std['images']
    all_labels = data_eeg_std['labels']
    
    save_root = Path("xxxx")
    for i in range(len(data_eeg_std['dataset'])):
        print(f"第{i}个样本的 dataset:", data_eeg_std['dataset'][i]['subject'])
        sub_id = data_eeg_std['dataset'][i]['subject']
        label = all_labels[data_eeg_std['dataset'][i]['label']]
        image = all_images[data_eeg_std['dataset'][i]['image']]
       
        save_name = f"{sub_id - 1}_{image}.npy"
        os.makedirs(save_root / str("sub_" + str(sub_id-1)) / label, exist_ok=True)
        save_path = save_root / str("sub_" + str(sub_id-1)) / label / save_name
    
        print(f"正在保存: {save_path} | label: {label} | image: {image}")
        np.save(save_path, data_eeg_std['dataset'][i]['eeg'])

    Their paper mentions that a total of 36 bad segments were rejected, so the number of EEG trials for the subject is not 2000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions