Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
358fbb8c
P
PaddleClas
项目概览
PaddlePaddle
/
PaddleClas
大约 2 年 前同步成功
通知
118
Star
4999
Fork
1114
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
6
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleClas
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
6
合并请求
6
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
358fbb8c
编写于
9月 01, 2022
作者:
悟、
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update ppshitu_application_scenarios.md
上级
57b945c0
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
12 addition
and
7 deletion
+12
-7
docs/zh_CN/introduction/ppshitu_application_scenarios.md
docs/zh_CN/introduction/ppshitu_application_scenarios.md
+12
-7
未找到文件。
docs/zh_CN/introduction/ppshitu_application_scenarios.md
浏览文件 @
358fbb8c
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
-
[
2.4.2 基于文件夹的批量识别
](
#242-基于文件夹的批量识别
)
-
[
2.4.2 基于文件夹的批量识别
](
#242-基于文件夹的批量识别
)
-
[
3 新增场景库图像识别体验
](
#3-新增场景库图像识别体验
)
-
[
3 新增场景库图像识别体验
](
#3-新增场景库图像识别体验
)
-
[
3.1 根据相似度划分Gallery和Query
](
#31-根据相似度划分gallery和query
)
-
[
3.1 根据相似度划分Gallery和Query
](
#31-根据相似度划分gallery和query
)
-
[
3.2 根据划分好的Gallery构建index索引
](
#32-根据划分好的gallery构建index索引
)
<a
name=
"1. 应用场景介绍"
></a>
<a
name=
"1. 应用场景介绍"
></a>
...
@@ -263,9 +264,9 @@ Mean of query num: 26
...
@@ -263,9 +264,9 @@ Mean of query num: 26
其中
`Gallery`
和
`Query`
分别为gallery和query库图像,
`gallery_list.txt`
和
`query_list.txt`
分别为对应的标签文件。
其中
`Gallery`
和
`Query`
分别为gallery和query库图像,
`gallery_list.txt`
和
`query_list.txt`
分别为对应的标签文件。
<a
name=
"3.2 根据Gallery
生成index
"
></a>
<a
name=
"3.2 根据Gallery
构建index索引
"
></a>
#### 3.2 根据划分好的Gallery
生成index
#### 3.2 根据划分好的Gallery
构建index索引
首先在配置文件
`configs/sample_indexes.yaml`
中的
`Datasets`
字段中添加新建场景库的信息,格式如下:
首先在配置文件
`configs/sample_indexes.yaml`
中的
`Datasets`
字段中添加新建场景库的信息,格式如下:
```
shell
```
shell
Datasets:
Datasets:
...
@@ -274,9 +275,9 @@ Datasets:
...
@@ -274,9 +275,9 @@ Datasets:
infer_imgs:
"path/to/gallery_list.txt"
infer_imgs:
"path/to/gallery_list.txt"
output_dir:
"path/to/save/index"
output_dir:
"path/to/save/index"
```
```
其中,
`DatasetName`
表示新建场景库的名字,
`infer_path`
为保存新建场景库划分好的gallery图像路径,
`infer_imgs`
为
`gallery_list.txt`
的路径,
`output_path`
为保存
生成index
的路径。
其中,
`DatasetName`
表示新建场景库的名字,
`infer_path`
为保存新建场景库划分好的gallery图像路径,
`infer_imgs`
为
`gallery_list.txt`
的路径,
`output_path`
为保存
构建
`index`
索引
的路径。
然后在配置文件
`configs/sample_indexes.yaml`
中的
`Method`
字段中添加
生成index
的方法,格式如下:
然后在配置文件
`configs/sample_indexes.yaml`
中的
`Method`
字段中添加
构建
`index`
索引
的方法,格式如下:
```
shell
```
shell
Methods:
Methods:
SampleAll:
SampleAll:
...
@@ -286,9 +287,9 @@ Methods:
...
@@ -286,9 +287,9 @@ Methods:
method_name: RandomSample
method_name: RandomSample
gallery_num: 10
gallery_num: 10
```
```
其中PaddleClas提供了两种方法:
`SampleAll`
为根据提供的所有Gallery图像
生成index,
`RandomSample`
为根据提供的Gallery图像每类随机选取
`gallery_num`
张图像生成index,可根据需要选择对应的方法。同时,也可以参考
`shitu_index_selector/index_random_sample.py`
和
`shitu_index_selector/index_sample_all.py`
实现其他图像选择方式生成index
。
其中PaddleClas提供了两种方法:
`SampleAll`
为根据提供的所有Gallery图像
构建
`index`
索引,
`RandomSample`
为根据提供的Gallery图像每类随机选取
`gallery_num`
张图像构建
`index`
索引,可根据需要选择对应的方法。同时,也可以参考
`shitu_index_selector/index_random_sample.py`
和
`shitu_index_selector/index_sample_all.py`
实现其他图像选择方式构建
`index`
索引
。
生成的index
文件结构如下:
构建的
`index`
索引库
文件结构如下:
```
```
├── RandomSample_10
├── RandomSample_10
│ ├── gallery
│ ├── gallery
...
@@ -305,4 +306,8 @@ Methods:
...
@@ -305,4 +306,8 @@ Methods:
├──id_map.pkl
├──id_map.pkl
└──vector.index
└──vector.index
```
```
其中,
`RadomSample`
方法生成index后,会保存随机采样的Gallery图像到
`gallery`
文件夹。
其中,
`RadomSample`
方法构建index索引后,会保存随机采样的Gallery图像到
`gallery`
文件夹。
使用新的
`index`
索引库进行图像识别,需要修改配置文件中的
`IndexProcess.index_dir`
字段来更改索引库的路径。
注意:划分Gallery、构建
`index`
索引库以及进行图像识别时,应当使用同一个识别模型(即三个步骤配置文件中的
`Global.rec_inference_model_dir`
字段保持一致)。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录