
图像处理
麓山南麓
某221机械专业本科生
展开
-
梯度反转层
源码地址:https://github.com/fungtion/DANN_py3 from torch.autograd import Function class ReverseLayerF(Function): @staticmethod def forward(ctx, x, alpha): ctx.alpha = alpha return x.view_as(x) @staticmethod def backward(ctx,原创 2021-11-13 12:48:57 · 848 阅读 · 0 评论 -
PIL、opencv、scipy三者互相转换
PIL与opencv需要通过一定方法转换,然后转换颜色通道顺序。 scipy与opencv两者都是numpy矩阵,uint8,范围为0-255,通过颜色通道顺序就可以实现转换 path= './datasets/clothes_color_domain_train/color_domain_0000005.jpg' import cv2 from PIL import Image import numpy as np from scipy.misc import imread #PIL转opencv原创 2021-11-02 20:44:05 · 2461 阅读 · 0 评论