Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

datasets.py 440 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  1. from typing import Tuple
  2. import torchvision
  3. from torch import Tensor
  4. class KineticsWithVideoId(torchvision.datasets.Kinetics):
  5. def __getitem__(self, idx: int) -> Tuple[Tensor, Tensor, int]:
  6. video, audio, info, video_idx = self.video_clips.get_clip(idx)
  7. label = self.samples[video_idx][1]
  8. if self.transform is not None:
  9. video = self.transform(video)
  10. return video, audio, label, video_idx
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...