【问题标题】:How can I embed the image downsampling code into my classification code?如何将图像下采样代码嵌入到我的分类代码中?
【发布时间】:2022-01-22 17:15:39
【问题描述】:

在哪里可以找到图像下采样的代码?以及如何将其嵌入到我的分类代码中?最好有完整的下采样代码供大家学习。

【问题讨论】:

    标签: image-processing pytorch image-classification pytorch-dataloader


    【解决方案1】:

    看看 pytorch 中的transforms functions。您可以在数据加载器中调用它们,如here 所述:

    transformed_dataset = FaceLandmarksDataset(csv_file='data/faces/face_landmarks.csv',
                                               root_dir='data/faces/',
                                               transform=transforms.Compose([
                                                   Rescale(256),
                                                   RandomCrop(224),
                                                   ToTensor()
                                               ]))
    

    【讨论】:

    • 非常感谢!我可以再问一个问题吗? transforms.resize() 是一种对图像进行上采样的方法吗?
    猜你喜欢
    • 1970-01-01
    • 2012-12-15
    • 2012-06-08
    • 2019-09-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-08
    • 2021-05-10
    相关资源
    最近更新 更多