def predict_eval(target, predict_path): if target == 'market' or target == 'market-r': market_result_eval(predict_path, TEST='/home/cwh/coding/Market-1501/test', QUERY='/home/cwh/coding/Market-1501/probe') elif 'grid' in target: grid_result_eval(predict_path) elif 'duke' == target: market_result_eval(predict_path, log_path='duke_eval.log', TEST='/home/cwh/coding/DukeMTMC-reID/test', QUERY='/home/cwh/coding/DukeMTMC-reID/probe') elif 'dukehead' == target: market_result_eval(predict_path, log_path='duke_head_eval.log', TEST='/home/cwh/coding/dukehead/test', QUERY='/home/cwh/coding/dukehead/probe') elif 'duketail' == target: market_result_eval(predict_path, log_path='duke_tail_eval.log', TEST='/home/cwh/coding/duketail/test', QUERY='/home/cwh/coding/duketail/probe') elif 'duketqtail' == target: market_result_eval(predict_path, log_path='duke_tqtail_eval.log', TEST='/home/cwh/coding/duketqtail/test', QUERY='/home/cwh/coding/duketqtail/probe') elif 'dukequerytail' == target: market_result_eval(predict_path, log_path='duke_querytail_eval.log', TEST='/home/cwh/coding/dukequerytail/test', QUERY='/home/cwh/coding/dukequerytail/probe')
def grid_eval(source, transform_dir): target = 'grid' for i in range(10): test_pair_predict(source + '_pair_pretrain.h5', transform_dir + 'cross%d' % i + '/probe', transform_dir + 'cross%d' % i + '/test', source + '_' + target + '_pid.log', source + '_' + target + '_score.log') grid_result_eval(source + '_' + target + '_pid.log', 'gan.log')
def predict_eval(target, predict_path): if target == 'market' or target == 'market-r': market_result_eval(predict_path) elif target == 'markets1' or target == 'markets1-r': market_result_eval(predict_path, TEST='/home/cwh/coding/markets1/test', QUERY='/home/cwh/coding/markets1/probe') elif 'grid' in target: grid_result_eval(predict_path)
def predict_eval(target, predict_path): if target == 'market' or target == 'market-r': market_result_eval(predict_path, TEST = '/home/cwh/coding/Market-1501/test', QUERY = '/home/cwh/coding/Market-1501/probe') elif 'grid' in target: grid_result_eval(predict_path) elif 'duke' in target: market_result_eval(predict_path, log_path='duke_eval.log', TEST = '/home/cwh/coding/DukeMTMC-reID/test', QUERY = '/home/cwh/coding/DukeMTMC-reID/probe')
def grid_eval(source, transform_dir, log_dir): target = 'grid' for i in range(10): test_pair_predict(source + '_pair_pretrain.h5', transform_dir + '/cross%d' % i + '/probe', transform_dir + '/cross%d' % i + '/test', '%s_%s_cv%d_pid.log' % (source, target, i), source + '_' + target + '_score.log') grid_result_eval('%s_%s_cv%d_pid.log' % (source, target, i), log_dir)
def grid_eval(source, transform_dir): target = 'grid' for i in range(10): test_pair_predict(source + '_pair_pretrain.h5', transform_dir + 'cross%d' % i + '/probe', transform_dir + 'cross%d' % i + '/test', source + '_' + target + '_pid.log', source + '_' + target + '_score.log') grid_result_eval(source + '_' + target + '_pid.log', 'gan.log') def market_eval(source, transform_dir): target = 'market' test_pair_predict(source + '_pair_pretrain.h5', transform_dir + '/probe', transform_dir + '/test', source + '_' + target + '_pid.log', source + '_' + target + '_score.log') if __name__ == '__main__': # market_eval('market', '/home/cwh/coding/Market-1501') # market_result_eval('market_market_pid.log', # TEST='/home/cwh/coding/Market-1501/test', # QUERY='/home/cwh/coding/Market-1501/probe') # grid_eval('market', '/home/cwh/coding/grid_train_probe_gallery/cross0') grid_result_eval( '/content/TFusion/TrackViz/data/market_grid-cv0-test/cross_filter_pid.log' )
def grid_eval(source, transform_dir): target = 'grid' for i in range(10): test_pair_predict(source + '_pair_pretrain.h5', transform_dir + 'cross%d' % i + '/probe', transform_dir + 'cross%d' % i + '/test', source + '_' + target + '_pid.log', source + '_' + target + '_score.log') grid_result_eval(source + '_' + target + '_pid.log', 'gan.log') def market_eval(source, transform_dir): target = 'market' test_pair_predict(source + '_pair_pretrain.h5', transform_dir + '/probe', transform_dir + '/test', source + '_' + target + '_pid.log', source + '_' + target + '_score.log') if __name__ == '__main__': # market_eval('market', '/home/cwh/coding/Market-1501') # market_result_eval('market_market_pid.log', # TEST='/home/cwh/coding/Market-1501/test', # QUERY='/home/cwh/coding/Market-1501/probe') # grid_eval('market', '/home/cwh/coding/grid_train_probe_gallery/cross0') grid_result_eval( '/home/cwh/coding/TrackViz/data/market_grid-cv0-test/cross_filter_pid.log' )