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

Why is the splitting of train dataset hardcoded? #10

Closed
GowthamGottimukkala opened this issue Apr 21, 2021 · 3 comments
Closed

Why is the splitting of train dataset hardcoded? #10

GowthamGottimukkala opened this issue Apr 21, 2021 · 3 comments

Comments

@GowthamGottimukkala
Copy link

GowthamGottimukkala commented Apr 21, 2021

While dividing the train set into two classes, why is it hardcoded that first 63 values are one class and the remaining are one? Aren't we supposed to split it using the labels file provided through option.py

RTFM/main.py

Lines 19 to 24 in 950243a

train_nloader = DataLoader(Dataset(args, test_mode=False, is_normal=True),
batch_size=args.batch_size, shuffle=True,
num_workers=0, pin_memory=False, drop_last=True)
train_aloader = DataLoader(Dataset(args, test_mode=False, is_normal=False),
batch_size=args.batch_size, shuffle=True,
num_workers=0, pin_memory=False, drop_last=True)

RTFM/dataset.py

Lines 23 to 34 in 950243a

def _parse_list(self):
self.list = list(open(self.rgb_list_file))
if self.test_mode is False:
if self.is_normal:
self.list = self.list[63:]
print('normal list')
print(self.list)
else:
self.list = self.list[:63]
print('abnormal list')
print(self.list)

@tianyu0207
Copy link
Owner

While dividing the train set into two classes, why is it hardcoded that first 63 values are one class and the remaining are one? Aren't we supposed to split it using the labels file provided through option.py

RTFM/main.py

Lines 19 to 24 in 950243a

train_nloader = DataLoader(Dataset(args, test_mode=False, is_normal=True),
batch_size=args.batch_size, shuffle=True,
num_workers=0, pin_memory=False, drop_last=True)
train_aloader = DataLoader(Dataset(args, test_mode=False, is_normal=False),
batch_size=args.batch_size, shuffle=True,
num_workers=0, pin_memory=False, drop_last=True)

RTFM/dataset.py

Lines 23 to 34 in 950243a

def _parse_list(self):
self.list = list(open(self.rgb_list_file))
if self.test_mode is False:
if self.is_normal:
self.list = self.list[63:]
print('normal list')
print(self.list)
else:
self.list = self.list[:63]
print('abnormal list')
print(self.list)

Yes. I got lazy and hard-coded the weak label for the training set. For the array [:63], all the videos are abnormal and the remaining are normal. This is just a function to provide abnormal/normal list for the dataloader so that I can evenly sample 32 videos for each batch from both classes.

@GowthamGottimukkala
Copy link
Author

GowthamGottimukkala commented Apr 22, 2021

  1. Ok thanks, I'll provide another argument for an input file that has weak labels for the train set along with the already existing test label file argument.
  2. By the way, does that mean the shanghai tech i3d features (list/shanghai-i3d-train-10crop.list) you used have first 64 lines as abnormal ones and the rest are normal ones since you hardcoded it?

@tianyu0207
Copy link
Owner

  1. Ok thanks, I'll provide another argument for an input file that has weak labels for the train set along with the already existing test label file argument.
  2. By the way, does that mean the shanghai tech i3d features (list/shanghai-i3d-train-10crop.list) you used have first 64 lines as abnormal ones and the rest are normal ones since you hardcoded it?
  1. Yes. This is the same setup as the GCN-anomaly paper.

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

2 participants