class_docstr: PyTorch Hub interface for classy vision tasks and models.
  
  The task is optional, but a model is guaranteed to be present.  Do
  not use the constructor directly, instead Use from_task() or
  from_model() to instantiate the class.
  
  See the examples folder for an example of how to use this class
  
  Attributes:
      task: If present, task that can be used to train the torchhub model
      model: torchub model
class_docstr_tok: ["PyTorch","Hub","interface","for","classy","vision","tasks","and","models",".","The","task","is","optional",",","but","a","model","is","guaranteed","to","be","present",".","Do","not","use","the","constructor","directly",",","instead","Use","from_task","(",")","or","from_model","(",")","to","instantiate","the","class",".","See","the","examples","folder","for","an","example","of","how","to","use","this","class","Attributes",":","task",":","If","present",",","task","that","can","be","used","to","train","the","torchhub","model","model",":","torchub","model"]
docstr: Create a ClassyDataset which reads images from image_paths.
  
  See :class:`dataset.ImagePathDataset` for documentation on image_folder and
  image_files
  
  Args:
      batchsize_per_replica: Minibatch size per replica (i.e. samples per GPU)
      shuffle: If true, data is shuffled between epochs
      transform: Transform to apply to sample. If left as None, the dataset's
          phase_type is used to determine the transform to apply. The transform
          for the phase_type is searched for in self.task, falling back to
          imagenet transformations if it is not found there.
      num_samples: If specified, limits the number of samples returned by
          the dataset
      phase_type: String specifying the phase_type, e.g. "train" or "test"
docstr_tok: ["Create","a","ClassyDataset","which","reads","images","from","image_paths",".","See",":","class",":","`","dataset.ImagePathDataset","`","for","documentation","on","image_folder","and","image_files","Args",":","batchsize_per_replica",":","Minibatch","size","per","replica","(","i.e",".","samples","per","GPU",")","shuffle",":","If","true",",","data","is","shuffled","between","epochs","transform",":","Transform","to","apply","to","sample",".","If","left","as","None",",","the","dataset's","phase_type","is","used","to","determine","the","transform","to","apply",".","The","transform","for","the","phase_type","is","searched","for","in","self.task",",","falling","back","to","imagenet","transformations","if","it","is","not","found","there",".","num_samples",":","If","specified",",","limits","the","number","of","samples","returned","by","the","dataset","phase_type",":","String","specifying","the","phase_type",",","e.g",".","``","train","''","or","``","test","''"]
code: def create_image_dataset(
      self,
      batchsize_per_replica: int = 32,
      shuffle: bool = True,
      transform: Optional[Union[ClassyTransform, Callable]] = None,
      num_samples: Optional[int] = None,
      image_folder: Optional[str] = None,
      image_files: Optional[List[str]] = None,
      phase_type: str = "train",
  ) -> ClassyDataset:
      """Create a ClassyDataset which reads images from image_paths.
  
      See :class:`dataset.ImagePathDataset` for documentation on image_folder and
      image_files
  
      Args:
          batchsize_per_replica: Minibatch size per replica (i.e. samples per GPU)
          shuffle: If true, data is shuffled between epochs
          transform: Transform to apply to sample. If left as None, the dataset's
              phase_type is used to determine the transform to apply. The transform
              for the phase_type is searched for in self.task, falling back to
              imagenet transformations if it is not found there.
          num_samples: If specified, limits the number of samples returned by
              the dataset
          phase_type: String specifying the phase_type, e.g. "train" or "test"
      """
      if transform is None:
          if self.task is not None and phase_type in self.task.datasets:
              # use the transform from the dataset for the phase_type
              dataset = self.task.datasets[phase_type]
              transform = dataset.transform
              assert (
                  transform is not None
              ), "Cannot infer transform from the task"
          else:
              transform = build_field_transform_default_imagenet(
                  config=None, split=phase_type, key_map_transform=None
              )
      return ImagePathDataset(
          batchsize_per_replica,
          shuffle,
          transform,
          num_samples,
          image_folder=image_folder,
          image_files=image_files,
      )
  
file_path: ClassyVision/classy_vision/hub/classy_hub_interface.py
imports: from typing import Any, Callable, Iterator, List, Optional, Union
  import torch
  import torch.nn
  from classy_vision.dataset import ClassyDataset
  from classy_vision.dataset.image_path_dataset import ImagePathDataset
  from classy_vision.dataset.transforms import ClassyTransform
  from classy_vision.dataset.transforms.util import build_field_transform_default_imagenet
  from classy_vision.models import ClassyModel
  from classy_vision.tasks import ClassyTask
label_desc: Use image node_id 4 for calling the ClassyHubInterface obj's underlying member method code with example usage: obj.create_image_dataset(batchsize_per_replica, shuffle, transform, num_samples, image_folder, image_files, phase_type) and returns: ImagePathDataset