|
@@ -125,11 +125,13 @@ if __name__ == '__main__':
|
|
|
correct = 0
|
|
|
# onnx_files = find_onnx_files(os.path.join(args.target_dir, model_dir))
|
|
|
onnx_files = find_om_files(os.path.join(args.target_dir, model_dir))
|
|
|
+ print(f"找到模型文件: {len(onnx_files)} 个")
|
|
|
onnx_files = [os.path.abspath(item) for item in onnx_files]
|
|
|
if args.model_file_filter:
|
|
|
onnx_files = [item for item in onnx_files if args.model_file_filter in item]
|
|
|
else:
|
|
|
- onnx_files = [item for item in onnx_files if "pruned" not in item]
|
|
|
+ # onnx_files = [item for item in onnx_files if "pruned" not in item]
|
|
|
+ onnx_files = [item for item in onnx_files]
|
|
|
print(f"model_name: {model_dir}\nonnx_files:")
|
|
|
print(*onnx_files, sep='\n')
|
|
|
for onnx_file in onnx_files:
|
|
@@ -149,4 +151,7 @@ if __name__ == '__main__':
|
|
|
print(f"验证成功: {correct}个")
|
|
|
print(f"成功率计算说明:(验证成功个数 * 100.0 / 总验证个数)%")
|
|
|
print("------------------准确率指标如下-------------------------")
|
|
|
- print(f"模型名称: {model_dir}, 准确率: {correct * 100.0 / total}%")
|
|
|
+ if total == 0:
|
|
|
+ print("无可用模型,准确率未计算")
|
|
|
+ else:
|
|
|
+ print(f"模型目录: {args.target_dir}, 准确率: {correct * 100.0 / total:.2f}%")
|