-
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release 1.1.1.7, cleanup android project documents
- Loading branch information
Showing
14 changed files
with
105 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,83 @@ | ||
# AoE API # | ||
# AoE API | [ ![library-api](https://api.bintray.com/packages/aoe/maven/library-api/images/download.svg) ](https://bintray.com/aoe/maven/library-api/_latestVersion) | ||
|
||
此目录包含了AoE API定义,业务可根据组件接口定义拓展功能实现进行注册。 | ||
AoE 核心 API | ||
|
||
> 参考文档 [概念介绍](./../../../Concept.md) | ||
## 使用 | ||
|
||
## AoeModelOption | ||
``` lang=gradle | ||
implementation "com.didi.aoe:library-api:$aoe_version_name" | ||
``` | ||
|
||
模型配置接口,用户需自定义一个模型描述文件,解析器提取出模型文件信息,用于配套 | ||
Interpreter 加载解析模型文件。框架提供通用流程实现,可根据业务情况进行方便拓展。 | ||
## 核心概念 | ||
## AoeModelOption | ||
|
||
标准模型配置规范是在模型目录下定义模型描述文件: | ||
模型配置接口,AoE 标准模型配置规范是在模型目录下定义模型描述文件: | ||
``` | ||
assets/{feature_name}/model.config | ||
``` | ||
默认是以 Json 格式定义 AoeModelOption 所需的字段内容。 | ||
以 **Json** 格式定义 AoeModelOption 所需的字段内容。 | ||
|
||
允许自定义模型定义文件格式,只需拓展 *AoeModelOption* 接口定义,并配套实现注册 | ||
> 可以自定义模型定义文件格式,只需拓展 *AoeModelOption* 接口定义,并配套实现注册 | ||
[ModelOptionLoaderComponent](#ModelOptionLoaderComponent),自行解析模型描述 | ||
文件。 | ||
|
||
``` | ||
public interface AoeModelOption extends Serializable { | ||
/** | ||
* 模型文件文件夹路径 | ||
* | ||
* @return 文件夹路径 | ||
*/ | ||
@NonNull | ||
String getModelDir(); | ||
/** | ||
* 模型文件名 | ||
* | ||
* @return 模型文件名,不含路径 | ||
*/ | ||
@NonNull | ||
String getModelName(); | ||
@Nullable | ||
String getVersion(); | ||
@NonNull | ||
@ModelSource | ||
String getModelSource(); | ||
/** | ||
* 模型配置验证 | ||
* | ||
* @return true,解析字段符合配置字段基本要求 | ||
*/ | ||
boolean isValid(); | ||
} | ||
``` | ||
|
||
## InterpreterComponent | ||
推理引擎翻译组件,提供对模型文件的加载、推理动作执行,AoE 对应不同的推理引擎提供对应的封装实现,需由用户集成抽象类,实现数据预处理、后处理。 | ||
|
||
> Tips: 示例项目 [Sequeeze](./../../../samples/demo/features/sequeeze) | ||
## Convertor | ||
通过对应推理框架的 InterpreterComponent 抽象子类透传下来需要的接口定义,由用户自行实现输入数据到模型输入数据格式的转换,以及模型结果的处理逻辑。 | ||
|
||
## AoeProcessor | ||
``` lang=kotlin | ||
interface Convertor<TInput, TOutput, TModelInput, TModelOutput> { | ||
/** | ||
* 数据预处理,将输入数据转换成模型输入数据 | ||
* | ||
* @param input 业务输入数据 | ||
* @return 模型输入数据 | ||
*/ | ||
fun preProcess(input: TInput): TModelInput? | ||
框架提供的核心控制接口,包括各组件接口定义。 | ||
/** | ||
* 数据后处理,将模型输出数据转换成业务输出数据 | ||
* | ||
* @param modelOutput 模型输出数据 | ||
* @return 业务输出数据 | ||
*/ | ||
fun postProcess(modelOutput: TModelOutput?): TOutput? | ||
} | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright 2019 The AoE Authors. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
|
||
ext { | ||
aoe_version_name = '1.1.1.7' | ||
} |