You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li><p><strong>dataset</strong> (<em>RemotePathDataset</em>) – The <cite>RemotePathDataset</cite> dataset to load from.</p></li>
60
+
<li><p><strong>num_workers</strong> (<em>int</em><em>, </em><em>optional</em>) – The number of worker threads to use for loading. Default: 0. Must be greater than 0.</p></li>
61
+
<li><p><strong>shuffle</strong> (<em>bool</em><em>, </em><em>optional</em>) – Whether to shuffle the dataset between epochs. Default: False.</p></li>
<p>Creates a PyTorch dataset from a RemotePathIterator.</p>
56
+
<p>By default the dataset will return the image as a tensor and the remote path as a string.</p>
57
+
<p>### Hierarchical mode
58
+
If <cite>hierarchical</cite> >= 1, the dataset is in “Hierarchical mode” and will return the image as a tensor and the label as a list of integers (class indices for each level in the hierarchy).</p>
59
+
<p>The <cite>class_handles</cite> property can be used to get the class-idx mappings for the dataset.</p>
60
+
<p>By default the dataset will use a parser which assumes that the hierarchical levels are encoded in the remote path as directories like so:</p>
<li><p><strong>remote_path_iterator</strong> (<em>RemotePathIterator</em>) – The remote path iterator to create the dataset from.</p></li>
67
+
<li><p><strong>prefetch</strong> (<em>int</em>) – The number of items to prefetch from the remote path iterator.</p></li>
68
+
<li><p><strong>transform</strong> (<em>callable</em><em>, </em><em>optional</em>) – A function/transform that takes in an image as a <cite>torch.Tensor</cite> and returns a transformed version.</p></li>
69
+
<li><p><strong>target_transform</strong> (<em>callable</em><em>, </em><em>optional</em>) – A function/transform that takes in the label (after potential parsing by <cite>parse_hierarchical</cite>) and transforms it.</p></li>
70
+
<li><p><strong>device</strong> (<em>torch.device</em><em>, </em><em>optional</em>) – The device to move the tensors to.</p></li>
71
+
<li><p><strong>dtype</strong> (<em>torch.dtype</em><em>, </em><em>optional</em>) – The data type to convert the tensors to.</p></li>
72
+
<li><p><strong>hierarchical</strong> (<em>int</em><em>, </em><em>optional</em>) – The number of hierarchical levels to use for the labels. Default: 0, i.e. no hierarchy.</p></li>
73
+
<li><p><strong>hierarchy_parser</strong> (<em>callable</em><em>, </em><em>optional</em>) – A function to parse the hierarchical levels from the remote path. Default: None, i.e. use the default parser.</p></li>
74
+
<li><p><strong>return_remote_path</strong> (<em>bool</em><em>, </em><em>optional</em>) – Whether to return the remote path. Default: False.</p></li>
75
+
<li><p><strong>return_local_path</strong> (<em>bool</em><em>, </em><em>optional</em>) – Whether to return the local path. Default: False.</p></li>
Copy file name to clipboardexpand all lines: docs/_build/html/dataloader.html
+9-3
Original file line number
Diff line number
Diff line change
@@ -48,8 +48,11 @@ <h3>Navigation</h3>
48
48
<sectionid="pytorch-integration">
49
49
<h1>PyTorch Integration<aclass="headerlink" href="#pytorch-integration" title="Link to this heading">¶</a></h1>
50
50
<p>Includes a PyTorch IterableDataset and IterableDataLoader for loading data from a remote SFTP server through the pyremotedata.RemotePathIterator class.</p>
51
-
<sectionid="description">
52
-
<h2>Description<aclass="headerlink" href="#description" title="Link to this heading">¶</a></h2>
51
+
<sectionid="module-pyremotedata.dataloader">
52
+
<spanid="description"></span><h2>Description<aclass="headerlink" href="#module-pyremotedata.dataloader" title="Link to this heading">¶</a></h2>
53
+
<sectionid="contents">
54
+
<h3>Contents<aclass="headerlink" href="#contents" title="Link to this heading">¶</a></h3>
0 commit comments