Giter Club home page Giter Club logo

Comments (2)

SanghyukChun avatar SanghyukChun commented on August 24, 2024

The labels are sorted with the filenames.
You can find the details at the following code:

rebias/datasets/imagenet.py

Lines 121 to 139 in fcd9cc7

def __getitem__(self, index):
path, target = self.dataset[index]
img = self.loader(path)
if self.transform is not None:
img = self.transform(img)
if self.target_transform is not None:
target = self.target_transform(target)
if not self.train and self.val_data == 'ImageNet':
bias_target = [self.clusters[0][index],
self.clusters[1][index],
self.clusters[2][index]]
return img, target, bias_target
else:
return img, target, target
def __len__(self):
return len(self.dataset)

I agree with your idea; sharing the csv file seems a nice idea for many users.
It will be uploaded in a week.

from rebias.

SanghyukChun avatar SanghyukChun commented on August 24, 2024

@rugrag
I just added 9class_imagenet_val.csv to the main branch.
https://github.com/clovaai/rebias/blob/master/clusters/9class_imagenet_val.csv

In [1]: import pandas as pd

In [2]: pd.read_csv('clusters/9class_imagenet_val.csv')
Out[2]:
                                        path category  cluster1  cluster2  cluster3
0     n01641577/ILSVRC2012_val_00001652.JPEG     frog         1         5         3
1     n01641577/ILSVRC2012_val_00003748.JPEG     frog         0         8         4
2     n01641577/ILSVRC2012_val_00004613.JPEG     frog         6         8         0
3     n01641577/ILSVRC2012_val_00004945.JPEG     frog         5         5         3
4     n01641577/ILSVRC2012_val_00005045.JPEG     frog         5         5         3
...                                      ...      ...       ...       ...       ...
2095  n02655020/ILSVRC2012_val_00043777.JPEG     fish         7         6         7
2096  n02655020/ILSVRC2012_val_00044313.JPEG     fish         1         8         0
2097  n02655020/ILSVRC2012_val_00044946.JPEG     fish         7         4         7
2098  n02655020/ILSVRC2012_val_00045811.JPEG     fish         5         5         5
2099  n02655020/ILSVRC2012_val_00049696.JPEG     fish         7         4         5

[2100 rows x 5 columns]

If you have any other question, please don't hesitate to bother me.

from rebias.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.