configs

c o n f i g s configs configs

Yaml文件

#                                              retrieval settings
# 1.数据读取和预处理模块
datasets:
  # number of images in a batch.
  batch_size: 16

  # function for stacking images in a batch.
  # 这是加载图片的方式,可以不用管
  
  collate_fn:
    name: "CollateFn"  # name of the collate_fn.

  # function for loading images.
  # 这是加载图片的方式,可以不用管
  folder:
    name: "Folder"  # name of the folder.

  # a list of data augmentation functions.
  # 图片预处理变化
  # 这里的预处理需要和fintune.py里面特征提取器的验证集处理一致
  
  transformers:
    # names: ["PadResize", "ToTensor", "Normalize"]  # names of transformers.
    # CenterCrop
    names: ["CenterCrop","TwoFlip","ToTensor", "Normalize"]
    #PadResize:
    CenterCrop:
      #size: 224  # target size of the longer edge.
      size: 512
    Normalize:
      #mean: [0.485, 0.456, 0.406]
      #std: [0.229, 0.224, 0.225]
      mean: [0.4914, 0.4822, 0.4465]
      std: [0.2023, 0.1994, 0.2010]





# 2.确立backbone模块
model:
  #name: "resnet50"  # name of the model.
  name: "ft_net_50"
  #resnet50:
  #ft_net_own:
  ft_net_50:
    #load_checkpoint: "torchvision://resnet50"  # path of the model checkpoint. If it is started with "torchvision://", the model will be loaded from torchvision.
    #load_checkpoint: "/data/nextcloud/dbc2017/files/jupyter/model/model_resnet_best0821.pth" 
    load_checkpoint: "/data/nextcloud/dbc2017/files/jupyter/model/res50_512_best.pth" 






# 3.抽取模块
extract:
  # way to assemble features if transformers produce multiple images (e.g. TwoFlip, TenCrop). 0 means concat these features and 1 means sum these features.
  assemble: 0

  # function for assigning output features.
  extractor:
    name: "ResSeries"  # name of the extractor.
    ResSeries:
      extract_features: ["pool5"]  # name of the output feature map. If it is ["all"], then all available features will be output.

  # function for splitting the output features (e.g. PCB).
  splitter:
    name: "Identity"  # name of the function for splitting features.

  # a list of pooling functions.
  aggregators:
    names: ["GeM"]  # names of aggregators.





# 4.匹配模块
index:
  # path of the query set features and gallery set features.
  # 特征地址
  query_fea_dir: "/data/features/caltech/query"
  gallery_fea_dir: "/data/features/caltech/gallery"

  # name of the features to be loaded. It should be "output feature map" + "_" + "aggregation".
  # If there are multiple elements in the list, they will be concatenated on the channel-wise.
  # 使用什么特征用来匹配特征
  feature_names: ["pool5_GeM"]

  # a list of dimension process functions.
  # 对选取特征进行预处理
  dim_processors:
    # 确定预处理操作
    names: ["L2Normalize", "PCA", "L2Normalize"]  # names of dimension processors.
    # 每一种预处理操作的参数设置
    PCA:
      proj_dim: 512  # the dimension after reduction. If it is 0, then no reduction will be done.
      whiten: False  # whether do whiten when using PCA.
      train_fea_dir: "/data/features/caltech/gallery"  # path of the features for training PCA.
      l2: True  # whether do l2-normalization on the training features.

  # function for enhancing the quality of features.
  feature_enhancer:
    # Identity 表示恒等,在这里就是无操作
    name: "Identity"  # name of the feature enhancer.
    # name: "DBA"
    # DBA:
      # enhance_k: 5  # number of the nearest points to be calculated.

  # function for calculating the distance between query features and gallery features.
  # 如何找top-k:使用KNN找top-k
  metric:
    name: "KNN"  # name of the metric.

  # function for re-ranking the results.
  # 重排序
  re_ranker:
    # Identity 表示恒等,在这里就是
    name: "Identity"  # name of the re-ranker.
#     name: "QEKR"
#     QEKR:
#       qe_times: 1  # number of query expansion times.
#       qe_k: 10  # number of the neighbors to be combined.
#       k1: 20  # hyper-parameter for calculating jaccard distance.
#       k2: 6  # hyper-parameter for calculating local query expansion.
#       lambda_value: 0.3  # hyper-parameter for calculating the final distance.





# 5.评价模块
evaluate:
  # function for evaluating results.
  evaluator:
    name: "OverAll"  # name of the evaluator.
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值