Skip to content

Commit

Permalink
[DOC][UPD] modify image links in doc (#1617)
Browse files Browse the repository at this point in the history
Co-authored-by: ealinli <ealinli@tencent.com>
  • Loading branch information
1627180283 and ealinli committed Apr 6, 2022
1 parent 3485da1 commit 900e4df
Show file tree
Hide file tree
Showing 17 changed files with 62 additions and 62 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[中文版本](README_CH.md)
<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/TNN.png"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/TNN.png"/>

## Introduction

Expand Down Expand Up @@ -67,7 +67,7 @@ At present, TNN has been launched in various major businesses, and its following

* TNN architecture diagram:

<div><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/en/imgs/tnn_architect.jpg"/>
<div><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/en/imgs/tnn_architect.jpg"/>

* TNN supports TensorFlow, Pytorch, MxNet, Caffe, and other training frameworks through ONNX, leveraging the continuous improvement of the ONNX open-source society.
Currently, TNN supports 100+ ONNX operators, consisting of most of the mainstream CNN, NLP operators needed.
Expand Down Expand Up @@ -127,7 +127,7 @@ TNN referenced the following projects:

* Everyone is welcome to participate to build the best inference framework in the industry.

* Technical Discussion QQ Group: 913940506 Answer: TNN
* Technical Discussion QQ Group: 704900079 Answer: TNN

* Scan the QR code to join the TNN discussion group:
<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/TNN-QQ.png"/>
<div align=left ><img src="TNN-QQ.png"/>
8 changes: 4 additions & 4 deletions README_CH.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[English Version](README.md)
<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/TNN.png"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/TNN.png"/>

## 简介

Expand Down Expand Up @@ -68,7 +68,7 @@ demo

* TNN架构图:

<div><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/imgs/tnn_architect.jpg"/>
<div><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/imgs/tnn_architect.jpg"/>

* 通过 ONNX 支持 TensorFlow, PyTorch, MXNet, Caffe 等多种训练框架,充分利用和融入不断完善的 ONNX 开源生态。当前支持 ONNX 算子100+,覆盖主流CNN, NLP网络。
* 支持主流安卓、iOS、Embedded Linux 操作系统, Windows, Linux,支持 ARM CPU, x86, Mali GPU, Adreno GPU, NV GPU, 达芬奇NPU,RK NPU。
Expand Down Expand Up @@ -127,7 +127,7 @@ TNN参考和借鉴了下列项目:

* 欢迎大家参与,协同共建,打造业界最好的高性能推理框架。

* 技术交流 QQ 群: 913940506 答案:TNN
* 技术交流 QQ 群: 704900079 答案:TNN

* QQ 群二维码:
<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/TNN-QQ.png"/>
<div align=left ><img src="TNN-QQ.png"/>
6 changes: 3 additions & 3 deletions doc/cn/development/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

对模型解析相关接口进行了抽象,可支持多种模型格式解析和扩充,相关代码见source/tnn/interpreter模块。

<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/imgs/model_reinterpreter.png"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/imgs/model_reinterpreter.png"/>

AbstractModelInterpreter定义了抽象的Interpret接口,不同的模型解析器解析不同类型模型。DefaultModelInterpreter相关的接口将相关结果存入NetStruture和NetResource结构中,部分第三方模型无法完成内部结构解析的有单独适配,如CoreMLModelInterpreter,以完成第三方库适配。

Expand Down Expand Up @@ -79,15 +79,15 @@ public:
Blob节点构建核心在于内存的分配和优化,主要分为blob内存循环复用,blob内存拼接与监控。
<div align=left><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/imgs/blob_memory.png"/>
<div align=left><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/imgs/blob_memory.png"/>
首先不同layer输出blob间内存会通过内部算法实现循环复用,不同blob间内存复用会优先选择尺寸接近的blob。
确定blob内存复用关系后,会对blob内存进行拼接,并统一分配内存,最终同一Instance不同blob间持有相同的base指针以及不同的偏移量,同一线程多个instance间以及不同线程instance间内存有了内存复用的基础。TNN内部提供了单一线程内不同instance间内存复用自动实现机制,通过SHARE\_MEMORY\_MODE\_SHARE\_ONE\_THREAD构建的Instance会自动实现多Instance内存复用。同时SHARE\_MEMORY\_MODE\_SET\_FROM\_EXTERNAL构建的Instance支持内存外部传入,由调用者维护内存复用关系以及内存分配释放,对于多线程复用还需要处理线程间加锁机制。
## 四、多平台加速算子实现
<div align=left><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/imgs/device.png"/>
<div align=left><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/imgs/device.png"/>
抽象AbstractDevice接口,用于隐藏不同Device实现细节。提供Device Memory 尺寸计算,Device Memory分配释放,内存CPU Memory与Device meomoy拷贝,Device Layer加速算子构建,以及Instance对应Device Context构建等接口。
Expand Down
14 changes: 7 additions & 7 deletions doc/cn/development/profiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

如下图点击benchmark工程,找到工程设置`Signing & Capabilities`,点击Team选项卡选择`Add an Account...`

<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/development/resource/ios_add_account_benchmark.jpg" width = "75%" height = "75%"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/development/resource/ios_add_account_benchmark.jpg" width = "75%" height = "75%"/>

在如下界面输入Apple ID账号和密码,添加完成后回到`Signing & Capabilities`界面,并在Team选项卡中选中添加的账号。如果没有Apple ID也可以通过`Create Apple ID`选项根据相关提示进行申请。

`PS:申请Apple ID无需付费,可以即时通过,通过后才可在真机上运行APP调试`

<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/development/resource/ios_set_account.jpg" width = "75%" height = "75%"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/development/resource/ios_set_account.jpg" width = "75%" height = "75%"/>


4. 真机运行
Expand All @@ -33,19 +33,19 @@

如图在现有`Bundle Identifier`后随机添加后缀(限数字和字母),避免个人账户遇到签名冲突。

<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/development/resource/ios_set_bundleid_benchmark.jpg" width = "75%" height = "75%"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/development/resource/ios_set_bundleid_benchmark.jpg" width = "75%" height = "75%"/>

4.2 验证授权

首次运行先利用快捷键`Command + Shift + K`对工程进行清理,再执行快捷键`Command + R`运行。如果是首次登陆Apple ID,Xcode会弹框报如下错误,需要在iOS设备上根据提示进行授权验证。一般来说手机上的授权路径为:设置 -> 通用 -> 描述文件与设备管理 -> Apple Development选项 -> 点击信任

<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/development/resource/ios_verify_certificate_benchmark.jpg" width = "75%" height = "75%"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/development/resource/ios_verify_certificate_benchmark.jpg" width = "75%" height = "75%"/>

4.3 运行结果

首次运行先利用快捷键`Command + Shift + K`对工程进行清理,再执行快捷键`Command + R`运行。在界面上点击Run按钮,界面会显示model目录下所有模型的CPU和GPU耗时情况。iPhone7真机运行结果如下图。

<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/development/resource/ios_benchmark_result.jpg" width = "50%" height = "50%"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/development/resource/ios_benchmark_result.jpg" width = "50%" height = "50%"/>

PS:

Expand Down Expand Up @@ -104,7 +104,7 @@ P.S. 不指定 -t, 默认跑CPU和GPU, 华为npu benchmark需通过-t HUAWEI_NPU
./benchmark_models.sh -c
```
结果如图:
<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/development/resource/android_profiling.jpg" width = "75%" height = "75%"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/development/resource/android_profiling.jpg" width = "75%" height = "75%"/>

执行结果会保存在`benchmark_models_result.txt`中。

Expand All @@ -116,7 +116,7 @@ P.S. 不指定 -t, 默认跑CPU和GPU, 华为npu benchmark需通过-t HUAWEI_NPU
./benchmark_models.sh -c -f
```
结果如图:
<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/development/resource/opencl_profiling.jpg" width = "75%" height = "75%"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/development/resource/opencl_profiling.jpg" width = "75%" height = "75%"/>

执行结果会保存在`benchmark_models_result.txt`中。
P.S. 华为npu不支持每层分析。
Expand Down
8 changes: 4 additions & 4 deletions doc/cn/front_page.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/TNN.png"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/TNN.png"/>

[English Version](../en/front_page_en.md)

Expand Down Expand Up @@ -77,7 +77,7 @@ TNN作为一个移动端高性能、轻量级的推断框架,同时拥有跨
* TNN架构图:


<div><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/imgs/tnn_architect.jpg"/>
<div><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/imgs/tnn_architect.jpg"/>

* 通过ONNX支持TensorFlow, Pytorch, MxNet, Caffe等多种训练框架,充分利用和融入不断完善的ONNX开源生态。当前支持ONNX算子55个,近期会完善到约80个,覆盖主流CNN网络
* 支持主流安卓、iOS、embedded Linux,windows操作系统,支持ARM CPU, GPU硬件平台(近期还会加入达芬奇NPU支持)
Expand Down Expand Up @@ -118,7 +118,7 @@ TNN作为一个移动端高性能、轻量级的推断框架,同时拥有跨

* 欢迎大家参与,协同共建,打造业界最好的移动端推理框架。

* 技术交流QQ群: 913940506 答案:TNN
* 技术交流QQ群: 704900079 答案:TNN

* QQ群二维码:
<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/TNN-QQ.png"/>
<div align=left ><img src="../../TNN-QQ.png"/>
2 changes: 1 addition & 1 deletion doc/cn/get_started.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/TNN.png"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/TNN.png"/>

# 从0开始跑通一个Demo

Expand Down
2 changes: 1 addition & 1 deletion doc/cn/user/convert.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[English Version](../../en/user/convert_en.md)

<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/user/resource/convert.png"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/user/resource/convert.png"/>

目前 TNN 支持业界主流的模型文件格式,包括ONNX、PyTorch、TensorFlow、TesorFlow-Lite 以及 Caffe 等。如上图所示,TNN 将 ONNX 作为中间层,借助于ONNX 开源社区的力量,来支持多种模型文件格式。如果要将PyTorch、TensorFlow 以及 Caffe 等模型文件格式转换为 TNN,首先需要使用对应的模型转换工具,统一将各种模型格式转换成为 ONNX 模型格式,然后将 ONNX 模型转换成 TNN 模型。

Expand Down
20 changes: 10 additions & 10 deletions doc/cn/user/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,27 @@

如下图点击TNNExamples工程,找到工程设置`Signing & Capabilities`,点击Team选项卡选择`Add an Account...`

<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/user/resource/ios_add_account_demo.jpg" width = "75%" height = "75%"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/user/resource/ios_add_account_demo.jpg" width = "75%" height = "75%"/>

在如下界面输入Apple ID账号和密码,添加完成后回到`Signing & Capabilities`界面,并在Team选项卡中选中添加的账号。如果没有Apple ID也可以通过`Create Apple ID`选项根据相关提示进行申请。

`PS:申请Apple ID无需付费,可以即时通过,通过后才可在真机上运行APP调试`

<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/user/resource/ios_set_account.jpg" width = "75%" height = "75%"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/user/resource/ios_set_account.jpg" width = "75%" height = "75%"/>

4. 真机运行

4.1 修改`Bundle Identitifier`

如图在现有`Bundle Identifier`后随机添加后缀(限数字和字母),避免个人账户遇到签名冲突。

<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/user/resource/ios_set_bundleid_demo.jpg" width = "75%" height = "75%"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/user/resource/ios_set_bundleid_demo.jpg" width = "75%" height = "75%"/>

4.2 验证授权

首次运行先利用快捷键`Command + Shift + K`对工程进行清理,再执行快捷键`Command + R`运行。如果是首次登陆Apple ID,Xcode会弹框报如下错误,需要在iOS设备上根据提示进行授权验证。一般来说手机上的授权路径为:设置 -> 通用 -> 描述文件与设备管理 -> Apple Development选项 -> 点击信任

<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/user/resource/ios_verify_certificate_demo.jpg" width = "75%" height = "75%"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/user/resource/ios_verify_certificate_demo.jpg" width = "75%" height = "75%"/>

4.3 运行结果

Expand All @@ -94,15 +94,15 @@ c) 如果需要执行OCR demo,需要将tnn_sdk_sample.h中的宏HAS_OPENCV设

效果示例:iPhone 7, ARM 单线程 6.3206ms

<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/user/resource/face_detector.jpg" width = "33%" height = "33%"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/user/resource/face_detector.jpg" width = "33%" height = "33%"/>

2. 图像分类

模型来源:https://github.com/forresti/SqueezeNet

效果示例:iPhone 7, ARM 单线程 13.83ms

<div align =left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/user/resource/image_classify.jpg" width = 33% height = "33%"/>
<div align =left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/user/resource/image_classify.jpg" width = 33% height = "33%"/>

## 二、Android Demo 介绍

Expand Down Expand Up @@ -176,19 +176,19 @@ NDK 22和23在链接第三方动态库可能会出错,例如opencv,hiai,

效果示例:华为P40, ARM 单线程 32.2359ms

<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/user/resource/android_face_detector_image.jpg" width = "25%" height = "25%"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/user/resource/android_face_detector_image.jpg" width = "25%" height = "25%"/>

效果示例: 华为P40, 华为NPU rom 100.320.010.022 9.04ms

<div align=left ><img src="https://github.com/darrenyao87/tnn-models/blob/master/doc/cn/user/resource/android_face_detecor_image_npu.jpg" width = "25%" height = "25%"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/user/resource/android_face_detecor_image_npu.jpg.jpg" width = "25%" height = "25%"/>


2. 人脸检测-视频
模型来源:https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB

效果示例:华为P40, ARM 单线程 122.296ms

<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/user/resource/android_face_detector_stream.jpg" width = "25%" height = "25%"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/user/resource/android_face_detector_stream.jpg" width = "25%" height = "25%"/>

效果示例: 华为P40, 华为NPU rom 100.320.010.022 28ms

Expand All @@ -200,7 +200,7 @@ NDK 22和23在链接第三方动态库可能会出错,例如opencv,hiai,

效果示例:华为P40, ARM 单线程 81.4047ms

<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/user/resource/android_image_classify.jpg" width = "25%" height = "25%"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/user/resource/android_image_classify.jpg" width = "25%" height = "25%"/>

效果示例: 华为P40, NPU rom 100.320.010.022 2.48ms

Expand Down
2 changes: 1 addition & 1 deletion doc/cn/user/roadmap.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

# Roadmap
<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/imgs/roadmap.jpg"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/imgs/roadmap.jpg"/>
2 changes: 1 addition & 1 deletion doc/cn/user/tech_solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ TNN作为一个移动端高性能、轻量级的推理框架,同时拥有跨
* TNN架构图:


<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/imgs/tnn_architect.jpg" width = "75%" height = "75%"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/imgs/tnn_architect.jpg" width = "75%" height = "75%"/>

* 通过ONNX支持TensorFlow, Pytorch, MxNet, Caffe等多种训练框架,充分利用和融入不断完善的ONNX开源生态。当前支持ONNX算子55个,近期会完善到约80个,覆盖主流CNN网络
* 支持主流安卓、iOS、embedded Linux,windows操作系统,支持ARM CPU, GPU硬件平台(近期还会加入达芬奇NPU支持)
Expand Down
6 changes: 3 additions & 3 deletions doc/en/development/architecture_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Considering the maintenance and compatibility of the open-source library, all ex

The interface related to the model interpreter is abstracted, which can support multiple model formats' parsing. See the source/tnn/interpreter module for related codes.

<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/imgs/model_reinterpreter.png"/>
<div align=left ><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/imgs/model_reinterpreter.png"/>

AbstractModelInterpreter defines an abstract Interpret interface, and different model parsers parse different types of models. The interface related to DefaultModelInterpreter stores the relevant results in the NetStruture and NetResource structures. Some third-party models which cannot complete the interpretation would need a separate path such as CoreMLModelInterpreter, to complete third-party library adaptation.

Expand Down Expand Up @@ -65,7 +65,7 @@ Similar to the previous model registration mechanism, different Layers will regi
The core of Blob node construction is memory allocation and optimization, which is mainly divided into blob memory recycling, blob memory splicing, and monitoring.
<div align=left><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/imgs/blob_memory.png"/>
<div align=left><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/imgs/blob_memory.png"/>
First of all, the memory between the blobs output by different layers will be cyclically reused through an internal algorithm. The memory reuse between different blobs will preferentially select blobs of similar size.
Expand All @@ -74,7 +74,7 @@ The memory between multiple instances of the same thread/different threads has t
## IV. Multi-platform Acceleration Operator Implementation
<div align=left><img src="https://gitee.com/darren3d/tnn-resource/raw/master/doc/cn/imgs/device.png"/>
<div align=left><img src="https://github.com/darrenyao87/tnn-models/raw/master/doc/cn/imgs/device.png"/>
Abstract AbstractDevice interface, used to hide the implementation details of different Devices. Provide an interface for Device Memory size calculation, Device Memory allocation/release, CPU Memory and Device memory copy, Device Layer accelerated operator construction, and instance corresponding Device Context construction.
Expand Down
Loading

0 comments on commit 900e4df

Please sign in to comment.