'transforms' arguments in torchvision.datasets can't use?

haoran-hash: <p>The code snippet is below.<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/b/3/b3a62fad1de6100301b3974fd30de23e71af3e21.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/b3a62fad1de6100301b3974fd30de23e71af3e21" title="屏幕截图 2021-09-21 001147"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/b/3/b3a62fad1de6100301b3974fd30de23e71af3e21_2_690x56.jpeg" alt="屏幕截图 2021-09-21 001147" data-base62-sha1="pDfwdfQxBatxw83Y1BTOYAvYj9n" width="690" height="56" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/b/3/b3a62fad1de6100301b3974fd30de23e71af3e21_2_690x56.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/b/3/b3a62fad1de6100301b3974fd30de23e71af3e21_2_1035x84.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/b/3/b3a62fad1de6100301b3974fd30de23e71af3e21_2_1380x112.jpeg 2x" data-dominant-color="EFEEEF"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">屏幕截图 2021-09-21 001147</span><span class="informations">1395×115 27.8 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/7/f/7fe7d9106d902b4c36187d2d55d3a5b1007a56c7.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/7fe7d9106d902b4c36187d2d55d3a5b1007a56c7" title="屏幕截图 2021-09-21 001219"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/7/f/7fe7d9106d902b4c36187d2d55d3a5b1007a56c7_2_690x226.jpeg" alt="屏幕截图 2021-09-21 001219" data-base62-sha1="ifvmYzzriQ6J7Zc4cINUYJwd1jN" width="690" height="226" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/7/f/7fe7d9106d902b4c36187d2d55d3a5b1007a56c7_2_690x226.jpeg, https://discuss.pytorch.org/uploads/default/original/3X/7/f/7fe7d9106d902b4c36187d2d55d3a5b1007a56c7.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/7/f/7fe7d9106d902b4c36187d2d55d3a5b1007a56c7.jpeg 2x" data-dominant-color="F5F5F5"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">屏幕截图 2021-09-21 001219</span><span class="informations">943×310 27.8 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/8/2/826a01e2584c8e72be9dd19e847ec476ba89932c.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/826a01e2584c8e72be9dd19e847ec476ba89932c" title="屏幕截图 2021-09-21 001234"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/8/2/826a01e2584c8e72be9dd19e847ec476ba89932c_2_690x319.jpeg" alt="屏幕截图 2021-09-21 001234" data-base62-sha1="iBHbPJYJPJxLL23kpLRVvSzIVsM" width="690" height="319" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/8/2/826a01e2584c8e72be9dd19e847ec476ba89932c_2_690x319.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/8/2/826a01e2584c8e72be9dd19e847ec476ba89932c_2_1035x478.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/8/2/826a01e2584c8e72be9dd19e847ec476ba89932c.jpeg 2x" data-dominant-color="F5F8F5"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">屏幕截图 2021-09-21 001234</span><span class="informations">1291×597 130 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
The ‘transforms’ argument can’t use?</p>

ptrblck: <p><a href="https://github.com/pytorch/pytorch/issues/65312#issuecomment-923131438">Related issue</a></p>
<p>The linked object detection tutorial links to the <a href="https://github.com/pytorch/vision/blob/74ac47e3c3944be1e91281cb9685f907d9177512/references/detection/transforms.py"><code>references/detection/transforms.py</code></a>, which implement transformations accepting an input and target tensor, so you would need to copy these fles (or <code>git clone</code>) to your workspace.</p>

haoran-hash: <p>Thank you, I get it.<br>
But I want to know why not torchvision integrate these transforms(do same transform in image and target) internal?</p>

ptrblck: <p>I don’t know, but guess because there might have been concerns about overriding the default transformations.</p>

haoran-hash: <p>I get it. Thank you.</p>