思路:使用模型的特征提取层,转化成向量,然后比对向量的距离(比如cos)
import torch
import torchvision.models as models
import torchvision.transforms as transforms
from PIL import Image
# load model & feature only
model = models.mobilenet_v3_small(pretrained=True)
mode[......]
思路:使用模型的特征提取层,转化成向量,然后比对向量的距离(比如cos)
import torch
import torchvision.models as models
import torchvision.transforms as transforms
from PIL import Image
# load model & feature only
model = models.mobilenet_v3_small(pretrained=True)
mode[......]