当前位置:网站首页>Understand test.py in gaitset
Understand test.py in gaitset
2022-07-26 12:28:00 【Dance rain】
''' Tab: Concepts that must be understood before learning You need to have a database first , Gaitset It has generalization ability , Gaitset It's not learning to train people's gait characteristics , But learn how to be in a group of people ( In the database ) Find the data closest to the probe . So when in use , The database can be changed at any time without retraining . probe set And gallery set The training set has probe set And gallery set The test suite also has . Refers to from gallery set out every last gallery The extracted features , Again from probe set out One probe The extracted features , The final calculation probe Characteristics and gallery set every last gallery The distance between the features of , Find the nearest ( The gap is the smallest ) As a result of identification All the results are in 11 Take the average of the perspectives , And it doesn't include the same perspective . for example , visual angle 36° The accuracy of the probe is average ! except 36° outside ! Of 10 A point of view . ''' # Import package from datetime import datetime import numpy as np import argparse from model.initialization import initialization from model.utils import evaluation from config import conf # Determine whether the string writes the correct function def boolean_string(s): if s.upper() not in {'FALSE', 'TRUE'}: raise ValueError('Not a valid boolean string') return s.upper() == 'TRUE' # Pass in parameters... From the command line parser = argparse.ArgumentParser(description='Test') parser.add_argument('--iter', default='80000', type=int, help='iter: iteration of the checkpoint to load. Default: 80000') parser.add_argument('--batch_size', default='1', type=int, help='batch_size: batch size for parallel test. Default: 1') parser.add_argument('--cache', default=False, type=boolean_string, help='cache: if set as TRUE all the test data will be loaded at once' ' before the transforming start. Default: FALSE') opt = parser.parse_args() # Exclude identical-view cases # Subtract the diagonal data , That is, data from the same perspective ,each_angle=True Means only take NM,BG,CL Three respective 11/10 The average of angles def de_diag(acc, each_angle=False): result = np.sum(acc - np.diag(np.diag(acc)), 1) / 10.0 if not each_angle: result = np.mean(result) return result # Model initialization + Data initialization m = initialization(conf, test=opt.cache)[0] # load model checkpoint of iteration opt.iter print('Loading the model of iteration %d...' % opt.iter) m.load(opt.iter) print('Transforming...') time = datetime.now() test = m.transform('test', opt.batch_size) # Evaluate the accuracy of data set acquisition # among acc Is a four-dimensional array (p, v1, v2, accuracy) # p==1 Express NM p==2 Express BG p==3 Express CL print('Evaluating...') acc = evaluation(test, conf['data']) print('Evaluation complete. Cost:', datetime.now() - time) # Print rank-1 accuracy of the best model # translate : # rank-1 Accuracy of five of the five categories rank-5 The accuracy of one of the five categories # e.g. # ===Rank-1 (Include identical-view cases)=== # translate : # Don't rule out the same perspective # NM: 95.405, BG: 88.284, CL: 72.041 for i in range(1): print('===Rank-%d (Include identical-view cases)===' % (i + 1)) print('NM: %.3f,\tBG: %.3f,\tCL: %.3f' % ( np.mean(acc[0, :, :, i]), np.mean(acc[1, :, :, i]), np.mean(acc[2, :, :, i]))) # Print rank-1 accuracy of the best model,excluding identical-view cases # e.g. # ===Rank-1 (Exclude identical-view cases)=== # translate : # Exclude the same perspective # NM: 94.964, BG: 87.239, CL: 70.355 for i in range(1): print('===Rank-%d (Exclude identical-view cases)===' % (i + 1)) print('NM: %.3f,\tBG: %.3f,\tCL: %.3f' % ( de_diag(acc[0, :, :, i]), de_diag(acc[1, :, :, i]), de_diag(acc[2, :, :, i]))) # Print rank-1 accuracy of the best model (Each Angle) # e.g. # ===Rank-1 of each angle (Exclude identical-view cases)=== # translate : # Exclude the same perspective # VE: [00.00 18.00 36.00 54.00 72.00 90.00 108.0 126.0 144.0 162.0 180.0] # NM: [90.80 97.90 99.40 96.90 93.60 91.70 95.00 97.80 98.90 96.80 85.80] # @ -------------------------- NM Split line ------------------------------ @ # # BG: [86.30 91.30 93.30 89.90 85.50 80.50 84.50 90.40 92.30 92.12 82.20] # CL: [69.10 78.90 79.00 76.80 69.20 67.80 70.30 73.40 74.60 70.70 58.30] # np.set_printoptions()—— Control output mode # precision: Control the number of decimal points of the output , The default is 8 np.set_printoptions(precision=2, floatmode='fixed') for i in range(1): print('===Rank-%d of each angle (Exclude identical-view cases)===' % (i + 1)) print("View:", end='') for view in range(0, 181, 18): if view == 0: print(str(view)+'0.00', end=' ') elif 100 < view < 180: print(str(view) + '.0', end=' ') elif view == 180: print(str(view) + '.00', end='') else: print(str(view) + '.00', end=' ') print('') print('NM:', de_diag(acc[0, :, :, i], True)) print('BG:', de_diag(acc[1, :, :, i], True)) print('CL:', de_diag(acc[2, :, :, i], True))
边栏推荐
- Shell变量和引用
- 10. 509. Introduction to PKCs file format
- Pytest interface automation test framework | use decorators to decorate the use cases that need to be run
- 2022.7.23 ------ leetcode. Jianzhi offer.115
- UE5 官方案例Lyra 全特性详解 7.资源管理
- Ds-24c/dc220v time relay
- STM32驱动HC05蓝牙串口通信模块
- 儿童玩乐场所如何运营?
- .eslintrc.js configuration description
- Flutter JNI confusion introduction.So file release package flash back
猜你喜欢

面试京东T5,被按在地上摩擦,鬼知道我经历了什么?

Emerging security providers to learn about in 2022

DS-24C/DC220V时间继电器

10. 509. Introduction to PKCs file format

Implementation of dynamic and static libraries (packaging dynamic and static libraries for others to use)

Digital intelligence transformation, management first | jnpf strives to build a "full life cycle management" platform

FPGA入门学习(二) - 二选一的选择器

【2243】module_param.m

【2243】module_ param.m

How does the chain store cashier system help shoe stores manage their branches?
随机推荐
Redis master-slave replication principle
Paper reading MLPD: multi label pedestrian detector in multispectral domain (Internship Program of Hikvision Research Institute)
MATLAB中strjoin函数使用
Pytest interface automation test framework | setup and teardown functions of pytest
X.509、PKCS文件格式介绍
如何组装一个注册中心?
Oracle AWR 报告脚本:SQL ordered by Elapsed Time
Jsj-3/ac220v time relay
y9000p2022重装win10问题
Backtracking - question 51 Queen n -- a classic backtracking problem that must be overcome
FPGA入门学习(二) - 二选一的选择器
How much do you know about the two infrastructures of the badminton stadium?
一些常用的文章写作使用方法和技巧
Oracle的Windows版本能在linux中使用吗?
C语言文件知识点
回溯——46. 全排列
El form displays two columns per row, with the bottom button centered
2022.7.23 ------ leetcode. Jianzhi offer.115
MySQL组合索引(多列索引)使用与优化
Backtracking - 131. Split palindrome string