[Question] Getting image paths along along with a batch? #897
Unanswered
KnockerPulsar
asked this question in
Q&A
Replies: 1 comment 2 replies
-
@KnockerPulsar ordering for eval/test loaders is consistent (you don't need to include it in any iterable/getitem), you can do it completely out of band. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, thanks for the awesome work.
I'm working on using ViTs to classify some video data. Frame by frame classification is fine and all, but the temporal aspect is also important. Instead of just slapping on an LSTM I wanted to experiment with something: classifying all frames in a video and then choosing the most frequently appearing classification as the final classification for the frame/video.
My main issue is getting the frame's path or really anything to identify it, I've tried forking this repo and editing the scripts on Colab but I hit a brick wall. I'm not really familiar with how the data loaders work but from what I understood I just needed to edit
__getitem__
in the dataset class, I followed that and did that but it seemed to do nothing.Following the code, I discovered that if
no-prefetcher
isFalse
, the code usesPrefetchLoader
which seems to work differently from PyTorch's built in loader. The brick wall I'm currently at is in__iter__
in the line:for next_input, next_target in self.loader:
I tested a bit and it seems that
__getitem__
doesn't seem to affect it. My main issue now is that for example if I make it return, let's say, the read image, the label, and the path and then update the for loop to receive an extra placeholder, It says that it expected 3 values but got 2. So clearly my modification didn't change anything.self.loader
is a black box to me so I don't really know what happens in the for loop statement.Thanks in advance for any help provided.
Beta Was this translation helpful? Give feedback.
All reactions