From c7a55d300050a59e817783c6b68d5bdfd60fe732 Mon Sep 17 00:00:00 2001 From: "Eric.Lee2021" <305141918@qq.com> Date: Sat, 13 Feb 2021 00:01:47 +0800 Subject: [PATCH] update --- README.md | 7 ++++--- inference.py | 4 ++-- read_datasets.py | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 24202f9..9b5b789 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,12 @@ * PyTorch >= 1.5.1 ## 数据集 -采用"Stanford Dogs Dataset"数据集官方地址:http://vision.stanford.edu/aditya86/ImageNetDogs/,且分为训练和测试两部分。 -本文将该数据集的标注文件改为xml格式,可以通过运行read_datasests.py,可以对数据的标注信息进行解析可视化。 +* 采用"Stanford Dogs Dataset"数据集官方地址:http://vision.stanford.edu/aditya86/ImageNetDogs/,且分为训练和测试两部分。 +* 本文将该数据集的标注文件更改为xml格式,[数据集下载地址(百度网盘 Password: ks87 )](https://pan.baidu.com/s/1tT0wF4N2I9p5JDfCwtM1CQ) +* 通过运行read_datasests.py,可以对数据的标注信息进行解析可视化。 ## 预训练模型 -* [预训练模型下载地址: ~ +* [预训练模型下载地址(百度网盘 Password: ks87 )](https://pan.baidu.com/s/1tT0wF4N2I9p5JDfCwtM1CQ) ## 项目使用方法 diff --git a/inference.py b/inference.py index a86ed15..8bb2f82 100644 --- a/inference.py +++ b/inference.py @@ -41,7 +41,7 @@ def get_xml_msg(path): if __name__ == "__main__": parser = argparse.ArgumentParser(description=' Project Classification Test') - parser.add_argument('--test_model', type=str, default = './model_exp/2021-02-09_06-32-32/model_epoch-627.pth', + parser.add_argument('--test_model', type=str, default = './model_exp/2021-02-09_06-32-32/resnet50_epoch-627.pth', help = 'test_model') # 模型路径 parser.add_argument('--model', type=str, default = 'resnet_50', help = 'model : resnet_18,resnet_34,resnet_50,resnet_101,resnet_152') # 模型类型 @@ -177,7 +177,7 @@ if __name__ == "__main__": dict_r[doc] += 1 cv2.destroyAllWindows() - # Top1 的 每类预测精确度。 + # Top1 的每类预测精确度。 print('\n-----------------------------------------------\n') acc_list = [] for idx,doc in enumerate(sorted(os.listdir(ops.test_path), key=lambda x:int(x.split('-')[0]), reverse=False)): diff --git a/read_datasets.py b/read_datasets.py index ba6fd63..30958f6 100644 --- a/read_datasets.py +++ b/read_datasets.py @@ -1,7 +1,7 @@ #-*-coding:utf-8-*- # date:2020-02-08 -# Author: Eric.Lee -## function: read datasets label files +# author: Eric.Lee +# function: read datasets label files import os import cv2 @@ -56,7 +56,7 @@ if __name__ == "__main__": cv2.putText(img_, ('index : ' + str(idx)), (5,img_.shape[0]-5),cv2.FONT_HERSHEY_PLAIN, 1.8, (255, 255, 0), 6) cv2.putText(img_, ('index : ' + str(idx)), (5,img_.shape[0]-5),cv2.FONT_HERSHEY_PLAIN, 1.8, (255, 60, 255), 2) - xml_ = path + doc_+"/"+f_.strip('.jpg').strip('.png')+'.xml' + xml_ = path + doc_+"/"+f_.replace(".jpg",".xml").replace(".png",".xml") list_x = get_xml_msg(xml_)# 获取 xml 文件 的 object -- GitLab