├── .gitattributes ├── README.md ├── README_HOOK.md ├── TNN-QQ.png ├── TNN.png ├── ddk ├── hwhiai-ddk-100.320.030.010.tar ├── hwhiai-ddk-100.320.030.010 │ ├── Huawei HiAI DDK License Agreement.docx │ ├── arm64-v8a │ │ ├── libcpucl.so │ │ ├── libhcl.so │ │ ├── libhiai.so │ │ ├── libhiai_ir.so │ │ └── libhiai_ir_build.so │ ├── armeabi-v7a │ │ ├── libcpucl.so │ │ ├── libhcl.so │ │ ├── libhiai.so │ │ ├── libhiai_ir.so │ │ └── libhiai_ir_build.so │ └── include │ │ ├── HiAiAippPara.h │ │ ├── HiAiModelManagerService.h │ │ ├── HiAiModelManagerType.h │ │ ├── graph │ │ ├── attr_value.h │ │ ├── buffer.h │ │ ├── common │ │ │ └── securestl.h │ │ ├── compatible │ │ │ ├── all_ops.h │ │ │ ├── cpt_array_defs.h │ │ │ ├── cpt_const_defs.h │ │ │ ├── cpt_detection_defs.h │ │ │ ├── cpt_image_defs.h │ │ │ ├── cpt_math_defs.h │ │ │ ├── cpt_nn_defs.h │ │ │ ├── cpt_random_defs.h │ │ │ └── operator_reg.h │ │ ├── debug │ │ │ └── ge_error_codes.h │ │ ├── detail │ │ │ └── attributes_holder.h │ │ ├── graph.h │ │ ├── model.h │ │ ├── op │ │ │ ├── all_ops.h │ │ │ ├── array_defs.h │ │ │ ├── const_defs.h │ │ │ ├── detection_defs.h │ │ │ ├── image_defs.h │ │ │ ├── math_defs.h │ │ │ ├── nn_defs.h │ │ │ └── random_defs.h │ │ ├── op_reg.h │ │ ├── operator.h │ │ ├── operator_hiai_reg.h │ │ ├── tensor.h │ │ └── types.h │ │ ├── hiai_ir_build.h │ │ ├── hiai_types.h │ │ └── native_handle.h └── hwhiai-ddk-100.500.010.011.tar ├── doc ├── cn │ ├── development │ │ └── resource │ │ │ ├── android_profiling.jpg │ │ │ ├── ios_add_account_benchmark.jpg │ │ │ ├── ios_benchmark_result.jpg │ │ │ ├── ios_set_account.jpg │ │ │ ├── ios_set_bundleid_benchmark.jpg │ │ │ ├── ios_verify_certificate_benchmark.jpg │ │ │ └── opencl_profiling.jpg │ ├── imgs │ │ ├── 835.jpg │ │ ├── 970.jpg │ │ ├── blob_memory.png │ │ ├── device.png │ │ ├── device_factory.png │ │ ├── group.jpg │ │ ├── group.png │ │ ├── model_reinterpreter.png │ │ ├── roadmap.jpg │ │ └── tnn_architect.jpg │ └── user │ │ └── resource │ │ ├── android_face_detecor_image_npu.jpg │ │ ├── android_face_detector_image.jpg │ │ ├── android_face_detector_stream.jpg │ │ ├── android_face_detector_stream_npu.jpg │ │ ├── android_image_classify.jpg │ │ ├── android_image_classify_npu.jpg │ │ ├── convert.png │ │ ├── face_detector.jpg │ │ ├── image_classify.jpg │ │ ├── ios_add_account_demo.jpg │ │ ├── ios_set_account.jpg │ │ ├── ios_set_bundleid_demo.jpg │ │ ├── ios_verify_certificate_demo.jpg │ │ └── tnn-netron.jpg ├── demo │ ├── bert_squad.gif │ ├── chinese-ocr.gif │ ├── face_alignment.gif │ ├── face_detection.gif │ ├── hair_seg_red.gif │ ├── object-detection.gif │ ├── skeleton_blazepose.gif │ └── skeleton_guangliu.gif └── en │ ├── development │ └── resource │ │ ├── android_profiling.jpg │ │ ├── ios_add_account_benchmark.jpg │ │ ├── ios_benchmark_result.jpg │ │ ├── ios_set_account.jpg │ │ ├── ios_set_bundleid_benchmark.jpg │ │ ├── ios_verify_certificate_benchmark.jpg │ │ └── opencl_profiling.jpg │ └── imgs │ └── tnn_architect.jpg ├── face-detector ├── version-slim-320_simplified.bin ├── version-slim-320_simplified.onnx ├── version-slim-320_simplified.param ├── version-slim-320_simplified.rapidmodel ├── version-slim-320_simplified.rapidproto ├── version-slim-320_simplified.tnnmodel └── version-slim-320_simplified.tnnproto ├── mobilenet_v2 ├── mobilenet_v2.onnx.opt.onnx.rapidmodel ├── mobilenet_v2.onnx.opt.onnx.rapidproto ├── mobilenet_v2.onnx.opt.onnx.tnnmodel ├── mobilenet_v2.onnx.opt.onnx.tnnproto ├── mobilenet_v2.tnnmodel └── mobilenet_v2.tnnproto ├── model ├── bert-based │ ├── bert-based.tnnmodel │ └── bert-based.tnnproto ├── bertsquad10 │ ├── bertsquad10_clean.tnnmodel │ ├── bertsquad10_clean.tnnproto │ └── vocab.txt ├── blazeface │ ├── blazeface.tnnmodel │ ├── blazeface.tnnproto │ └── blazeface_anchors.txt ├── blazepose │ ├── pose_detection.tnnmodel │ ├── pose_detection.tnnproto │ ├── pose_landmark_full_body.tnnmodel │ ├── pose_landmark_full_body.tnnproto │ ├── pose_landmark_upper_body.tnnmodel │ └── pose_landmark_upper_body.tnnproto ├── chinese-ocr │ ├── angle_net.tnnmodel │ ├── angle_net.tnnproto │ ├── crnn_lite_lstm.tnnmodel │ ├── crnn_lite_lstm.tnnproto │ ├── dbnet.tnnmodel │ ├── dbnet.tnnproto │ └── keys.txt ├── face-detector │ ├── version-slim-320_simplified.bin │ ├── version-slim-320_simplified.onnx │ ├── version-slim-320_simplified.param │ ├── version-slim-320_simplified.rapidmodel │ ├── version-slim-320_simplified.rapidproto │ ├── version-slim-320_simplified.tnnmodel │ └── version-slim-320_simplified.tnnproto ├── face_mesh │ ├── face_mesh.tnnmodel │ └── face_mesh.tnnproto ├── gray_transfer │ ├── G_8_GRAY2RGB_256.tnnmodel │ └── G_8_GRAY2RGB_256.tnnproto ├── hair_segmentation │ ├── segmentation.tnnmodel │ └── segmentation.tnnproto ├── mobilenet_v2-ssd │ ├── README.md │ ├── mobilenetv2_ssd.tnnmodel │ ├── mobilenetv2_ssd.tnnproto │ ├── mobilenetv2_ssd_tf.tnnmodel │ ├── mobilenetv2_ssd_tf.tnnproto │ ├── mobilenetv2_ssd_tf_fix_box.tnnmodel │ ├── mobilenetv2_ssd_tf_fix_box.tnnproto │ └── ssdlite_tf2onnx.py ├── mobilenet_v2 │ ├── mobilenet_v2.onnx.opt.onnx.rapidmodel │ ├── mobilenet_v2.onnx.opt.onnx.rapidproto │ ├── mobilenet_v2.onnx.opt.onnx.tnnmodel │ ├── mobilenet_v2.onnx.opt.onnx.tnnproto │ ├── mobilenet_v2.tnnmodel │ └── mobilenet_v2.tnnproto ├── monodepth_pydnet │ ├── monodepth_pydnet.tnnmodel │ └── monodepth_pydnet.tnnproto ├── nanodet │ ├── nanodet_e1.tnnmodel │ ├── nanodet_e1.tnnproto │ ├── nanodet_m.tnnmodel │ ├── nanodet_m.tnnproto │ ├── nanodet_t.tnnmodel │ └── nanodet_t.tnnproto ├── objectron │ ├── objectron_shoes.tnnmodel │ └── objectron_shoes.tnnproto ├── resnet50 │ ├── resnet50.opt.tnnmodel │ └── resnet50.opt.tnnproto ├── shufflenet_v2 │ ├── shufflenet_v2.onnx.opt.onnx.rapidmodel │ ├── shufflenet_v2.onnx.opt.onnx.rapidproto │ ├── shufflenet_v2.onnx.opt.onnx.tnnmodel │ ├── shufflenet_v2.onnx.opt.onnx.tnnproto │ ├── shufflenet_v2.tnnmodel │ └── shufflenet_v2.tnnproto ├── skeleton │ ├── skeleton.tnnmodel │ ├── skeleton_big.tnnproto │ ├── skeleton_middle.tnnproto │ └── skeleton_small.tnnproto ├── tiny-bert │ ├── tiny-bert-squad-fixed-256.tnnmodel │ ├── tiny-bert-squad-fixed-256.tnnproto │ ├── tiny-bert-squad.tnnmodel │ ├── tiny-bert-squad.tnnproto │ └── vocab.txt ├── yolov5 │ ├── yolov5s-permute.tnnproto │ ├── yolov5s.tnnmodel │ └── yolov5s.tnnproto └── youtu_face_alignment │ ├── youtu_face_alignment_phase1.tnnmodel │ ├── youtu_face_alignment_phase1.tnnproto │ ├── youtu_face_alignment_phase2.tnnmodel │ ├── youtu_face_alignment_phase2.tnnproto │ ├── youtu_mean_pts_phase1.txt │ └── youtu_mean_pts_phase2.txt ├── netron ├── Netron Setup 4.1.1.exe.zip └── Netron-4.1.1.AppImage.zip └── shufflenet_v2 ├── shufflenet_v2.onnx.opt.onnx.rapidmodel ├── shufflenet_v2.onnx.opt.onnx.rapidproto ├── shufflenet_v2.onnx.opt.onnx.tnnmodel ├── shufflenet_v2.onnx.opt.onnx.tnnproto ├── shufflenet_v2.tnnmodel └── shufflenet_v2.tnnproto /.gitattributes: -------------------------------------------------------------------------------- 1 | *.tnnmodel filter=lfs diff=lfs merge=lfs -text 2 | *.rapidmodel filter=lfs diff=lfs merge=lfs -text 3 | *.onnx filter=lfs diff=lfs merge=lfs -text 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tnn-models 2 | -------------------------------------------------------------------------------- /README_HOOK.md: -------------------------------------------------------------------------------- 1 | 为防止账号密码等信息泄漏,所有人员均必须添加hook方式进行本地检查。 2 | 之后每次本地提交都将触发自动检查,疑似敏感信息会用红色进行标记,个人负责针对性处理。 3 | 4 | 添加方案: 5 | 1.命令行脚本方案 6 | cd tools/hooks 7 | sh add_hooks.sh 8 | 9 | 2.手动添加 10 | 将tools/hooks/pre-commit复制到项目的.git/hooks/目录下 11 | 12 | 注意目录下可能已存在同名文件,可选择合并 13 | -------------------------------------------------------------------------------- /TNN-QQ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/TNN-QQ.png -------------------------------------------------------------------------------- /TNN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/TNN.png -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010.tar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/ddk/hwhiai-ddk-100.320.030.010.tar -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/Huawei HiAI DDK License Agreement.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/ddk/hwhiai-ddk-100.320.030.010/Huawei HiAI DDK License Agreement.docx -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/arm64-v8a/libcpucl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/ddk/hwhiai-ddk-100.320.030.010/arm64-v8a/libcpucl.so -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/arm64-v8a/libhcl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/ddk/hwhiai-ddk-100.320.030.010/arm64-v8a/libhcl.so -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/arm64-v8a/libhiai.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/ddk/hwhiai-ddk-100.320.030.010/arm64-v8a/libhiai.so -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/arm64-v8a/libhiai_ir.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/ddk/hwhiai-ddk-100.320.030.010/arm64-v8a/libhiai_ir.so -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/arm64-v8a/libhiai_ir_build.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/ddk/hwhiai-ddk-100.320.030.010/arm64-v8a/libhiai_ir_build.so -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/armeabi-v7a/libcpucl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/ddk/hwhiai-ddk-100.320.030.010/armeabi-v7a/libcpucl.so -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/armeabi-v7a/libhcl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/ddk/hwhiai-ddk-100.320.030.010/armeabi-v7a/libhcl.so -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/armeabi-v7a/libhiai.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/ddk/hwhiai-ddk-100.320.030.010/armeabi-v7a/libhiai.so -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/armeabi-v7a/libhiai_ir.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/ddk/hwhiai-ddk-100.320.030.010/armeabi-v7a/libhiai_ir.so -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/armeabi-v7a/libhiai_ir_build.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/ddk/hwhiai-ddk-100.320.030.010/armeabi-v7a/libhiai_ir_build.so -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/HiAiAippPara.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: hiai AIPP para 4 | * 5 | */ 6 | 7 | #ifndef AI_AIPP_PARAMETERS_H 8 | #define AI_AIPP_PARAMETERS_H 9 | 10 | #include "HiAiModelManagerType.h" 11 | #include "native_handle.h" 12 | 13 | namespace hiai { 14 | 15 | struct AippInputShape { 16 | uint32_t srcImageSizeW = 0; 17 | uint32_t srcImageSizeH = 0; 18 | }; 19 | 20 | struct AippCropPara { 21 | bool switch_ = false; 22 | uint32_t cropStartPosW = 0; 23 | uint32_t cropStartPosH = 0; 24 | uint32_t cropSizeW = 0; 25 | uint32_t cropSizeH = 0; 26 | }; 27 | 28 | struct AippResizePara { 29 | bool switch_ = false; 30 | uint32_t resizeOutputSizeW = 0; 31 | uint32_t resizeOutputSizeH = 0; 32 | }; 33 | 34 | struct AippPaddingPara { 35 | bool switch_ = false; 36 | uint32_t paddingSizeTop = 0; 37 | uint32_t paddingSizeBottom = 0; 38 | uint32_t paddingSizeLeft = 0; 39 | uint32_t paddingSizeRight = 0; 40 | }; 41 | 42 | struct AippCscPara { 43 | bool switch_ = false; 44 | int32_t matrixR0C0 = 0; 45 | int32_t matrixR0C1 = 0; 46 | int32_t matrixR0C2 = 0; 47 | int32_t matrixR1C0 = 0; 48 | int32_t matrixR1C1 = 0; 49 | int32_t matrixR1C2 = 0; 50 | int32_t matrixR2C0 = 0; 51 | int32_t matrixR2C1 = 0; 52 | int32_t matrixR2C2 = 0; 53 | int32_t outputBias0 = 0; 54 | int32_t outputBias1 = 0; 55 | int32_t outputBias2 = 0; 56 | int32_t inputBias0 = 0; 57 | int32_t inputBias1 = 0; 58 | int32_t inputBias2 = 0; 59 | }; 60 | 61 | struct AippDtcPara { 62 | int16_t pixelMeanChn0 = 0; 63 | int16_t pixelMeanChn1 = 0; 64 | int16_t pixelMeanChn2 = 0; 65 | int16_t pixelMeanChn3 = 0; 66 | float pixelMinChn0 = 0; 67 | float pixelMinChn1 = 0; 68 | float pixelMinChn2 = 0; 69 | float pixelMinChn3 = 0; 70 | float pixelVarReciChn0 = 1.0; 71 | float pixelVarReciChn1 = 1.0; 72 | float pixelVarReciChn2 = 1.0; 73 | float pixelVarReciChn3 = 1.0; 74 | }; 75 | 76 | struct AippChannelSwapPara { 77 | bool rbuvSwapSwitch = false; 78 | bool axSwapSwitch = false; 79 | }; 80 | 81 | enum ImageType { 82 | JPEG = 0, 83 | BT_601_NARROW, 84 | BT_601_FULL, 85 | BT_709_NARROW, 86 | }; 87 | 88 | class AippParaImpl; 89 | class HIAI_API_EXPORT AippPara { 90 | public: 91 | AippPara(); 92 | ~AippPara(); 93 | AippPara(const AippPara& para) = delete; 94 | AippPara& operator=(const AippPara& para) = delete; 95 | 96 | /* 97 | * @brief 初始化AippPara对象 98 | * @param [in] batchCount 模型输入的Batch数,对应NCHW维度的N维,默认为1 99 | * @return AIStatus::AI_SUCCESS AippPara初始化成功 100 | * @return Others 失败 101 | */ 102 | AIStatus Init(uint32_t batchCount = 1); 103 | uint32_t GetBatchCount(); 104 | 105 | /* 106 | * @brief 设置AIPP的inputIndex参数 107 | * @param [in] inputIndex 用于标识此AIPP参数作用于模型的第几个输入 108 | * @return AIStatus::AI_SUCCESS 设置成功 109 | * @return Others 失败 110 | */ 111 | AIStatus SetInputIndex(uint32_t inputIndex); 112 | int32_t GetInputIndex(); 113 | 114 | /* 115 | * @brief 设置AIPP的inputAippIndex参数 116 | * @param [in] inputAippIndex 用于标识AIPP配置参数在输入Data有多个输出分支时作用于第几个分支 117 | * @return AIStatus::AI_SUCCESS 设置成功 118 | * @return Others 失败 119 | */ 120 | AIStatus SetInputAippIndex(uint32_t inputAippIndex); 121 | int32_t GetInputAippIndex(); 122 | 123 | /* 124 | * @brief 设置AIPP的inputShape参数,设置输入图片的长宽 125 | * @param [in] inputShape 输入图片尺寸 126 | * @return AIStatus::AI_SUCCESS 设置成功 127 | * @return Others 失败 128 | */ 129 | AIStatus SetInputShape(AippInputShape inputShape); 130 | AippInputShape GetInputShape(); 131 | 132 | /* 133 | * @brief 设置AIPP的inputFormat参数,设置输入图片的类型 134 | * @param [in] inputFormat 输入图片的类型 135 | * @return AIStatus::AI_SUCCESS 设置成功 136 | * @return Others 失败 137 | */ 138 | AIStatus SetInputFormat(AiTensorImage_Format inputFormat); 139 | AiTensorImage_Format GetInputFormat(); 140 | 141 | /* 142 | * @brief 设置AIPP的CSC色域转换相关参数 143 | * @param [in] targetFormat 转换后的图片类型,系统根据转换后的图片类型自动填充CSC相关参数 144 | * @param [in] imageType 图片格式,默认JPEG 145 | * @return AIStatus::AI_SUCCESS 设置成功 146 | * @return Others 失败 147 | */ 148 | AIStatus SetCscPara(AiTensorImage_Format targetFormat, ImageType imageType=JPEG); 149 | AippCscPara GetCscPara(); 150 | 151 | /* 152 | * @brief 设置AIPP的ChannelSwap通道交换相关参数 153 | * @param [in] channelSwapPara AIPP通道交换参数 154 | * @return AIStatus::AI_SUCCESS 设置成功 155 | * @return Others 失败 156 | */ 157 | AIStatus SetChannelSwapPara(AippChannelSwapPara channelSwapPara); 158 | AippChannelSwapPara GetChannelSwapPara(); 159 | 160 | /* 161 | * @brief 设置AIPP的Crop图片裁剪相关参数,为所有的Batch设置相同的Crop参数 162 | * @param [in] cropPara crop相关参数 163 | * @return AIStatus::AI_SUCCESS 设置成功 164 | * @return Others 失败 165 | */ 166 | AIStatus SetCropPara(AippCropPara cropPara); 167 | 168 | /* 169 | * @brief 设置AIPP的Crop图片裁剪相关参数,为特定下标的batch设置Crop参数 170 | * @param [in] batchIndex batch下标,标识为第几个batch设置Crop参数 171 | * @param [in] cropPara crop相关参数 172 | * @return AIStatus::AI_SUCCESS 设置成功 173 | * @return Others 失败 174 | */ 175 | AIStatus SetCropPara(uint32_t batchIndex, AippCropPara cropPara); 176 | AippCropPara GetCropPara(uint32_t batchIndex); 177 | 178 | /* 179 | * @brief 设置AIPP的Resize图片裁剪相关参数,为所有的Batch设置相同的Resize参数 180 | * @param [in] resizePara Resize相关参数 181 | * @return AIStatus::AI_SUCCESS 设置成功 182 | * @return Others 失败 183 | */ 184 | AIStatus SetResizePara(AippResizePara resizePara); 185 | 186 | /* 187 | * @brief 设置AIPP的Resize图片裁剪相关参数,为特定下标的batch设置Resize参数 188 | * @param [in] batchIndex batch下标,标识为第几个batch设置Resize参数 189 | * @param [in] resizePara Resize相关参数 190 | * @return AIStatus::AI_SUCCESS 设置成功 191 | * @return Others 失败 192 | */ 193 | AIStatus SetResizePara(uint32_t batchIndex, AippResizePara resizePara); 194 | AippResizePara GetResizePara(uint32_t batchIndex); 195 | 196 | /* 197 | * @brief 设置AIPP的Padding图片补边相关参数,为所有的Batch设置相同的Padding参数 198 | * @param [in] paddingPara Padding相关参数 199 | * @return AIStatus::AI_SUCCESS 设置成功 200 | * @return Others 失败 201 | */ 202 | AIStatus SetPaddingPara(AippPaddingPara paddingPara); 203 | 204 | /* 205 | * @brief 设置AIPP的Padding图片补边相关参数,为特定下标的batch设置Padding相关参数 206 | * @param [in] batchIndex batch下标,标识为第几个batch设置Padding参数 207 | * @param [in] paddingPara Padding相关参数 208 | * @return AIStatus::AI_SUCCESS 设置成功 209 | * @return Others 失败 210 | */ 211 | AIStatus SetPaddingPara(uint32_t batchIndex, AippPaddingPara paddingPara); 212 | AippPaddingPara GetPaddingPara(uint32_t batchIndex); 213 | 214 | /* 215 | * @brief 设置AIPP的DTC数据类型转换相关参数,为所有的Batch设置相同的DTC参数 216 | * @param [in] dtcPara DTC相关参数 217 | * @return AIStatus::AI_SUCCESS 设置成功 218 | * @return Others 失败 219 | */ 220 | AIStatus SetDtcPara(AippDtcPara dtcPara); 221 | 222 | /* 223 | * @brief 设置AIPP的DTC数据类型转换相关参数,为特定下标的batch设置DTC相关参数 224 | * @param [in] batchIndex batch下标,标识为第几个batch设置DTC参数 225 | * @param [in] dtcPara DTC相关参数 226 | * @return AIStatus::AI_SUCCESS 设置成功 227 | * @return Others 失败 228 | */ 229 | AIStatus SetDtcPara(uint32_t batchIndex, AippDtcPara dtcPara); 230 | AippDtcPara GetDtcPara(uint32_t batchIndex); 231 | 232 | private: 233 | friend class ModelManagerClientImplLegacy; 234 | friend class AippParaImpl; 235 | friend class AiModelMngerClientImpl; 236 | std::unique_ptr aippParaImpl; 237 | void* paraBuff = nullptr; 238 | }; 239 | 240 | class HIAI_API_EXPORT AippTensor : public AiTensor { 241 | public: 242 | AippTensor(std::shared_ptr tensor, std::vector> aippParas); 243 | 244 | ~AippTensor(); 245 | 246 | void *GetBuffer() const override; 247 | 248 | uint32_t GetSize() const override; 249 | 250 | std::shared_ptr GetAiTensor() const; 251 | 252 | std::vector> GetAippParas() const; 253 | 254 | std::shared_ptr GetAippParas(uint32_t index) const; 255 | 256 | private: 257 | using AiTensor::Init; 258 | 259 | std::shared_ptr tensor; 260 | 261 | std::vector> aippParas; 262 | }; 263 | 264 | HIAI_API_EXPORT std::shared_ptr HIAI_CreateAiPPTensorFromHandle(buffer_handle_t& handle, 265 | const TensorDimension* dim, AiTensorImage_Format imageFormat = AiTensorImage_INVALID); 266 | } 267 | 268 | #endif 269 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/HiAiModelManagerService.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: ai model manager service 4 | * 5 | */ 6 | 7 | #ifndef AI_MODEL_MANGER_SERVICE_H 8 | #define AI_MODEL_MANGER_SERVICE_H 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "HiAiModelManagerType.h" 15 | #include "HiAiAippPara.h" 16 | 17 | namespace hiai { 18 | class AiModelMngerClientImpl; 19 | class ModelBuilderImplLegacy; 20 | class AiModelMngerClient; 21 | class AiModelBuilderImpl; 22 | class HIAI_API_EXPORT AiModelBuilder { 23 | public: 24 | AiModelBuilder(std::shared_ptr client = nullptr); 25 | 26 | virtual ~AiModelBuilder(); 27 | 28 | /* 29 | * @brief OM离线模型在线编译接口 30 | * @param [in] pinputMemBuffer 输入的OM离线模型buffer 31 | * @param [in] poutputModelBuffer 输出模型buffer 32 | * @param [out] poutputModelSize 输出模型大小 33 | * @return AIStatus::AI_SUCCESS 成功 34 | * @return Others 失败 35 | */ 36 | AIStatus BuildModel(const std::vector &pinputMemBuffer, MemBuffer *poutputModelBuffer, 37 | uint32_t &poutputModelSize); 38 | 39 | /* 40 | * @brief 从文件读取OM离线模型proto信息 41 | * @param [in] path, 模型文件路径 42 | * @return MemBuffer * proto信息存储地址 43 | * @return nullptr 获取失败 44 | */ 45 | MemBuffer* ReadBinaryProto(const std::string path); 46 | 47 | /* 48 | * @brief 从内存读取OM离线模型proto信息 49 | * @param [in] data, OM离线模型内存地址 50 | * @param [in] size, OM离线模型内存存储大小 51 | * @return MemBuffer * proto信息存储地址 52 | * @return nullptr 获取失败 53 | */ 54 | MemBuffer* ReadBinaryProto(void* data, uint32_t size); 55 | 56 | /* 57 | * @brief 为输入OM离线模型用户内存buffer创建通用MemBuffer 58 | * @param [in] data, 模型用户内存地址 59 | * @param [in] size, 模型内存存储大小 60 | * @return MemBuffer * proto信息存储地址 61 | * @return nullptr 获取失败 62 | */ 63 | MemBuffer* InputMemBufferCreate(void *data, uint32_t size); 64 | 65 | /* 66 | * @brief 为输入OM离线模型从文件创建MemBuffer 67 | * @param [in] path 文件路径 68 | * @return MemBuffer * 创建的输入MemBuffer内存指针 69 | * @return nullptr 创建失败 70 | */ 71 | MemBuffer* InputMemBufferCreate(const std::string path); 72 | 73 | /* 74 | * @brief 为在线编译输出模型创建MemBuffer 75 | * @param [in] framework 模型平台类型 76 | * @param [in] pinputMemBuffer 输入的OM离线模型buffer 77 | * @return MemBuffer * 创建的输出模型MemBuffer内存指针 78 | * @return nullptr 创建失败 79 | */ 80 | MemBuffer* OutputMemBufferCreate(const int32_t framework, const std::vector &pinputMemBuffer); 81 | /* 82 | * @brief 注销MemBuffer内存,通过上述MemBuffer申请的内存最终都需要由此接口进行释放 83 | * @param [in] membuf, 创建的MemBuffer内存 84 | * @return void 85 | */ 86 | void MemBufferDestroy(MemBuffer *membuf); 87 | 88 | /* 89 | * @brief 将模型buffer导出到文件 90 | * @param [in] membuf, 存储离线模型信息内存指针 91 | * @param [in] pbuildSize, 离线模型大小 92 | * @param [in] pbuildPath, 离线模型导出文件存储路径 93 | * @return AIStatus::AI_SUCCESS 导出成功 94 | * @return Others 导出失败 95 | */ 96 | AIStatus MemBufferExportFile(MemBuffer *membuf, const uint32_t pbuildSize, const std::string pbuildPath); 97 | 98 | private: 99 | std::shared_ptr builderImpl_; 100 | }; 101 | 102 | class HIAI_API_EXPORT AiModelMngerClient { 103 | public: 104 | AiModelMngerClient(); 105 | virtual ~AiModelMngerClient(); 106 | 107 | /* 108 | * @brief 初始化接口 109 | * @param [in] listener 监听接口, 设置为nullptr时为同步调用, 否则为异步 110 | * @return AIStatus::AI_SUCCESS 成功 111 | * @return Others 失败 112 | */ 113 | AIStatus Init(std::shared_ptr listener); 114 | 115 | /* 116 | * @brief 加载模型 117 | * @param [in] pmodelDesc 模型信息 118 | * @param [in] piStamp 异步返回标识,基于该标识和模型名称做回调索引 119 | * @return AIStatus::AI_SUCCESS 成功 120 | * @return AIStatus::AI_INVALID_API 失败,表示设备不支持NPU 121 | * @return Others 失败 122 | */ 123 | AIStatus Load(std::vector> &pmodelDesc); 124 | 125 | /* 126 | * @brief 模型处理接口, 运行加载模型的模型推理 127 | * @param [in] context, 模型运行上下文, 必须带model_name字段 128 | * @param [in] pinputTensor, 模型输入节点tensor信息 129 | * @param [in] poutputTensor, 模型输出节点tensor信息 130 | * @param [in] timeout, 推理超时时间 131 | * @param [in] piStamp 异步返回标识,基于该标识和模型名称做回调索引 132 | * @return AIStatus::AI_SUCCESS 成功 133 | * @return Others 失败 134 | */ 135 | AIStatus Process(AiContext &context, std::vector> &pinputTensor, std::vector> &poutputTensor, uint32_t timeout, int32_t &piStamp); 136 | 137 | /* 138 | * @brief 模型兼容性检查接口 139 | * @param [in] pmodelDesc, 模型描述 140 | * @param [out] pisModelCompatibility, 兼容性检查标识 141 | * @return AIStatus::AI_SUCCESS 兼容性检查通过 142 | * @return Others 兼容性检查失败 143 | */ 144 | AIStatus CheckModelCompatibility(AiModelDescription &pmodelDesc, bool &pisModelCompatibility); 145 | 146 | /* 147 | * @brief 获取模型输入输出tensor信息 148 | * @param [in] pmodelName, 模型名 149 | * @param [out] pinputTensor 输出参数, 存储模型输入节点tensor信息 150 | * @param [out] poutputTensor 输出参数, 存储模型输出节点tensor信息 151 | * @return AIStatus::AI_SUCCESS 获取成功 152 | * @return Others 获取失败 153 | */ 154 | AIStatus GetModelIOTensorDim(const std::string& pmodelName, std::vector& pinputTensor, std::vector& poutputTensor); 155 | 156 | /* 157 | * @brief 获取模型AIPP 配置信息 158 | * @param [in] pmodelName, 模型名 159 | * @param [out] aippPara 输出参数, 模型中的AIPP配置参数 160 | * @return AIStatus::AI_SUCCESS 获取成功 161 | * @return Others 获取失败 162 | */ 163 | AIStatus GetModelAippPara(const std::string& modelName, std::vector>& aippPara); 164 | 165 | /* 166 | * @brief 获取模型对应输入的AIPP 配置信息 167 | * @param [in] pmodelName, 模型名 168 | * @param [in] index, 输入下标 169 | * @param [out] aippPara 输出参数, 模型对应输入的AIPP配置参数 170 | * @return AIStatus::AI_SUCCESS 获取成功 171 | * @return Others 获取失败 172 | */ 173 | AIStatus GetModelAippPara(const std::string& modelName, uint32_t index, std::vector>& aippPara); 174 | 175 | /* 176 | * @brief 获取DDK版本 177 | * @return char * DDK版本 178 | * @return nullptr 获取失败 179 | */ 180 | char * GetVersion(); 181 | 182 | /* 183 | * @brief 卸载模型 184 | * @return AIStatus::AI_SUCCESS 卸载成功 185 | * @return Others 卸载失败 186 | */ 187 | AIStatus UnLoadModel(); 188 | private: 189 | friend class ModelBuilderImplLegacy; 190 | friend class AiModelBuilderImpl; 191 | std::shared_ptr clientImpl_; 192 | }; 193 | 194 | } //end namespace hiai 195 | 196 | #endif 197 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/HiAiModelManagerType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: ai model manager type define 4 | * 5 | */ 6 | 7 | #ifndef AI_MODEL_MANGER_TYPE_H 8 | #define AI_MODEL_MANGER_TYPE_H 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include "hiai_types.h" 17 | 18 | #ifndef HIAI_API_EXPORT 19 | # ifndef _MSC_VER 20 | # define HIAI_API_EXPORT __attribute__ ((__visibility__ ("default"))) 21 | # else 22 | # define HIAI_API_EXPORT __declspec(dllexport) 23 | # endif 24 | #endif 25 | 26 | /* Dynamic aipp is supported since 100.320.010.010 */ 27 | #define AIPP_BASE_VERSION "100.320.010.010" 28 | 29 | namespace hiai { 30 | using AIStatus = int32_t; 31 | 32 | /* Error Numbers */ 33 | static const AIStatus AI_SUCCESS = 0; 34 | static const AIStatus AI_FAILED = 1; 35 | static const AIStatus AI_NOT_INIT = 2; 36 | static const AIStatus AI_INVALID_PARA = 3; 37 | static const AIStatus AI_INVALID_API = 7; 38 | static const AIStatus AI_INVALID_POINTER = 8; 39 | 40 | enum AiModelDescription_Frequency { 41 | AiModelDescription_Frequency_LOW = 1, 42 | AiModelDescription_Frequency_MEDIUM = 2, 43 | AiModelDescription_Frequency_HIGH = 3, 44 | AiModelDescription_Frequency_EXTREME = 4, 45 | }; 46 | 47 | enum AiModelDescription_DeviceType { 48 | AiModelDescription_DeviceType_NPU = 0, 49 | AiModelDescription_DeviceType_IPU = 1, 50 | AiModelDescription_DeviceType_MLU = 2, 51 | AiModelDescription_DeviceType_CPU = 3, 52 | }; 53 | 54 | enum AiModelDescription_Framework { 55 | HIAI_FRAMEWORK_NONE = 0, 56 | HIAI_FRAMEWORK_TENSORFLOW, 57 | HIAI_FRAMEWORK_KALDI, 58 | HIAI_FRAMEWORK_CAFFE, 59 | HIAI_FRAMEWORK_TENSORFLOW_8BIT, 60 | HIAI_FRAMEWORK_CAFFE_8BIT, 61 | }; 62 | 63 | enum AiModelDescription_ModelType{ 64 | HIAI_MODELTYPE_ONLINE = 0, 65 | HIAI_MODELTYPE_OFFLINE 66 | }; 67 | 68 | enum AiTensorImage_Format{ 69 | AiTensorImage_YUV420SP_U8 = 0, 70 | AiTensorImage_XRGB8888_U8, 71 | AiTensorImage_YUV400_U8, 72 | AiTensorImage_ARGB8888_U8, 73 | AiTensorImage_YUYV_U8, 74 | AiTensorImage_YUV422SP_U8, 75 | AiTensorImage_AYUV444_U8, 76 | AiTensorImage_RGB888_U8, 77 | AiTensorImage_BGR888_U8, 78 | AiTensorImage_YUV444SP_U8, 79 | AiTensorImage_YVU444SP_U8, 80 | AiTensorImage_INVALID= 255, 81 | }; 82 | enum HIAI_DataType{ 83 | HIAI_DATATYPE_UINT8 = 0, 84 | HIAI_DATATYPE_FLOAT32 = 1, 85 | HIAI_DATATYPE_FLOAT16 = 2, 86 | HIAI_DATATYPE_INT32 = 3, 87 | HIAI_DATATYPE_INT8 = 4, 88 | HIAI_DATATYPE_INT16 = 5, 89 | HIAI_DATATYPE_BOOL = 6, 90 | HIAI_DATATYPE_INT64 = 7, 91 | HIAI_DATATYPE_UINT32 = 8, 92 | HIAI_DATATYPE_DOUBLE = 9, 93 | }; 94 | 95 | class HIAI_API_EXPORT AiContext { 96 | public: 97 | std::string GetPara(const std::string &key) const; 98 | void AddPara(const std::string &key, const std::string &value); 99 | void SetPara(const std::string &key, const std::string &value); 100 | void DelPara(const std::string &key); 101 | void ClearPara(); 102 | AIStatus GetAllKeys(std::vector &keys); 103 | private: 104 | std::mapparas_; 105 | }; 106 | 107 | class HIAI_API_EXPORT TensorDimension { 108 | public: 109 | TensorDimension(); 110 | virtual ~TensorDimension(); 111 | 112 | /* 113 | * @brief Tensor初始化接口 114 | * @param [in] number 输入的Tensor的数量 115 | * @param [in] channel 输入的Tensor的通道数 116 | * @param [in] height 输入的Tensor的高度 117 | * @param [in] width 输入的Tensor的宽度 118 | * @return 无 119 | */ 120 | TensorDimension(uint32_t number, uint32_t channel, uint32_t height, uint32_t weight); 121 | 122 | void SetNumber(const uint32_t number); 123 | uint32_t GetNumber() const; 124 | void SetChannel(const uint32_t channel); 125 | uint32_t GetChannel() const; 126 | void SetHeight(const uint32_t height); 127 | uint32_t GetHeight() const; 128 | void SetWidth(const uint32_t width); 129 | uint32_t GetWidth() const; 130 | bool IsEqual(const TensorDimension &dim); 131 | 132 | private: 133 | uint32_t n{0}; 134 | uint32_t c{0}; 135 | uint32_t h{0}; 136 | uint32_t w{0}; 137 | }; 138 | 139 | class AiTensorLegacy; 140 | class HIAI_API_EXPORT AiTensor { 141 | public: 142 | AiTensor(); 143 | virtual ~AiTensor(); 144 | 145 | /* 146 | * @brief Tensor初始化接口 147 | * @param [in] dim 输入tensor的尺寸结构信息 148 | * @return AIStatus::AI_SUCCESS 成功 149 | * @return Others 失败 150 | */ 151 | AIStatus Init(const TensorDimension* dim); 152 | /* 153 | * @brief Tensor初始化接口 154 | * @param [in] dim 输入tensor的尺寸结构信息 155 | * @param [in] DataType数据类型 156 | * @return AIStatus::AI_SUCCESS 成功 157 | * @return Others 失败 158 | */ 159 | AIStatus Init(const TensorDimension* dim, HIAI_DataType pdataType); 160 | /* 161 | * @brief Tensor初始化接口 162 | * @param [in] handle ION内存信息 163 | * @param [in] dim 输入tensor的尺寸结构信息 164 | * @param [in] DataType数据类型 165 | * @return AIStatus::AI_SUCCESS 成功 166 | * @return Others 失败 167 | */ 168 | AIStatus Init(const NativeHandle& handle, const TensorDimension* dim, HIAI_DataType pdataType); 169 | /* 170 | * @brief Tensor初始化接口 171 | * @param [in] number 输入的Tensor的数量 172 | * @param [in] height 输入的Tensor的高度 173 | * @param [in] width 输入的Tensor的宽度 174 | * @param [in] format 输入图片的格式AiTensorImage_Format类型 175 | * @return AIStatus::AI_SUCCESS 成功 176 | * @return Others 失败 177 | */ 178 | AIStatus Init(uint32_t number, uint32_t height, uint32_t width, AiTensorImage_Format format); 179 | 180 | /* 181 | * @brief 获取Tensor buffer地址接口 182 | * @return void* tensor buffer地址 183 | */ 184 | virtual void *GetBuffer() const; 185 | 186 | /* 187 | * @brief 获取Tensor buffer内存大小 188 | * @return void* tensor buffer内存大小 189 | */ 190 | virtual uint32_t GetSize() const; 191 | 192 | AIStatus SetTensorDimension(const TensorDimension* dim); 193 | 194 | TensorDimension GetTensorDimension() const; 195 | 196 | void *GetTensorBuffer() const; 197 | private: 198 | AiTensor(const AiTensor&) = delete; 199 | AiTensor& operator=(const AiTensor&) = delete; 200 | 201 | AIStatus InitWithSize(uint32_t n, uint32_t c, uint32_t h, uint32_t w, uint32_t size); 202 | 203 | private: 204 | std::shared_ptr tensorLegacy_; 205 | void* buffer_{nullptr}; 206 | uint32_t size_{0}; 207 | TensorDimension tensorDimension_; 208 | }; 209 | 210 | class HIAI_API_EXPORT AiModelDescription { 211 | public: 212 | /* 213 | * @brief AiModelDescription初始化描述的构造函数 214 | * @param [in] pmodelName 模型名称 215 | * @param [in] frequency 算力要求等级:AiModelDescription_Frequency 216 | * @param [in] framework 模型平台类型:AiModelDescription_Framework 217 | * @param [in] pmodelType 模型类型:AiModelDescription_ModelType 218 | * @param [in] pdeviceType 设备类型:AiModelDescription_DeviceType 219 | */ 220 | AiModelDescription(const std::string& pmodelName, const int32_t frequency, const int32_t framework, 221 | const int32_t pmodelType, const int32_t pdeviceType); 222 | virtual ~AiModelDescription(); 223 | std::string GetName() const; 224 | void* GetModelBuffer() const; 225 | AIStatus SetModelBuffer(const void* data, uint32_t size); 226 | int32_t GetFrequency() const; 227 | int32_t GetFramework() const; 228 | int32_t GetModelType() const; 229 | int32_t GetDeviceType() const; 230 | uint32_t GetModelNetSize() const; 231 | 232 | private: 233 | friend class ModelManagerClientImplLegacy; 234 | std::string model_name_; 235 | int32_t frequency_{0}; 236 | int32_t framework_{0}; 237 | int32_t modelType_{0}; 238 | int32_t deviceType_{0}; 239 | void *modelNetBuffer_{nullptr}; 240 | uint32_t modelNetSize_{0}; 241 | std::string modelNetKey_; 242 | }; 243 | 244 | class HIAI_API_EXPORT AiModelManagerClientListener { 245 | public: 246 | virtual ~AiModelManagerClientListener(){} 247 | 248 | virtual void OnProcessDone(const AiContext &context, int32_t result, const std::vector> &poutTensor, int32_t piStamp) = 0; 249 | virtual void OnServiceDied() = 0; 250 | }; 251 | 252 | class HIAI_API_EXPORT MemBuffer { 253 | public: 254 | /* 255 | * @brief 获取通用MEMBuffer的内存地址 256 | * @return MEMBuffer的内存地址 257 | */ 258 | void* GetMemBufferData(); 259 | 260 | /* 261 | * @brief 获取通用MEMBuffer的内存大小 262 | * @return MEMBuffer的内存大小 263 | */ 264 | uint32_t GetMemBufferSize(); 265 | 266 | public: 267 | void *data_{nullptr}; 268 | 269 | private: 270 | friend class MembufferUtil; 271 | 272 | void SetMemBufferSize(uint32_t size); 273 | void SetMemBufferData(void* data); 274 | 275 | void SetServerMem(void *serverMem); 276 | void SetAppAllocFlag(bool isAppAlloc); 277 | 278 | void *GetServerMem(); 279 | bool GetAppAllocFlag(); 280 | 281 | uint32_t size_{0}; 282 | void *servermem_{nullptr}; 283 | bool isAppAlloc_{0}; 284 | }; 285 | 286 | } //end namespace hiai 287 | 288 | #endif 289 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: buffer 4 | */ 5 | 6 | #ifndef GE_BUFFER_H 7 | #define GE_BUFFER_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include "detail/attributes_holder.h" 13 | namespace ge { 14 | #ifdef HOST_VISIBILITY 15 | #define GE_FUNC_HOST_VISIBILITY __attribute__((visibility("default"))) 16 | #else 17 | #define GE_FUNC_HOST_VISIBILITY 18 | #endif 19 | #ifdef DEV_VISIBILITY 20 | #define GE_FUNC_DEV_VISIBILITY __attribute__((visibility("default"))) 21 | #else 22 | #define GE_FUNC_DEV_VISIBILITY 23 | #endif 24 | 25 | using std::shared_ptr; 26 | 27 | class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Buffer { 28 | public: 29 | Buffer(); 30 | 31 | Buffer(const Buffer &other); 32 | 33 | explicit Buffer(std::size_t bufferSize, std::uint8_t defualtVal = 0); 34 | 35 | ~Buffer() = default; 36 | 37 | Buffer &operator = (const Buffer &other); 38 | 39 | static Buffer CopyFrom(std::uint8_t *data, std::size_t bufferSize); 40 | 41 | const std::uint8_t *GetData() const; 42 | 43 | std::uint8_t *GetData(); 44 | 45 | std::size_t GetSize() const; 46 | 47 | void ClearBuffer(); 48 | 49 | // for compatibility 50 | inline const std::uint8_t *data() const 51 | { 52 | return GetData(); 53 | } 54 | 55 | inline std::uint8_t *data() 56 | { 57 | return GetData(); 58 | } 59 | inline std::size_t size() const 60 | { 61 | return GetSize(); 62 | } 63 | 64 | inline void clear() 65 | { 66 | return ClearBuffer(); 67 | } 68 | 69 | uint8_t operator[](size_t index) const 70 | { 71 | if (buffer_ != nullptr && index < buffer_->size()) { 72 | return (uint8_t)(*buffer_)[index]; 73 | } 74 | return 0xff; 75 | } 76 | 77 | private: 78 | GeIrProtoHelper data_; 79 | std::string *buffer_ = nullptr; 80 | 81 | // create from protobuf obj 82 | Buffer(const ProtoMsgOwner &protoOnwer, proto::AttrDef *buffer); 83 | 84 | Buffer(const ProtoMsgOwner &protoOnwer, std::string *buffer); 85 | 86 | friend class AttrValueImp; 87 | 88 | friend class Tensor; 89 | }; 90 | } // namespace ge 91 | 92 | #endif // GE_BUFFER_H 93 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/common/securestl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. 3 | * Description: securestl 4 | * 5 | */ 6 | #ifndef _SECURESTL_H_ 7 | #define _SECURESTL_H_ 8 | #include 9 | 10 | namespace hiai { 11 | template 12 | std::shared_ptr make_shared_nothrow(Ts&&... params) 13 | { 14 | return std::shared_ptr(new (std::nothrow) T(std::forward(params)...)); 15 | } 16 | } 17 | #endif -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/compatible/all_ops.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: all_ops 4 | */ 5 | 6 | #ifndef GE_CPT_ALL_OPS_H 7 | #define GE_CPT_ALL_OPS_H 8 | 9 | #include "cpt_array_defs.h" 10 | #include "cpt_const_defs.h" 11 | #include "cpt_detection_defs.h" 12 | #include "cpt_math_defs.h" 13 | #include "cpt_nn_defs.h" 14 | #include "cpt_random_defs.h" 15 | #include "cpt_image_defs.h" 16 | 17 | #endif // GE_CPT_ALL_OPS_H -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/compatible/cpt_const_defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: const_defs 4 | */ 5 | 6 | #ifndef _CCE_GRAPH_OP_GE_OP_CONST_DEFS_H 7 | #define _CCE_GRAPH_OP_GE_OP_CONST_DEFS_H 8 | 9 | #include "./operator_reg.h" 10 | 11 | namespace ge { 12 | /* 13 | * Constant tensor 14 | * 15 | * y : Output tensor containing the same value of the provided tensor 16 | * 17 | * value : Value for the elements of the output tensor 18 | * 19 | * 100.300.010.011 20 | */ 21 | CPT_REG_OP(Const) 22 | .CPT_OUTPUT(y, TensorType({ DT_FLOAT, DT_INT8, DT_INT32, DT_BOOL })) 23 | .CPT_ATTR(value, AttrValue::TENSOR(new (std::nothrow) Tensor(TensorDesc()))) 24 | .CPT_OP_END() 25 | } // namespace ge 26 | 27 | #endif // _CCE_GRAPH_OP_GE_OP_CONST_DEFS_H 28 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/compatible/cpt_detection_defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: detection_defs 4 | */ 5 | #ifndef _CCE_GRAPH_OP_GE_OP_DETECTION_DEFS_H 6 | #define _CCE_GRAPH_OP_GE_OP_DETECTION_DEFS_H 7 | 8 | #include "./operator_reg.h" 9 | #include "../op/detection_defs.h" 10 | 11 | namespace ge { 12 | /* 13 | * Permutes the dimensions of the input according to a given pattern. 14 | * 15 | * x : Input tensor, of the same type as Data. 16 | * w : Deprecated, will be removed in a future version. 17 | * 18 | * y : Has the same shape as the input, but with the dimensions re-ordered according to the specified pattern. 19 | * 20 | * order : Tuple of dimension indices indicating the permutation pattern, whose size >= dimensions of 'x'. 21 | * For instance, x = (4, 4, 4), order = (0, 2, 1). 22 | * 23 | * 100.300.010.011 24 | */ 25 | using hiai::PERMUTE_ATTR_ORDER; 26 | 27 | CPT_REG_OP(Permute) 28 | .CPT_INPUT(x, TensorType ({ DT_FLOAT })) 29 | .CPT_OPTIONAL_INPUT(w, TensorType ({ DT_FLOAT })) 30 | .CPT_OUTPUT(y, TensorType ({ DT_FLOAT })) 31 | .CPT_ATTR(order, AttrValue::LIST_INT { 0 }) 32 | .CPT_OP_END() 33 | } // namespace ge 34 | 35 | #endif // _CCE_GRAPH_OP_GE_OP_DETECTION_DEFS_H 36 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/compatible/cpt_image_defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: image_defs 4 | */ 5 | 6 | #ifndef _CCE_GRAPH_OP_GE_OP_IMAGE_DEFS_H 7 | #define _CCE_GRAPH_OP_GE_OP_IMAGE_DEFS_H 8 | 9 | #include "./operator_reg.h" 10 | #include "../op/image_defs.h" 11 | 12 | namespace ge { 13 | /* 14 | * Extracts crops from the input image tensor and resizes them. 15 | * 16 | * x : 4-D tensor 17 | * boxes : 2-D tensor 18 | * box_index : 1-D tensor. The value of box_index[i] specifies the image that the i-th box refers to. 19 | * 20 | * y : Output tensor 21 | * 22 | * method : Sampling method for resizing either 0 (bilinear) or 1 (nearest). Defaults to 0 (bilinear). 23 | * extrapolation_value : Dimensions to reduce 24 | * crop_size_h : Height 25 | * crop_size_w : Width 26 | * 27 | * 100.310.010.013 28 | */ 29 | CPT_REG_OP(CropAndResize) 30 | .CPT_INPUT(x, TensorType({ DT_FLOAT })) 31 | .CPT_INPUT(boxes, TensorType({ DT_FLOAT })) 32 | .CPT_INPUT(box_index, TensorType({ DT_INT32 })) 33 | .CPT_OUTPUT(y, TensorType({ DT_FLOAT })) 34 | .CPT_ATTR(method, AttrValue::INT { 0 }) 35 | .CPT_ATTR(extrapolation_value, AttrValue::FLOAT { 0 }) 36 | .CPT_ATTR(crop_size_h, AttrValue::INT { 0 }) 37 | .CPT_ATTR(crop_size_w, AttrValue::INT { 0 }) 38 | .CPT_OP_END() 39 | 40 | /* 41 | * Resizes images to 'size' using bilinear interpolation. 42 | * 43 | * x : 4-D tensor 44 | * size : 1-D tensor with shape [height, width] 45 | * 46 | * y : Output tensor 47 | * 48 | * align_corners : If true, the centers of the 4 corner pixels of the input and output tensors 49 | * are aligned, preserving the values at the corner pixels. 50 | * 51 | * 100.310.010.013 52 | */ 53 | using hiai::RESIZE_BILINEAR_ATTR_ALIGN_CORNERS; 54 | 55 | CPT_REG_OP(ResizeBilinear) 56 | .CPT_INPUT(x, TensorType({ DT_FLOAT })) 57 | .CPT_INPUT(size, TensorType({ DT_INT32 })) 58 | .CPT_OUTPUT(y, TensorType({ DT_FLOAT })) 59 | .CPT_ATTR(align_corners, AttrValue::BOOL { false }) 60 | .CPT_OP_END() 61 | 62 | /* 63 | * Resizes images to 'size' using bilinear interpolation. 64 | * 65 | * x : 4-D tensor 66 | * size : 1-D tensor with shape [height, width] 67 | * 68 | * y : Output tensor 69 | * 70 | * align_corners : If true, the centers of the 4 corner pixels of the input and output tensors 71 | * are aligned, preserving the values at the corner pixels. 72 | * 73 | * half_pixel_centers : If true, the align_corners must be false. and this attr change the mapping way 74 | * to src image, default value is false. 75 | * 76 | * 100.320.010.xxx 77 | */ 78 | CPT_REG_OP(ResizeBilinearExt2) 79 | .CPT_INPUT(x, TensorType({ DT_FLOAT })) 80 | .CPT_INPUT(size, TensorType({ DT_INT32 })) 81 | .CPT_OUTPUT(y, TensorType({ DT_FLOAT })) 82 | .CPT_ATTR(align_corners, AttrValue::BOOL { false }) 83 | .CPT_ATTR(half_pixel_centers, AttrValue::BOOL { false }) 84 | .CPT_OP_END() 85 | 86 | 87 | /* 88 | * Resizes images to 'size' using nearest neighbor interpolation. 89 | * 90 | * image : 4-D with shape [batch, height, width, channels]. 91 | * size : 1-D of two elements 92 | * 93 | * y : Output tensor 94 | * 95 | * align_corners : If true, the centers of the 4 corner pixels of the input and output tensors are aligned, 96 | * preserving the values at the corner pixels. Defaults to false 97 | * 98 | * 100.310.010.013 99 | */ 100 | CPT_REG_OP(ResizeNearestNeighbor) 101 | .CPT_INPUT(image, TensorType({ DT_FLOAT })) 102 | .CPT_INPUT(size, TensorType({ DT_INT32 })) 103 | .CPT_OUTPUT(y, TensorType({ DT_FLOAT })) 104 | .CPT_ATTR(align_corners, AttrValue::BOOL { false }) 105 | .CPT_OP_END() 106 | 107 | /* 108 | * Interpolation operation to adjust image shape. 109 | * 110 | * x : 4-D tensor with shape [batch, depth, height, width], and must be non const op. 111 | * 112 | * y : the output tensor of 4-D. 113 | * 114 | * height : height of output, must be greater than 0. 115 | * width : width of output, must be greater than 0. 116 | * shrink_factor : shrink factor, must be greater than 0. 117 | * zoom_factor : zoom factor, must be greater than 0. 118 | * pad_begin : padding at begin of input, must be less than or equal to 0. 119 | * pad_end : padding at end of input, must be less than or equal to 0. 120 | * 121 | * 100.320.010.010 122 | */ 123 | CPT_REG_OP(Interp) 124 | .CPT_INPUT(x, TensorType({DT_FLOAT})) 125 | .CPT_OUTPUT(y, TensorType({DT_FLOAT})) 126 | .CPT_ATTR(height, AttrValue::INT{0}) 127 | .CPT_ATTR(width, AttrValue::INT{0}) 128 | .CPT_ATTR(shrink_factor, AttrValue::INT{1}) 129 | .CPT_ATTR(zoom_factor, AttrValue::INT{1}) 130 | .CPT_ATTR(pad_begin, AttrValue::INT{0}) 131 | .CPT_ATTR(pad_end, AttrValue::INT{0}) 132 | .CPT_OP_END() 133 | 134 | /* To crop ,elements of the first input are selected to fit the dimensions of the second input. 135 | * 136 | * x : The tensor to be croped. 137 | * size : The size of the input x to be croped. 138 | * 139 | * y : The output tensor. 140 | * 141 | * axis : The Dimension of input which to be croped. 142 | * offsets : The offsets of input x. 143 | * 144 | * 100.320.010.010 145 | */ 146 | using hiai::CROP_ATTR_NAME_OFFSETS; 147 | using hiai::CROP_ATTR_NAME_AXIS; 148 | 149 | CPT_REG_OP(Crop) 150 | .CPT_INPUT(x, TensorType({DT_FLOAT, DT_INT32, DT_UINT8, DT_BOOL})) 151 | .CPT_INPUT(size, TensorType({DT_FLOAT, DT_INT32})) 152 | .CPT_OUTPUT(y, TensorType({DT_FLOAT, DT_INT32, DT_UINT8, DT_BOOL})) 153 | .CPT_ATTR(axis, AttrValue::INT{2}) 154 | .CPT_REQUIRED_ATTR(offsets, AttrValue::LIST_INT) 155 | .CPT_OP_END() 156 | } // namespace ge 157 | 158 | #endif // _CCE_GRAPH_OP_GE_OP_IMAGE_DEFS_H 159 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/compatible/cpt_random_defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: random_defs 4 | */ 5 | 6 | #ifndef _CCE_GRAPH_OP_GE_OP_RANDOM_DEFS_H 7 | #define _CCE_GRAPH_OP_GE_OP_RANDOM_DEFS_H 8 | 9 | #include "./operator_reg.h" 10 | 11 | namespace ge { 12 | /* 13 | * Outputs random values from a uniform distribution. 14 | * 15 | * shape : 1-D tensor, shape of the output tensor. Only a 1D-4D tensor can be generated. 16 | * minval : 0-D const, lower bound on the range of random values to generate 17 | * maxval : 0-D const, upper bound on the range of random values to generate 18 | * 19 | * y : Result tensor of the same element type as 'shape' 20 | * 21 | * 100.310.010.013 22 | */ 23 | CPT_REG_OP(RandomUniform) 24 | .CPT_INPUT(shape, TensorType ({ DT_INT32 })) 25 | .CPT_INPUT(minval, TensorType ({ DT_FLOAT })) 26 | .CPT_INPUT(maxval, TensorType ({ DT_FLOAT })) 27 | .CPT_OUTPUT(y, TensorType ({ DT_FLOAT })) 28 | .CPT_OP_END() 29 | 30 | /* 31 | * Extract samples from multiple distributions. 32 | * 33 | * x : Input tensor 34 | * num_samples : 0-D, number of independent samples to draw for each row slice. If the datatype of size is 35 | * DT_FOLAT, the elements must be >= 1. 36 | * 37 | * y : Output tensor 38 | * 39 | * seed : If either 'seed' or 'seed2' is set to non-zero, the internal random number generator is seeded by 40 | * the given seed. Otherwise, a random seed is used. 41 | * seed2 : Second seed to avoid seed collision 42 | * 43 | * 100.310.010.013 44 | */ 45 | CPT_REG_OP(Multinomial) 46 | .CPT_INPUT(x, TensorType({ DT_FLOAT })) 47 | .CPT_INPUT(num_samples, TensorType({ DT_INT32,DT_FLOAT, DT_UINT8 })) 48 | .CPT_OUTPUT(y, TensorType({ DT_INT32 })) 49 | .CPT_ATTR(seed, AttrValue::INT { 0 }) 50 | .CPT_ATTR(seed2, AttrValue::INT { 0 }) 51 | .CPT_OP_END() 52 | } // namespace ge 53 | 54 | #endif // _CCE_GRAPH_OP_GE_OP_RANDOM_DEFS_H 55 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/debug/ge_error_codes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: ge_error_codes 4 | */ 5 | 6 | #ifndef GE_ERROR_CODES_H 7 | #define GE_ERROR_CODES_H 8 | 9 | namespace ge { 10 | #ifdef HOST_VISIBILITY 11 | #define GE_FUNC_HOST_VISIBILITY __attribute__((visibility("default"))) 12 | #else 13 | #define GE_FUNC_HOST_VISIBILITY 14 | #endif 15 | #ifdef DEV_VISIBILITY 16 | #define GE_FUNC_DEV_VISIBILITY __attribute__((visibility("default"))) 17 | #else 18 | #define GE_FUNC_DEV_VISIBILITY 19 | #endif 20 | 21 | using GraphErrCodeStatus = uint32_t; 22 | const GraphErrCodeStatus GRAPH_FAILED = 0xFFFFFFFF; 23 | const GraphErrCodeStatus GRAPH_SUCCESS = 0; 24 | const GraphErrCodeStatus GRAPH_PARAM_INVALID = 50331649; 25 | } // namespace ge 26 | 27 | #endif // GE_ERROR_CODES_H 28 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/detail/attributes_holder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: attributes_holder 4 | */ 5 | 6 | #ifndef GE_ATTRIBUTES_HOLDER_H 7 | #define GE_ATTRIBUTES_HOLDER_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "../debug/ge_error_codes.h" 15 | namespace google { 16 | namespace protobuf { 17 | class MessageLite; 18 | 19 | template 20 | class Map; 21 | } // namespace protobuf 22 | } // namespace google 23 | 24 | namespace ge { 25 | using std::string; 26 | 27 | class AttrValue; 28 | 29 | namespace proto { 30 | class AttrDef; 31 | 32 | class TensorDef; 33 | 34 | class TensorDescriptor; 35 | 36 | class ShapeDef; 37 | 38 | class NamedAttrs; 39 | 40 | class ModelDef; 41 | 42 | class OpDef; 43 | 44 | class GraphDef; 45 | } // namespace proto 46 | 47 | using ProtoAttrMap = ::google::protobuf::Map<::std::string, ::ge::proto::AttrDef>; 48 | using ProtoMsgOwner = std::shared_ptr<::google::protobuf::MessageLite>; 49 | 50 | template 51 | class GeIrProtoHelper { 52 | public: 53 | GeIrProtoHelper(const ProtoMsgOwner &protoOwner, ProtoType *protoMsg) 54 | : protoOwner_(protoOwner), 55 | protoMsg_(protoMsg) {} 56 | 57 | GeIrProtoHelper() 58 | { 59 | protoOwner_ = std::shared_ptr<::google::protobuf::MessageLite>(nullptr); 60 | protoMsg_ = nullptr; 61 | } 62 | 63 | virtual ~GeIrProtoHelper() = default; 64 | 65 | template 66 | GeIrProtoHelper(const GeIrProtoHelper &other) 67 | { 68 | protoOwner_ = other.protoOwner_; 69 | protoMsg_ = other.protoMsg_; 70 | } 71 | 72 | template 73 | GeIrProtoHelper &operator = (const GeIrProtoHelper &other) 74 | { 75 | protoOwner_ = other.protoOnwer_; 76 | protoMsg_ = other.protoMsg_; 77 | return *this; 78 | } 79 | 80 | void InitDefault(); 81 | 82 | template 83 | bool operator == (const GeIrProtoHelper &other) const 84 | { 85 | return protoOwner_ == other.protoOwner_ && protoMsg_ == other.protoMsg_; 86 | } 87 | 88 | inline const ProtoMsgOwner &GetProtoOwner() const 89 | { 90 | return protoOwner_; 91 | } 92 | 93 | inline ProtoType *GetProtoMsg() const 94 | { 95 | return protoMsg_; 96 | } 97 | 98 | void CopyValueFrom(const GeIrProtoHelper &other) 99 | { 100 | if (other.protoMsg_ != nullptr && protoMsg_ != nullptr) { 101 | *protoMsg_ = *other.protoMsg_; 102 | } 103 | } 104 | 105 | void MoveValueFrom(GeIrProtoHelper &&other) 106 | { 107 | if (other.protoMsg_ != nullptr && protoMsg_ != nullptr) { 108 | *protoMsg_ = std::move(*other.protoMsg_); 109 | } 110 | } 111 | 112 | public: 113 | ProtoMsgOwner protoOwner_ = nullptr; 114 | ProtoType *protoMsg_ = nullptr; 115 | 116 | friend class GeIrProtoHelper::value, 117 | typename std::remove_const::type, const ProtoType>::type>; 118 | }; 119 | 120 | using ProtoAttrMapHelper = GeIrProtoHelper; 121 | using ConstProtoAttrMapHelper = GeIrProtoHelper; 122 | 123 | class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY AttrHolder { 124 | public: 125 | AttrHolder() = default; 126 | 127 | virtual ~AttrHolder() = default; 128 | 129 | GraphErrCodeStatus SetAttr(const string &name, const AttrValue &value); 130 | 131 | GraphErrCodeStatus GetAttr(const string &name, AttrValue &value) const; 132 | 133 | bool HasAttr(const string &name) const; 134 | 135 | GraphErrCodeStatus DelAttr(const string &name); 136 | 137 | protected: 138 | GraphErrCodeStatus AddRequiredAttr(const std::string &name); 139 | 140 | const std::unordered_set GetAllAttrNames() const; 141 | 142 | const std::map GetAllAttrs() const; 143 | protected: 144 | virtual ProtoAttrMapHelper MutableAttrMap() = 0; 145 | 146 | virtual ConstProtoAttrMapHelper GetAttrMap() const = 0; 147 | 148 | friend class ModelSerializeImp; 149 | 150 | friend class AttrUtils; 151 | 152 | friend class AttrUtilsHelper; 153 | 154 | std::vector requiredAttrs_; 155 | }; 156 | } // namespace ge 157 | 158 | #endif // GE_ATTRIBUTES_HOLDER_H 159 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/graph.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: graph 4 | */ 5 | 6 | #ifndef GE_GRAPH_H 7 | #define GE_GRAPH_H 8 | 9 | #include 10 | #include "operator.h" 11 | 12 | namespace ge { 13 | class GraphImpl; 14 | 15 | using GraphImplPtr = std::shared_ptr; 16 | 17 | class GE_FUNC_HOST_VISIBILITY GE_FUNC_DEV_VISIBILITY Graph { 18 | friend class GraphUtils; 19 | 20 | public: 21 | explicit Graph(const std::string &name); 22 | 23 | Graph() = default; 24 | 25 | ~Graph() = default; 26 | 27 | Graph &SetInputs(std::vector &inputs); 28 | 29 | Graph &SetOutputs(std::vector &outputs); 30 | 31 | bool IsValid() const; 32 | 33 | GraphErrCodeStatus AddOp(ge::Operator &op); 34 | 35 | ge::Operator FindOpByName(const string &name) const; 36 | 37 | GraphErrCodeStatus CheckOpByName(const string &name) const; 38 | 39 | GraphErrCodeStatus GetAllOpName(std::vector &opName) const; 40 | 41 | private: 42 | GraphImplPtr impl_{ nullptr }; 43 | }; 44 | } // namespace ge 45 | 46 | #endif // GE_MODEL_H 47 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/model.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: model 4 | */ 5 | 6 | #ifndef GE_MODEL_H 7 | #define GE_MODEL_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include "graph.h" 13 | #include "attr_value.h" 14 | #include "detail/attributes_holder.h" 15 | 16 | namespace ge { 17 | using std::map; 18 | using std::string; 19 | using std::vector; 20 | 21 | class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Model : public AttrHolder { 22 | public: 23 | Model(); 24 | 25 | ~Model() = default; 26 | 27 | explicit Model(const string &name, const string &customVersion); 28 | 29 | string GetName() const; 30 | 31 | void SetName(const string &name); 32 | 33 | uint32_t GetVersion() const; 34 | 35 | void SetVersion(uint32_t version) 36 | { 37 | version_ = version; 38 | } 39 | 40 | std::string GetPlatformVersion() const; 41 | 42 | void SetPlatformVersion(string version) 43 | { 44 | platform_version_ = version; 45 | } 46 | 47 | Graph GetGraph() const; 48 | 49 | void SetGraph(const Graph &graph); 50 | 51 | using AttrHolder::GetAllAttrNames; 52 | using AttrHolder::GetAllAttrs; 53 | using AttrHolder::GetAttr; 54 | using AttrHolder::HasAttr; 55 | using AttrHolder::SetAttr; 56 | 57 | GraphErrCodeStatus Save(Buffer &buffer) const; 58 | 59 | // model will be rewrite 60 | static GraphErrCodeStatus Load(const uint8_t *data, size_t len, Model &model); 61 | 62 | bool IsValid() const; 63 | 64 | private: 65 | void Init(); 66 | 67 | private: 68 | ProtoAttrMapHelper MutableAttrMap() override; 69 | 70 | ConstProtoAttrMapHelper GetAttrMap() const override; 71 | 72 | ProtoAttrMapHelper attrs_; 73 | 74 | friend class ModelSerializeImp; 75 | 76 | friend class GraphDebugImp; 77 | 78 | string name_; 79 | uint32_t version_; 80 | std::string platform_version_{ "" }; 81 | Graph graph_; 82 | }; 83 | 84 | } // namespace ge 85 | 86 | #endif // GE_MODEL_H 87 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/op/all_ops.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: all_ops 4 | */ 5 | 6 | #ifndef GE_OP_ALL_OPS_H 7 | #define GE_OP_ALL_OPS_H 8 | 9 | #include "array_defs.h" 10 | #include "const_defs.h" 11 | #include "detection_defs.h" 12 | #include "math_defs.h" 13 | #include "nn_defs.h" 14 | #include "random_defs.h" 15 | #include "image_defs.h" 16 | 17 | #endif // GE_OP_ALL_OPS_H 18 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/op/const_defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: const_defs 4 | */ 5 | 6 | #ifndef _HIAI_GRAPH_OP_GE_OP_CONST_DEFS_H 7 | #define _HIAI_GRAPH_OP_GE_OP_CONST_DEFS_H 8 | 9 | #include "../operator_hiai_reg.h" 10 | 11 | namespace hiai { 12 | /* 13 | * Constant tensor 14 | * 15 | * y : Output tensor containing the same value of the provided tensor 16 | * 17 | * value : Value for the elements of the output tensor 18 | * 19 | * 100.300.010.011 20 | */ 21 | REG_OP(Const) 22 | .OUTPUT(y, TensorType({ DT_FLOAT, DT_INT8, DT_INT32, DT_BOOL })) 23 | .ATTR(value, AttrValue::TENSOR(new (std::nothrow) Tensor(TensorDesc()))) 24 | .OP_END() 25 | } // namespace hiai 26 | 27 | #endif // _HIAI_GRAPH_OP_GE_OP_CONST_DEFS_H -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/op/detection_defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: detection_defs 4 | */ 5 | #ifndef _HIAI_GRAPH_OP_GE_OP_DETECTION_DEFS_H 6 | #define _HIAI_GRAPH_OP_GE_OP_DETECTION_DEFS_H 7 | #pragma GCC diagnostic push 8 | #pragma GCC diagnostic ignored "-Wuninitialized" 9 | #pragma GCC diagnostic ignored "-Wunused-parameter" 10 | 11 | #include "../operator_hiai_reg.h" 12 | 13 | namespace hiai { 14 | /* 15 | * Permutes the dimensions of the input according to a given pattern. 16 | * 17 | * x : Input tensor. 18 | * 19 | * y : Has the same shape as the input, but with the dimensions re-ordered according to the specified pattern. 20 | * 21 | * order : Tuple of dimension indices indicating the permutation pattern, list of dimension indices. 22 | * 23 | * 100.300.010.011 24 | */ 25 | const char* const PERMUTE_ATTR_ORDER = "order"; 26 | 27 | REG_OP(Permute) 28 | .INPUT(x, TensorType({ DT_FLOAT })) 29 | .OUTPUT(y, TensorType({ DT_FLOAT })) 30 | .ATTR(order, AttrValue::LIST_INT ({ 0 })) 31 | .OP_END() 32 | 33 | /* 34 | * A layer in Faster R-CNN net, the role of FSRDetectionOutput is to generate the number and coordinate of label boxes 35 | * according to position offset of prior box and adjusting parameters(nms threshold and confidence threshold). 36 | * 37 | * rois : The coordinate of prior boxes. 38 | * bbox_delta : The position offset. 39 | * score : The probability score of all prior boxes. 40 | * im_info : The image information. Const Op. (img_height, img_width) 41 | * actual_rois_num: Reserved. 42 | * 43 | * actual_bbox_num : The number of output box. 44 | * box : The coordinate of output box. 45 | * 46 | * num_classes: The number of classes, and must be larger than 1. 47 | * score_threshold: Confidence threshold parameter, and must be between 0 and 1. 48 | * iou_threshold: Non maximum suppression threshold and must be between 0 and 1. 49 | * batch_rois: The parameter of batch_size, and must be between 1 and 65535. 50 | * N (number of rois) / batch_size should be a multiple of 16. 51 | * 52 | * 100.320.010.010 53 | */ 54 | const char* const FRS_DETECTIONOUTPUT_ATTR_NUM_CLASSES = "num_classes"; 55 | const char* const FRS_DETECTIONOUTPUT_ATTR_BATCH_ROIS = "batch_rois"; 56 | const char* const FRS_DETECTIONOUTPUT_ATTR_IOU_THRESHOLD = "iou_threshold"; 57 | const char* const FRS_DETECTIONOUTPUT_ATTR_SCORE_THRESHOLD = "score_threshold"; 58 | 59 | REG_OP(FSRDetectionOutput) 60 | .INPUT(rois, TensorType({ DT_FLOAT })) 61 | .INPUT(bbox_delta, TensorType({ DT_FLOAT })) 62 | .INPUT(score, TensorType({ DT_FLOAT })) 63 | .INPUT(im_info, TensorType({ DT_INT32 })) 64 | .OPTIONAL_INPUT(actual_rois_num, TensorType({ DT_FLOAT })) 65 | .OUTPUT(actual_bbox_num, TensorType({ DT_INT32 })) 66 | .OUTPUT(box, TensorType({ DT_FLOAT })) 67 | .REQUIRED_ATTR(num_classes, AttrValue::INT) 68 | .REQUIRED_ATTR(score_threshold, AttrValue::FLOAT) 69 | .REQUIRED_ATTR(iou_threshold, AttrValue::FLOAT) 70 | .ATTR(batch_rois, AttrValue::INT { 1 }) 71 | .OP_END() 72 | 73 | /* 74 | * Apply postprocessing steps to bounding box detections 75 | * 76 | * score: the score of each anchor with each class. 77 | * bbox_delta: the bounding box deltas. 78 | * anchors: the shape of each predefined anchor. 79 | * 80 | * detect_scores: the score of each output detections. 81 | * rois: the coordinates of each output bounding box,with format [detect_scores, score, rois, bbox_delta]. 82 | * detect_class: the class label for each output detection. 83 | * actual_rois_num: the number of valid output detections for each batch. 84 | * 85 | * scale_y: the scaling factor for dy in bounding box deltas. 86 | * scale_x: the scaling factor for dx in bounding box deltas. 87 | * scale_h: the scaling factor for dh in bounding box deltas. 88 | * scale_w: the scaling factor for dw in bounding box deltas. 89 | * max_num_detections: the maxmum number of boxes for the output Boxes with the lowest scores are descarded to 90 | * meet the limit. 91 | * score_threshold: the score threshold, boxes with scores lower than the threshold are filtered before sending 92 | * to the NMS algorithm. 93 | * iou_threshold: the iou threshold for hard NMS. 94 | * use_regular_nms: setting to true to use regular multi-class NMS algorithm that do NMS separately for each class 95 | * and false for a faster algorithm that only do one single NMS using the highest class score 96 | * max_classes_per_detection: using when use_regular_nms is set to false, specifying the maximum number of classes 97 | * per detection. 98 | * max_detections_per_class: using when use_regular_nms is set to true, specifying the maximum number of detections 99 | * when applying NMS algorithm for each single class. 100 | * is_bg_in_label: set to true to include background class in the list of label map for the output, set fo false 101 | * to not include the background. 102 | * 103 | * 104 | * 100.320.010.010 105 | */ 106 | const char* const DETECTIONPOSTPROCESSING_ATTR_SCALE_Y = "scale_y"; 107 | const char* const DETECTIONPOSTPROCESSING_ATTR_SCALE_X = "scale_x"; 108 | const char* const DETECTIONPOSTPROCESSING_ATTR_SCALE_H = "scale_h"; 109 | const char* const DETECTIONPOSTPROCESSING_ATTR_SCALE_W = "scale_w"; 110 | const char* const DETECTIONPOSTPROCESSING_ATTR_MAX_NUM_DETECTIONS = "max_num_detections"; 111 | const char* const DETECTIONPOSTPROCESSING_ATTR_SCORE_THRESHOLD = "score_threshold"; 112 | const char* const DETECTIONPOSTPROCESSING_ATTR_IOU_THRESHOLD = "iou_threshold"; 113 | const char* const DETECTIONPOSTPROCESSING_ATTR_USE_REGULAR_NMS = "use_regular_nms"; 114 | const char* const DETECTIONPOSTPROCESSING_ATTR_MAX_CLASSES_PER_DETECTION = "max_classes_per_detection"; 115 | const char* const DETECTIONPOSTPROCESSING_ATTR_MAX_DETECTIONS_PER_CLASS = "max_detections_per_class"; 116 | const char* const DETECTIONPOSTPROCESSING_ATTR_IS_BG_IN_LABEL = "is_bg_in_label"; 117 | 118 | REG_OP(DetectionPostprocessing) 119 | .INPUT(score, TensorType({ DT_FLOAT })) 120 | .INPUT(bbox_delta, TensorType({ DT_FLOAT })) 121 | .INPUT(anchors, TensorType({ DT_FLOAT })) 122 | .OUTPUT(detect_scores, TensorType({ DT_FLOAT })) 123 | .OUTPUT(rois, TensorType({ DT_FLOAT })) 124 | .OUTPUT(detect_class, TensorType({ DT_INT32 })) 125 | .OUTPUT(actual_rois_num, TensorType({ DT_INT32 })) 126 | .REQUIRED_ATTR(scale_y, AttrValue::FLOAT) 127 | .REQUIRED_ATTR(scale_x, AttrValue::FLOAT) 128 | .REQUIRED_ATTR(scale_h, AttrValue::FLOAT) 129 | .REQUIRED_ATTR(scale_w, AttrValue::FLOAT) 130 | .REQUIRED_ATTR(max_num_detections, AttrValue::INT) 131 | .REQUIRED_ATTR(score_threshold, AttrValue::FLOAT) 132 | .REQUIRED_ATTR(iou_threshold, AttrValue::FLOAT) 133 | .ATTR(use_regular_nms, AttrValue::BOOL { false }) 134 | .ATTR(max_classes_per_detection, AttrValue::INT { 1 }) 135 | .ATTR(max_detections_per_class, AttrValue::INT { 1 }) 136 | .ATTR(is_bg_in_label, AttrValue::BOOL { false }) 137 | .OP_END() 138 | /* 139 | * A layer in SSD net, the role of SSDDetectionOutput is to generate the number and coordinate of label boxes 140 | * according to position offset of prior box and adjusting parameters(nms threshold and confidence threshold). 141 | * only support in CPUCL 142 | * 143 | * mbox_conf : Input tensor. 144 | * mbox_loc : Input tensor. 145 | * mbox_priorbox : Input tensor. 146 | * 147 | * out_boxnum : The number of output box. 148 | * regionProposal : Region proposal output tensor 149 | * 150 | * num_classes: The number of classes. 151 | * shared_location: if true, bounding box are shared among different classes. 152 | * background_label_id: Background label id. If there is no background class,set it as -1. 153 | * nms_threshold: Non maximum suppression threshold and must be between 0 and 1. 154 | * top_k: Number of bboxes to be considered for per class before NMS. 155 | * eta: Parameter for adaptive nms. 156 | * variance_encoded_in_target: If true, variance is encoded in target; 157 | * code_type: Type of coding method for bbox. 158 | * keep_top_k: Number of total bboxes to be kept per image after nms step. 159 | * confidence_threshold: Confidence threshold parameter, and must be between 0 and 1. 160 | * 161 | * 100.500.010.010 162 | */ 163 | REG_OP(SSDDetectionOutput) 164 | .INPUT(mbox_conf, TensorType({ DT_FLOAT })) 165 | .INPUT(mbox_loc, TensorType({ DT_FLOAT })) 166 | .INPUT(mbox_priorbox, TensorType({ DT_FLOAT })) 167 | .OUTPUT(out_boxnum, TensorType({ DT_INT32 })) 168 | .OUTPUT(regionProposal, TensorType({ DT_FLOAT })) 169 | .REQUIRED_ATTR(num_classes, AttrValue::INT) 170 | .ATTR(shared_location, AttrValue::BOOL { false }) 171 | .ATTR(background_label_id, AttrValue::INT { 0 }) 172 | .ATTR(nms_threshold, AttrValue::FLOAT { 0.3f }) 173 | .ATTR(top_k, AttrValue::INT { 200 }) 174 | .ATTR(eta, AttrValue::FLOAT { 1.0f }) 175 | .ATTR(variance_encoded_in_target, AttrValue::BOOL { false }) 176 | .ATTR(code_type, AttrValue::INT { 2 }) 177 | .ATTR(keep_top_k, AttrValue::INT { 200 }) 178 | .ATTR(confidence_threshold, AttrValue::FLOAT { 0.1f }) 179 | .OP_END() 180 | } // namespace hiai 181 | #pragma GCC diagnostic pop 182 | #endif // _HIAI_GRAPH_OP_GE_OP_DETECTION_DEFS_H -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/op/random_defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: random_defs 4 | */ 5 | 6 | #ifndef _HIAI_GRAPH_OP_GE_OP_RANDOM_DEFS_H 7 | #define _HIAI_GRAPH_OP_GE_OP_RANDOM_DEFS_H 8 | 9 | #pragma GCC diagnostic push 10 | #pragma GCC diagnostic ignored "-Wuninitialized" 11 | #pragma GCC diagnostic ignored "-Wunused-parameter" 12 | 13 | #include "../operator_hiai_reg.h" 14 | 15 | namespace hiai { 16 | /* 17 | * Outputs random values from a uniform distribution. 18 | * 19 | * shape : 1-D const, shape of the output tensor. Only a 1D-4D tensor can be generated. 20 | * minval : 0-D const, lower bound on the range of random values to generate. 21 | * maxval : 0-D const, upper bound on the range of random values to generate. 22 | * 23 | * y : Result tensor of the same element shape as 'shape'. 24 | * 25 | * 100.310.010.013 26 | */ 27 | REG_OP(RandomUniformNoSeed) 28 | .INPUT(shape, TensorType ({ DT_INT32 })) 29 | .INPUT(minval, TensorType ({ DT_FLOAT })) 30 | .INPUT(maxval, TensorType ({ DT_FLOAT })) 31 | .OUTPUT(y, TensorType ({ DT_FLOAT })) 32 | .OP_END() 33 | 34 | /* 35 | * generate random values from a normal distributions. 36 | * 37 | * shape : 1-D const, shape of the output tensor. Only a 1D-4D tensor can be generated. 38 | * mean : 0-D const. The mean of the normal distribution. 39 | * stddev : 0-D const. The standard deviation of the normal distribution. 40 | * 41 | * y : Result tensor of the same element shape as 'shape'. 42 | * 43 | * 100.320.010.010 44 | */ 45 | REG_OP(RandomNormalNoSeed) 46 | .INPUT(shape, TensorType ({ DT_INT32 })) 47 | .INPUT(mean, TensorType ({ DT_FLOAT })) 48 | .INPUT(stddev, TensorType ({ DT_FLOAT })) 49 | .OUTPUT(y, TensorType ({ DT_FLOAT })) 50 | .OP_END() 51 | 52 | /* 53 | * Randomly shuffles a tensor along its first dimension 54 | * 55 | * x : A tensor. 56 | * 57 | * y : A tensor 58 | * 59 | * 100.320.010.010 60 | */ 61 | REG_OP(RandomShuffleNoSeed) 62 | .INPUT(x, TensorType({ DT_UINT8, DT_FLOAT, DT_BOOL, DT_INT32 })) 63 | .OUTPUT(y, TensorType({ DT_UINT8, DT_FLOAT, DT_BOOL, DT_INT32 })) 64 | .OP_END() 65 | 66 | /* 67 | * Extract samples from multiple distributions. 68 | * 69 | * x : Input tensor, only support 2-D. 70 | * num_samples : 0-D, number of independent samples to draw for each row slice. If the datatype of size is 71 | * DT_FOLAT, the elements must be >= 1. 72 | * 73 | * y : Output tensor 74 | * 75 | * seed : If either 'seed' or 'seed2' is set to non-zero, the internal random number generator is seeded by 76 | * the given seed. Otherwise, a random seed is used. 77 | * seed2 : Second seed to avoid seed collision 78 | * 79 | * 100.310.010.013 80 | */ 81 | 82 | const char* const MULTNOMIAL_ATTR_SEED = "seed"; 83 | const char* const MULTNOMIAL_ATTR_SEED2 = "seed2"; 84 | 85 | REG_OP(Multinomial) 86 | .INPUT(x, TensorType({ DT_FLOAT })) 87 | .INPUT(num_samples, TensorType({ DT_INT32,DT_FLOAT, DT_UINT8 })) 88 | .OUTPUT(y, TensorType({ DT_INT32 })) 89 | .ATTR(seed, AttrValue::INT { 0 }) 90 | .ATTR(seed2, AttrValue::INT { 0 }) 91 | .OP_END() 92 | 93 | } // namespace hiai 94 | 95 | #pragma GCC diagnostic pop 96 | #endif // _HIAI_GRAPH_OP_GE_OP_RANDOM_DEFS_H -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/op_reg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: op_reg 4 | */ 5 | 6 | #ifndef HIAI_OP_REG_COM_H 7 | #define HIAI_OP_REG_COM_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "types.h" 14 | #include "tensor.h" 15 | #include "operator.h" 16 | #include "attr_value.h" 17 | 18 | namespace ge { 19 | using std::function; 20 | using std::string; 21 | using std::vector; 22 | using TensorPtr = std::shared_ptr; 23 | 24 | class OpDesc; 25 | 26 | class OpReg { 27 | public: 28 | OpReg &N() 29 | { 30 | return *this; 31 | } 32 | 33 | OpReg &ATTR() 34 | { 35 | return *this; 36 | } 37 | 38 | OpReg &REQUIRED_ATTR() 39 | { 40 | return *this; 41 | } 42 | 43 | OpReg &INPUT() 44 | { 45 | return *this; 46 | } 47 | 48 | OpReg &OPTIONAL_INPUT() 49 | { 50 | return *this; 51 | } 52 | 53 | OpReg &OUTPUT() 54 | { 55 | return *this; 56 | } 57 | 58 | OpReg &INFER_SHAPE_AND_TYPE() 59 | { 60 | return *this; 61 | } 62 | }; 63 | 64 | template 65 | struct GetType { 66 | using type = T; 67 | 68 | void assign(type &left, const T &right) 69 | { 70 | left = right; 71 | } 72 | }; 73 | 74 | template <> 75 | struct GetType { 76 | using type = ConstTensorPtr; 77 | 78 | void assign(type &left, const TensorPtr &right) 79 | { 80 | left = right; 81 | } 82 | }; 83 | 84 | template <> 85 | struct GetType { 86 | using type = ConstComputeGraphPtr; 87 | 88 | void assign(type &left, const ComputeGraphPtr &right) 89 | { 90 | left = right; 91 | } 92 | }; 93 | 94 | template <> 95 | struct GetType> { 96 | using type = vector; 97 | 98 | void assign(type &left, const vector &right) 99 | { 100 | for (auto &item : right) { 101 | left.push_back(item); 102 | } 103 | } 104 | }; 105 | 106 | template <> 107 | struct GetType> { 108 | using type = vector; 109 | 110 | void assign(type &left, const vector &right) 111 | { 112 | for (auto &item : right) { 113 | left.push_back(item); 114 | } 115 | } 116 | }; 117 | 118 | template 119 | using GraphGetType = typename GetType::type; 120 | } // namespace ge 121 | #endif // HIAI_OP_REG_COM_H -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/operator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: operator 4 | */ 5 | 6 | #ifndef GE_OPERATOR_H 7 | #define GE_OPERATOR_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "tensor.h" 14 | #include "debug/ge_error_codes.h" 15 | 16 | namespace ge { 17 | class OperatorImpl; 18 | 19 | using OperatorImplPtr = std::shared_ptr; 20 | 21 | class OpIO; 22 | 23 | using OutHandler = std::shared_ptr; 24 | using InHandler = std::shared_ptr; 25 | 26 | class AttrValue; 27 | 28 | using std::function; 29 | using std::shared_ptr; 30 | using std::string; 31 | 32 | class ComputeGraph; 33 | 34 | class OpDesc; 35 | 36 | using ComputeGraphPtr = std::shared_ptr; 37 | using OpDescPtr = std::shared_ptr; 38 | 39 | class GE_FUNC_HOST_VISIBILITY GE_FUNC_DEV_VISIBILITY Operator { 40 | public: 41 | friend class OperatorImpl; 42 | 43 | friend class GraphBuilderImpl; 44 | 45 | public: 46 | Operator() {}; 47 | 48 | explicit Operator(const string &type); 49 | 50 | explicit Operator(const string &name, const string &type); 51 | 52 | explicit Operator(const string &name, const string &type, int version); 53 | 54 | virtual ~Operator() = default; 55 | 56 | string GetName() const; 57 | 58 | Operator &SetInput(const string &dstName, const Operator &srcOprt); // only has one output index = 0 59 | 60 | Operator &SetInput(const string &dstName, const Operator &srcOprt, const string &name); 61 | 62 | Operator &SetInput(int dstIndex, const Operator &srcOprt, int srcIndex); 63 | 64 | TensorDesc GetInputDesc(const string &name) const; 65 | 66 | TensorDesc GetInputDesc(uint32_t index) const; 67 | 68 | bool TryGetInputDesc(const string &name, TensorDesc &tensorDesc) const; 69 | 70 | GraphErrCodeStatus UpdateInputDesc(const string &name, const TensorDesc &tensorDesc); 71 | 72 | TensorDesc GetOutputDesc(const string &name) const; 73 | 74 | TensorDesc GetOutputDesc(uint32_t index) const; 75 | 76 | GraphErrCodeStatus UpdateOutputDesc(const string &name, const TensorDesc &tensorDesc); 77 | 78 | TensorDesc GetDynamicInputDesc(const string &name, const unsigned int index) const; 79 | 80 | GraphErrCodeStatus UpdateDynamicInputDesc(const string &name, const unsigned int index, 81 | const TensorDesc &tensorDesc); 82 | 83 | TensorDesc GetDynamicOutputDesc(const string &name, const unsigned int index) const; 84 | 85 | GraphErrCodeStatus UpdateDynamicOutputDesc(const string &name, const unsigned int index, 86 | const TensorDesc &tensorDesc); 87 | 88 | Operator &SetAttr(const string &name, AttrValue &&attrValue); 89 | 90 | GraphErrCodeStatus GetAttr(const string &name, AttrValue &attrValue) const; 91 | 92 | protected: 93 | explicit Operator(OperatorImplPtr &&opImpl); 94 | 95 | void InputRegister(const string &name); 96 | 97 | void OptionalInputRegister(const string &name); 98 | 99 | void OutputRegister(const string &name); 100 | 101 | void DynamicInputRegister(const string &name, const unsigned int num); 102 | 103 | void DynamicOutputRegister(const string &name, const unsigned int num); 104 | 105 | void AttrRegister(const string &name, AttrValue &&attrValue); 106 | 107 | void RequiredAttrRegister(const string &name); 108 | 109 | Operator &SetInput(const string &dstName, uint32_t dstIndex, 110 | const Operator &srcOprt); // only has one output index = 0 111 | Operator &SetInput(const string &dstName, uint32_t dstIndex, const Operator &srcOprt, 112 | const string &name); 113 | 114 | Operator &SetInput(const string &dstName, OutHandler outHandler); 115 | OutHandler GetOutput(const uint32_t srcIndex) const; 116 | 117 | private: 118 | OutHandler GetOutput(const string &name) const; 119 | 120 | OperatorImplPtr GetOperatorImplPtr() const; 121 | 122 | string GetOpType() const; 123 | 124 | std::vector GetOpIsInputConst() const; 125 | 126 | void SetOpIsInputConst(bool inputConst, uint32_t index); 127 | 128 | private: 129 | OperatorImplPtr operatorImpl_{ nullptr }; 130 | }; 131 | 132 | } // namespace ge 133 | 134 | #endif // GE_OPERATOR_H 135 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/tensor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: tensor 4 | */ 5 | 6 | #ifndef GE_TENSOR_H 7 | #define GE_TENSOR_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include "types.h" 13 | #include "debug/ge_error_codes.h" 14 | #include "./detail/attributes_holder.h" 15 | #include "buffer.h" 16 | 17 | namespace ge { 18 | class TensorDescImpl; 19 | 20 | using TensorDescImplPtr = std::shared_ptr; 21 | 22 | class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Shape { 23 | public: 24 | Shape(); 25 | 26 | ~Shape() = default; 27 | 28 | explicit Shape(std::vector s); 29 | 30 | size_t GetDimNum() const; 31 | 32 | // if the idx is invalid, return 0 33 | int64_t GetDim(size_t idx) const; 34 | 35 | GraphErrCodeStatus SetDim(size_t idx, int64_t value); 36 | 37 | std::vector GetDims() const; 38 | 39 | int64_t GetShapeSize() const; 40 | 41 | Shape(const Shape &other); 42 | 43 | Shape(Shape &&other); 44 | 45 | Shape &operator = (const Shape &other); 46 | 47 | Shape &operator = (Shape &&other); 48 | 49 | private: 50 | GeIrProtoHelper shapeDef_; 51 | 52 | friend class TensorDesc; 53 | 54 | // create from proto obj 55 | Shape(const ProtoMsgOwner &protoOnwer, proto::ShapeDef *protoMsg); 56 | 57 | void RefTo(const Shape &shape) 58 | { 59 | shapeDef_ = shape.shapeDef_; 60 | } 61 | }; 62 | 63 | class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY TensorDesc : public AttrHolder { 64 | friend class TensorUtils; 65 | 66 | friend class AttrValue; 67 | 68 | friend class ModelSerialize; 69 | 70 | public: 71 | TensorDesc(); 72 | 73 | explicit TensorDesc(Shape shape, Format format = FORMAT_NCHW, DataType dt = DT_FLOAT); 74 | 75 | TensorDesc(Shape shape, DataType dt); 76 | 77 | TensorDesc(const TensorDesc &desc); 78 | 79 | TensorDesc(TensorDesc &&desc); 80 | 81 | ~TensorDesc() = default; 82 | 83 | string GetName() const; 84 | 85 | void SetName(const string& name); 86 | 87 | void Update(Shape shape, Format format = FORMAT_NCHW, DataType dt = DT_FLOAT); 88 | 89 | Shape GetShape() const; 90 | 91 | Shape &MutableShape(); 92 | 93 | void SetShape(Shape shape); 94 | 95 | Format GetFormat() const; 96 | 97 | void SetFormat(Format format); 98 | 99 | DataType GetDataType() const; 100 | 101 | void SetDataType(DataType dt); 102 | 103 | TensorDesc Clone() const; 104 | 105 | TensorDesc &operator = (const TensorDesc &desc); 106 | 107 | TensorDesc &operator = (TensorDesc &&desc); 108 | 109 | GraphErrCodeStatus IsValid(); 110 | 111 | private: 112 | using AttrHolder::DelAttr; 113 | using AttrHolder::GetAllAttrs; 114 | using AttrHolder::GetAttr; 115 | using AttrHolder::HasAttr; 116 | using AttrHolder::SetAttr; 117 | 118 | private: 119 | void Init(); 120 | 121 | ProtoAttrMapHelper MutableAttrMap() override; 122 | 123 | ConstProtoAttrMapHelper GetAttrMap() const override; 124 | 125 | // create from proto obj 126 | TensorDesc(const ProtoMsgOwner &protoOnwer, proto::TensorDescriptor *protoMsg); 127 | 128 | friend class Tensor; 129 | 130 | friend class AttrValueImp; 131 | 132 | friend class ModelSerializeImp; 133 | 134 | GeIrProtoHelper tensorDescriptor_; 135 | mutable Shape __shape_; // reference from tensorDescriptor_, do not direct use 136 | 137 | void RefTo(const TensorDesc &tensorDesc) 138 | { 139 | tensorDescriptor_ = tensorDesc.tensorDescriptor_; 140 | } 141 | 142 | Shape &ShapeReference() const; 143 | }; 144 | 145 | class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Tensor { 146 | public: 147 | Tensor(); 148 | 149 | explicit Tensor(const TensorDesc &tensorDesc); 150 | 151 | explicit Tensor(const TensorDesc &tensorDesc, const std::vector &data); 152 | 153 | explicit Tensor(const TensorDesc &tensorDesc, const Buffer &data); 154 | 155 | explicit Tensor(const TensorDesc &tensorDesc, const uint8_t *data, size_t size); 156 | 157 | explicit Tensor(TensorDesc &&tensorDesc, std::vector &&data); 158 | 159 | ~Tensor() = default; 160 | 161 | TensorDesc GetTensorDesc() const; 162 | 163 | TensorDesc &MutableTensorDesc(); 164 | 165 | GraphErrCodeStatus SetTensorDesc(const TensorDesc &tensorDesc); 166 | 167 | const Buffer GetData() const; 168 | 169 | Buffer MutableData(); 170 | 171 | GraphErrCodeStatus SetData(std::vector &&data); 172 | 173 | GraphErrCodeStatus SetData(const std::vector &data); 174 | 175 | GraphErrCodeStatus SetData(const Buffer &data); 176 | 177 | GraphErrCodeStatus SetData(const uint8_t *data, size_t size); 178 | 179 | Tensor Clone() const; 180 | 181 | Tensor(const Tensor &other); // share value 182 | Tensor &operator = (const Tensor &other); // share value 183 | private: 184 | friend class AttrValueImp; 185 | 186 | // create from proto obj 187 | Tensor(const ProtoMsgOwner &protoOnwer, proto::TensorDef *protoMsg); 188 | 189 | GeIrProtoHelper tensorDef_; 190 | mutable TensorDesc __desc_; // reference from tensorDef_, do not direct use 191 | TensorDesc &DescReference() const; 192 | }; 193 | } // namespace ge 194 | 195 | #endif // GE_TENSOR_H 196 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/graph/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: types 4 | */ 5 | #ifndef GE_PUBLIC_TYPES_H 6 | #define GE_PUBLIC_TYPES_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | namespace ge { 13 | #ifdef HOST_VISIBILITY 14 | #define GE_FUNC_HOST_VISIBILITY __attribute__((visibility("default"))) 15 | #else 16 | #define GE_FUNC_HOST_VISIBILITY 17 | #endif 18 | #ifdef DEV_VISIBILITY 19 | #define GE_FUNC_DEV_VISIBILITY __attribute__((visibility("default"))) 20 | #else 21 | #define GE_FUNC_DEV_VISIBILITY 22 | #endif 23 | 24 | enum DataType { 25 | DT_UNDEFINED = 17, // Used to indicate a DataType field has not been set. 26 | DT_FLOAT = 0, // float type 27 | DT_FLOAT16 = 1, // fp16 type 28 | DT_INT8 = 2, // int8 type 29 | DT_INT16 = 6, // int16 type 30 | DT_UINT16 = 7, // uint16 type 31 | DT_UINT8 = 4, // uint8 type 32 | DT_INT32 = 3, 33 | DT_INT64 = 9, // int64 type 34 | DT_UINT32 = 8, // unsigned int32 35 | DT_UINT64 = 10, // unsigned int64 36 | DT_BOOL = 12, // bool type 37 | DT_DOUBLE = 11, // double type 38 | DT_DUAL = 13, /* dual output type */ 39 | DT_DUAL_SUB_INT8 = 14, /* dual output int8 type */ 40 | DT_DUAL_SUB_UINT8 = 15, /* dual output uint8 type */ 41 | DT_2BIT = 21, // 2BIT type 42 | DT_INT4 = 22, // int4 type 43 | DT_QUINT8 = 23, // quint8 for ann 44 | }; 45 | 46 | enum Format { 47 | FORMAT_NCHW = 0, /* NCHW */ 48 | FORMAT_NHWC, /* NHWC */ 49 | FORMAT_ND, /* Nd Tensor */ 50 | FORMAT_NC1HWC0, /* NC1HWC0 */ 51 | FORMAT_FRACTAL_Z, /* FRACTAL_Z */ 52 | FORMAT_NC1C0HWPAD, 53 | FORMAT_NHWC1C0, 54 | FORMAT_FSR_NCHW, 55 | FORMAT_FRACTAL_DECONV, 56 | FORMAT_C1HWNC0, 57 | FORMAT_FRACTAL_DECONV_TRANSPOSE, 58 | FORMAT_FRACTAL_DECONV_SP_STRIDE_TRANS, 59 | FORMAT_NC1HWC0_C04, /* NC1HWC0, C0 =4 */ 60 | FORMAT_FRACTAL_Z_C04, /* FRACZ格式,C0 =4 */ 61 | FORMAT_CHWN, 62 | FORMAT_FRACTAL_DECONV_SP_STRIDE8_TRANS, 63 | FORMAT_HWCN, 64 | FORMAT_NC1KHKWHWC0, /* KH,KW kernel h& kernel w maxpooling max output format */ 65 | FORMAT_BN_WEIGHT, 66 | FORMAT_FILTER_HWCK, /* filter input tensor format */ 67 | FORMAT_HASHTABLE_LOOKUP_LOOKUPS = 20, 68 | FORMAT_HASHTABLE_LOOKUP_KEYS, 69 | FORMAT_HASHTABLE_LOOKUP_VALUE, 70 | FORMAT_HASHTABLE_LOOKUP_OUTPUT, 71 | FORMAT_HASHTABLE_LOOKUP_HITS = 24, 72 | FORMAT_FRACTAL_Z_SPARSE, 73 | FORMAT_NC4HW4, /* For CPUCL Kernel */ 74 | FORMAT_NC8HW8, /* For CPUCL Kernel */ 75 | FORMAT_RESERVED 76 | }; 77 | 78 | enum DeviceType { 79 | NPU = 0, 80 | CPU = 1, 81 | DEVICE_TYPE_RESERVED, 82 | // DeviceType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, 83 | // DeviceType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max 84 | }; 85 | 86 | enum AnchorStatus { 87 | ANCHOR_SUSPEND = 0, // dat null 88 | ANCHOR_CONST = 1, 89 | ANCHOR_DATA = 2, // 有效的 90 | ANCHOR_RESERVED = 3 91 | }; 92 | 93 | struct TensorType { 94 | explicit TensorType(DataType dt) 95 | { 96 | dtVec.push_back(dt); 97 | }; 98 | 99 | TensorType(std::initializer_list types) 100 | { 101 | dtVec = types; 102 | }; 103 | 104 | static TensorType ALL() 105 | { 106 | return TensorType{DT_FLOAT, DT_FLOAT16, DT_INT8, DT_INT16, DT_UINT16, DT_UINT8, 107 | DT_INT32, DT_INT64, DT_UINT32, DT_UINT64, DT_BOOL, DT_DOUBLE, 108 | DT_DUAL, DT_DUAL_SUB_INT8, DT_DUAL_SUB_UINT8, DT_2BIT, DT_INT4}; 109 | } 110 | 111 | static TensorType FLOAT() 112 | { 113 | return TensorType{ DT_FLOAT, DT_FLOAT16 }; 114 | } 115 | 116 | std::vector dtVec; 117 | }; 118 | } // namespace ge 119 | 120 | #endif // GE_PUBLIC_TYPES_H 121 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/hiai_ir_build.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. 3 | * Description: omg hiai ir build 4 | * 5 | */ 6 | 7 | #ifndef DOMI_OMG_HIAI_IR_BUILD_H_ 8 | #define DOMI_OMG_HIAI_IR_BUILD_H_ 9 | #include "graph/model.h" 10 | 11 | namespace domi { 12 | struct ModelBufferData { 13 | void* data = nullptr; 14 | uint32_t length = 0; 15 | }; 16 | 17 | enum WeightDataType { 18 | FP32, 19 | FP16 20 | }; 21 | 22 | enum OpExecuteDevice { 23 | NPU_DEV = 0, 24 | CPU_DEV = 1, 25 | }; 26 | 27 | enum ExecuteDeviceSelectMode { 28 | AUTO, 29 | CUSTOM, 30 | }; 31 | 32 | struct BuildOptions { 33 | bool useOriginFormat = false; 34 | WeightDataType weightDataType = FP32; 35 | ExecuteDeviceSelectMode mode = AUTO; 36 | map> opExecuteDeviceConfig; 37 | }; 38 | 39 | const static BuildOptions defaultBuildOptions; 40 | 41 | class HiaiIrBuild { 42 | public: 43 | /** 44 | * @ingroup domi_omg 45 | * @brief 创建模型Buffer, 默认分配200M 46 | * @param [in] irModel 输入模型数据 47 | * @param [out] output 输出离线模型Buffer 48 | * @return bool 执行结果 49 | */ 50 | bool CreateModelBuff(ge::Model& irModel, ModelBufferData& output); 51 | 52 | /** 53 | * @ingroup domi_omg 54 | * @brief 创建模型Buffer 55 | * @param [in] irModel 输入模型数据 56 | * @param [out] output 输出离线模型Buffer 57 | * @param [in] customSize 输入用户指定Buffer大小,单位字节,必须为非负整数,建议范围200M以内,当customSize设置为0时,接口内部根据irModel自动计算合适的Buffer大小 58 | * @return bool 执行结果 59 | */ 60 | bool CreateModelBuff(ge::Model& irModel, ModelBufferData& output, uint32_t customSize); 61 | 62 | /* 63 | * @ingroup domi_omg 64 | * @brief 在线编译 65 | * @param [in] irModel 输入模型数据 66 | * @param [out] output 输出离线模型 67 | * @return bool 执行结果 68 | */ 69 | bool BuildIRModel(ge::Model& irModel, ModelBufferData& output, const BuildOptions& options); 70 | 71 | /* 72 | * @ingroup domi_omg 73 | * @brief 在线编译 74 | * @param [in] irModel 输入模型数据 75 | * @param [out] output 输出离线模型 76 | * @return bool 执行结果 77 | */ 78 | bool BuildIRModel(ge::Model& irModel, ModelBufferData& output); 79 | 80 | void ReleaseModelBuff(ModelBufferData& output); 81 | private: 82 | /* 83 | * @ingroup domi_omg 84 | * @brief 获取Rom版本号 85 | * @return string IR在线编译返回Rom版本号,离线编译返回空字符串 86 | */ 87 | std::string GetHiaiVersion(); 88 | /* 89 | * @ingroup domi_omg 90 | * @brief 在线编译生成模型 91 | * @return bool 成功返回true,失败返回false 92 | */ 93 | bool BuildModelOnline(const std::string& hiaiRomVersion, 94 | ge::ComputeGraphPtr graph, ge::Model& irModel, ModelBufferData& output, const BuildOptions& options); 95 | /* 96 | * @ingroup domi_omg 97 | * @brief 检查Rom版本是否支持IR量化模型 98 | * @return bool 成功返回true,失败返回false 99 | */ 100 | bool IsSupportQuantize(const std::string& hiaiRomVersion); 101 | /* 102 | * @ingroup domi_omg 103 | * @brief 离线编译生成模型 104 | * @return bool 成功返回true,失败返回false 105 | */ 106 | bool BuildModelOffline(const std::string& hiaiRomVersion, 107 | ge::ComputeGraphPtr graph, ge::Model& irModel, ModelBufferData& output, const BuildOptions& options); 108 | }; 109 | } // namespace domi 110 | #endif // _H_HIAI_IR_BUILD_H_ 111 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/hiai_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. 3 | * Description: Basic Type Define 4 | */ 5 | #ifndef _HIAI_TYPE_H_ 6 | #define _HIAI_TYPE_H_ 7 | #include 8 | #include 9 | #include 10 | 11 | #ifndef HIAI_API_EXPORT 12 | #if (defined HOST_VISIBILITY) || (defined DEV_VISIBILITY) 13 | #ifdef _MSC_VER 14 | #define HIAI_API_EXPORT __declspec(dllexport) 15 | #else 16 | #define HIAI_API_EXPORT __attribute__((__visibility__("default"))) 17 | #endif 18 | #else 19 | #define HIAI_API_EXPORT 20 | #endif 21 | #endif 22 | 23 | namespace hiai { 24 | class Context { 25 | public: 26 | std::string GetValue(const std::string& key) const; 27 | void SetValue(const std::string& key, const std::string& value); 28 | void RemoveValue(const std::string& key); 29 | const std::map& GetContent() const; 30 | 31 | private: 32 | std::map paras_; 33 | }; 34 | 35 | inline std::string Context::GetValue(const std::string& key) const 36 | { 37 | auto it = paras_.find(key); 38 | return it != paras_.end() ? it->second : ""; 39 | } 40 | 41 | inline void Context::SetValue(const std::string& key, const std::string& value) 42 | { 43 | paras_[key] = value; 44 | } 45 | 46 | inline void Context::RemoveValue(const std::string& key) 47 | { 48 | paras_.erase(key); 49 | } 50 | 51 | inline const std::map& Context::GetContent() const 52 | { 53 | return paras_; 54 | } 55 | 56 | struct NativeHandle { 57 | int fd; 58 | int size; 59 | int offset; 60 | }; 61 | 62 | }; // namespace hiai 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.320.030.010/include/native_handle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef NATIVE_HANDLE_H_ 18 | #define NATIVE_HANDLE_H_ 19 | 20 | #include 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #define NATIVE_HANDLE_MAX_FDS 1024 27 | #define NATIVE_HANDLE_MAX_INTS 1024 28 | 29 | /* Declare a char array for use with native_handle_init */ 30 | #define NATIVE_HANDLE_DECLARE_STORAGE(name, maxFds, maxInts) \ 31 | alignas(native_handle_t) char (name)[ \ 32 | sizeof(native_handle_t) + sizeof(int) * ((maxFds) + (maxInts))] 33 | 34 | typedef struct native_handle 35 | { 36 | int version; /* sizeof(native_handle_t) */ 37 | int numFds; /* number of file-descriptors at &data[0] */ 38 | int numInts; /* number of ints at &data[numFds] */ 39 | #if defined(__clang__) 40 | #pragma clang diagnostic push 41 | #pragma clang diagnostic ignored "-Wzero-length-array" 42 | #endif 43 | int data[0]; /* numFds + numInts ints */ 44 | #if defined(__clang__) 45 | #pragma clang diagnostic pop 46 | #endif 47 | } native_handle_t; 48 | 49 | typedef const native_handle_t* buffer_handle_t; 50 | 51 | /* 52 | * native_handle_close 53 | * 54 | * closes the file descriptors contained in this native_handle_t 55 | * 56 | * return 0 on success, or a negative error code on failure 57 | * 58 | */ 59 | int native_handle_close(const native_handle_t* h); 60 | 61 | /* 62 | * native_handle_init 63 | * 64 | * Initializes a native_handle_t from storage. storage must be declared with 65 | * NATIVE_HANDLE_DECLARE_STORAGE. numFds and numInts must not respectively 66 | * exceed maxFds and maxInts used to declare the storage. 67 | */ 68 | native_handle_t* native_handle_init(char* storage, int numFds, int numInts); 69 | 70 | /* 71 | * native_handle_create 72 | * 73 | * creates a native_handle_t and initializes it. must be destroyed with 74 | * native_handle_delete(). Note that numFds must be <= NATIVE_HANDLE_MAX_FDS, 75 | * numInts must be <= NATIVE_HANDLE_MAX_INTS, and both must be >= 0. 76 | * 77 | */ 78 | native_handle_t* native_handle_create(int numFds, int numInts); 79 | 80 | /* 81 | * native_handle_clone 82 | * 83 | * creates a native_handle_t and initializes it from another native_handle_t. 84 | * Must be destroyed with native_handle_delete(). 85 | * 86 | */ 87 | native_handle_t* native_handle_clone(const native_handle_t* handle); 88 | 89 | /* 90 | * native_handle_delete 91 | * 92 | * frees a native_handle_t allocated with native_handle_create(). 93 | * This ONLY frees the memory allocated for the native_handle_t, but doesn't 94 | * close the file descriptors; which can be achieved with native_handle_close(). 95 | * 96 | * return 0 on success, or a negative error code on failure 97 | * 98 | */ 99 | int native_handle_delete(native_handle_t* h); 100 | 101 | 102 | #ifdef __cplusplus 103 | } 104 | #endif 105 | 106 | #endif /* NATIVE_HANDLE_H_ */ 107 | -------------------------------------------------------------------------------- /ddk/hwhiai-ddk-100.500.010.011.tar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/ddk/hwhiai-ddk-100.500.010.011.tar -------------------------------------------------------------------------------- /doc/cn/development/resource/android_profiling.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/development/resource/android_profiling.jpg -------------------------------------------------------------------------------- /doc/cn/development/resource/ios_add_account_benchmark.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/development/resource/ios_add_account_benchmark.jpg -------------------------------------------------------------------------------- /doc/cn/development/resource/ios_benchmark_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/development/resource/ios_benchmark_result.jpg -------------------------------------------------------------------------------- /doc/cn/development/resource/ios_set_account.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/development/resource/ios_set_account.jpg -------------------------------------------------------------------------------- /doc/cn/development/resource/ios_set_bundleid_benchmark.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/development/resource/ios_set_bundleid_benchmark.jpg -------------------------------------------------------------------------------- /doc/cn/development/resource/ios_verify_certificate_benchmark.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/development/resource/ios_verify_certificate_benchmark.jpg -------------------------------------------------------------------------------- /doc/cn/development/resource/opencl_profiling.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/development/resource/opencl_profiling.jpg -------------------------------------------------------------------------------- /doc/cn/imgs/835.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/imgs/835.jpg -------------------------------------------------------------------------------- /doc/cn/imgs/970.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/imgs/970.jpg -------------------------------------------------------------------------------- /doc/cn/imgs/blob_memory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/imgs/blob_memory.png -------------------------------------------------------------------------------- /doc/cn/imgs/device.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/imgs/device.png -------------------------------------------------------------------------------- /doc/cn/imgs/device_factory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/imgs/device_factory.png -------------------------------------------------------------------------------- /doc/cn/imgs/group.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/imgs/group.jpg -------------------------------------------------------------------------------- /doc/cn/imgs/group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/imgs/group.png -------------------------------------------------------------------------------- /doc/cn/imgs/model_reinterpreter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/imgs/model_reinterpreter.png -------------------------------------------------------------------------------- /doc/cn/imgs/roadmap.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/imgs/roadmap.jpg -------------------------------------------------------------------------------- /doc/cn/imgs/tnn_architect.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/imgs/tnn_architect.jpg -------------------------------------------------------------------------------- /doc/cn/user/resource/android_face_detecor_image_npu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/user/resource/android_face_detecor_image_npu.jpg -------------------------------------------------------------------------------- /doc/cn/user/resource/android_face_detector_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/user/resource/android_face_detector_image.jpg -------------------------------------------------------------------------------- /doc/cn/user/resource/android_face_detector_stream.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/user/resource/android_face_detector_stream.jpg -------------------------------------------------------------------------------- /doc/cn/user/resource/android_face_detector_stream_npu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/user/resource/android_face_detector_stream_npu.jpg -------------------------------------------------------------------------------- /doc/cn/user/resource/android_image_classify.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/user/resource/android_image_classify.jpg -------------------------------------------------------------------------------- /doc/cn/user/resource/android_image_classify_npu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/user/resource/android_image_classify_npu.jpg -------------------------------------------------------------------------------- /doc/cn/user/resource/convert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/user/resource/convert.png -------------------------------------------------------------------------------- /doc/cn/user/resource/face_detector.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/user/resource/face_detector.jpg -------------------------------------------------------------------------------- /doc/cn/user/resource/image_classify.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/user/resource/image_classify.jpg -------------------------------------------------------------------------------- /doc/cn/user/resource/ios_add_account_demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/user/resource/ios_add_account_demo.jpg -------------------------------------------------------------------------------- /doc/cn/user/resource/ios_set_account.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/user/resource/ios_set_account.jpg -------------------------------------------------------------------------------- /doc/cn/user/resource/ios_set_bundleid_demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/user/resource/ios_set_bundleid_demo.jpg -------------------------------------------------------------------------------- /doc/cn/user/resource/ios_verify_certificate_demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/user/resource/ios_verify_certificate_demo.jpg -------------------------------------------------------------------------------- /doc/cn/user/resource/tnn-netron.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/cn/user/resource/tnn-netron.jpg -------------------------------------------------------------------------------- /doc/demo/bert_squad.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/demo/bert_squad.gif -------------------------------------------------------------------------------- /doc/demo/chinese-ocr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/demo/chinese-ocr.gif -------------------------------------------------------------------------------- /doc/demo/face_alignment.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/demo/face_alignment.gif -------------------------------------------------------------------------------- /doc/demo/face_detection.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/demo/face_detection.gif -------------------------------------------------------------------------------- /doc/demo/hair_seg_red.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/demo/hair_seg_red.gif -------------------------------------------------------------------------------- /doc/demo/object-detection.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/demo/object-detection.gif -------------------------------------------------------------------------------- /doc/demo/skeleton_blazepose.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/demo/skeleton_blazepose.gif -------------------------------------------------------------------------------- /doc/demo/skeleton_guangliu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/demo/skeleton_guangliu.gif -------------------------------------------------------------------------------- /doc/en/development/resource/android_profiling.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/en/development/resource/android_profiling.jpg -------------------------------------------------------------------------------- /doc/en/development/resource/ios_add_account_benchmark.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/en/development/resource/ios_add_account_benchmark.jpg -------------------------------------------------------------------------------- /doc/en/development/resource/ios_benchmark_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/en/development/resource/ios_benchmark_result.jpg -------------------------------------------------------------------------------- /doc/en/development/resource/ios_set_account.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/en/development/resource/ios_set_account.jpg -------------------------------------------------------------------------------- /doc/en/development/resource/ios_set_bundleid_benchmark.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/en/development/resource/ios_set_bundleid_benchmark.jpg -------------------------------------------------------------------------------- /doc/en/development/resource/ios_verify_certificate_benchmark.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/en/development/resource/ios_verify_certificate_benchmark.jpg -------------------------------------------------------------------------------- /doc/en/development/resource/opencl_profiling.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/en/development/resource/opencl_profiling.jpg -------------------------------------------------------------------------------- /doc/en/imgs/tnn_architect.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/doc/en/imgs/tnn_architect.jpg -------------------------------------------------------------------------------- /face-detector/version-slim-320_simplified.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/face-detector/version-slim-320_simplified.bin -------------------------------------------------------------------------------- /face-detector/version-slim-320_simplified.onnx: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5b38ea4cbf1fc97bad3523197ddb65bcc4d19bf27f4043edc322ac296323bbe4 3 | size 1047682 4 | -------------------------------------------------------------------------------- /face-detector/version-slim-320_simplified.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 100 107 3 | Input input 0 1 input 0=240 1=320 2=3 4 | Convolution 185 1 1 input 185 0=16 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=432 5 | ReLU 187 1 1 185 187 6 | ConvolutionDepthWise 188 1 1 187 188 0=16 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=144 7=16 7 | ReLU 190 1 1 188 190 8 | Convolution 191 1 1 190 191 0=32 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=512 9 | ReLU 193 1 1 191 193 10 | ConvolutionDepthWise 194 1 1 193 194 0=32 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=288 7=32 11 | ReLU 196 1 1 194 196 12 | Convolution 197 1 1 196 197 0=32 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=1024 13 | ReLU 199 1 1 197 199 14 | ConvolutionDepthWise 200 1 1 199 200 0=32 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=288 7=32 15 | ReLU 202 1 1 200 202 16 | Convolution 203 1 1 202 203 0=32 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=1024 17 | ReLU 205 1 1 203 205 18 | ConvolutionDepthWise 206 1 1 205 206 0=32 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=288 7=32 19 | ReLU 208 1 1 206 208 20 | Convolution 209 1 1 208 209 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=2048 21 | ReLU 211 1 1 209 211 22 | ConvolutionDepthWise 212 1 1 211 212 0=64 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=576 7=64 23 | ReLU 214 1 1 212 214 24 | Convolution 215 1 1 214 215 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=4096 25 | ReLU 217 1 1 215 217 26 | ConvolutionDepthWise 218 1 1 217 218 0=64 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=576 7=64 27 | ReLU 220 1 1 218 220 28 | Convolution 221 1 1 220 221 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=4096 29 | ReLU 223 1 1 221 223 30 | ConvolutionDepthWise 224 1 1 223 224 0=64 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=576 7=64 31 | ReLU 226 1 1 224 226 32 | Convolution 227 1 1 226 227 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=4096 33 | ReLU 229 1 1 227 229 34 | Split splitncnn_0 1 3 229 229_splitncnn_0 229_splitncnn_1 229_splitncnn_2 35 | ConvolutionDepthWise 230 1 1 229_splitncnn_2 230 0=64 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=576 7=64 36 | ReLU 231 1 1 230 231 37 | Convolution 232 1 1 231 232 0=6 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=384 38 | Permute 233 1 1 232 233 0=3 39 | Reshape 243 1 1 233 243 0=2 1=-1 40 | ConvolutionDepthWise 244 1 1 229_splitncnn_1 244 0=64 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=576 7=64 41 | ReLU 245 1 1 244 245 42 | Convolution 246 1 1 245 246 0=12 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=768 43 | Permute 247 1 1 246 247 0=3 44 | Reshape 257 1 1 247 257 0=4 1=-1 45 | ConvolutionDepthWise 258 1 1 229_splitncnn_0 258 0=64 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=576 7=64 46 | ReLU 260 1 1 258 260 47 | Convolution 261 1 1 260 261 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=8192 48 | ReLU 263 1 1 261 263 49 | ConvolutionDepthWise 264 1 1 263 264 0=128 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=1152 7=128 50 | ReLU 266 1 1 264 266 51 | Convolution 267 1 1 266 267 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=16384 52 | ReLU 269 1 1 267 269 53 | ConvolutionDepthWise 270 1 1 269 270 0=128 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=1152 7=128 54 | ReLU 272 1 1 270 272 55 | Convolution 273 1 1 272 273 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=16384 56 | ReLU 275 1 1 273 275 57 | Split splitncnn_1 1 3 275 275_splitncnn_0 275_splitncnn_1 275_splitncnn_2 58 | ConvolutionDepthWise 276 1 1 275_splitncnn_2 276 0=128 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=1152 7=128 59 | ReLU 277 1 1 276 277 60 | Convolution 278 1 1 277 278 0=4 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=512 61 | Permute 279 1 1 278 279 0=3 62 | Reshape 289 1 1 279 289 0=2 1=-1 63 | ConvolutionDepthWise 290 1 1 275_splitncnn_1 290 0=128 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=1152 7=128 64 | ReLU 291 1 1 290 291 65 | Convolution 292 1 1 291 292 0=8 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=1024 66 | Permute 293 1 1 292 293 0=3 67 | Reshape 303 1 1 293 303 0=4 1=-1 68 | ConvolutionDepthWise 304 1 1 275_splitncnn_0 304 0=128 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=1152 7=128 69 | ReLU 306 1 1 304 306 70 | Convolution 307 1 1 306 307 0=256 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=32768 71 | ReLU 309 1 1 307 309 72 | ConvolutionDepthWise 310 1 1 309 310 0=256 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=2304 7=256 73 | ReLU 312 1 1 310 312 74 | Convolution 313 1 1 312 313 0=256 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=65536 75 | ReLU 315 1 1 313 315 76 | Split splitncnn_2 1 3 315 315_splitncnn_0 315_splitncnn_1 315_splitncnn_2 77 | ConvolutionDepthWise 316 1 1 315_splitncnn_2 316 0=256 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=2304 7=256 78 | ReLU 317 1 1 316 317 79 | Convolution 318 1 1 317 318 0=4 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=1024 80 | Permute 319 1 1 318 319 0=3 81 | Reshape 329 1 1 319 329 0=2 1=-1 82 | ConvolutionDepthWise 330 1 1 315_splitncnn_1 330 0=256 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=2304 7=256 83 | ReLU 331 1 1 330 331 84 | Convolution 332 1 1 331 332 0=8 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=2048 85 | Permute 333 1 1 332 333 0=3 86 | Reshape 343 1 1 333 343 0=4 1=-1 87 | Convolution 344 1 1 315_splitncnn_0 344 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=16384 88 | ReLU 345 1 1 344 345 89 | ConvolutionDepthWise 346 1 1 345 346 0=64 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=576 7=64 90 | ReLU 347 1 1 346 347 91 | Convolution 348 1 1 347 348 0=256 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=16384 92 | ReLU 349 1 1 348 349 93 | Split splitncnn_3 1 2 349 349_splitncnn_0 349_splitncnn_1 94 | Convolution 350 1 1 349_splitncnn_1 350 0=6 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=13824 95 | Permute 351 1 1 350 351 0=3 96 | Reshape 361 1 1 351 361 0=2 1=-1 97 | Convolution 362 1 1 349_splitncnn_0 362 0=12 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=27648 98 | Permute 363 1 1 362 363 0=3 99 | Reshape 373 1 1 363 373 0=4 1=-1 100 | Concat 374 4 1 243 289 329 361 374 0=0 101 | Concat boxes 4 1 257 303 343 373 boxes 0=0 102 | Softmax scores 1 1 374 scores 0=1 1=1 103 | -------------------------------------------------------------------------------- /face-detector/version-slim-320_simplified.rapidmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:16dcc886ac4a7573475d1a39450420ff4cdbedc13f5ed7a11417cebe2a1dc82b 3 | size 1034234 4 | -------------------------------------------------------------------------------- /face-detector/version-slim-320_simplified.rapidproto: -------------------------------------------------------------------------------- 1 | "1 96 1 4206624770 ," 2 | "input 1 3 240 320 ," 3 | " 185 187 188 190 191 193 194 196 197 199 200 202 203 205 206 208 209 211 212 214 215 217 218 220 221 223 224 226 227 229 230 231 232 233 243 244 245 246 247 257 258 260 261 263 264 266 267 269 270 272 273 275 276 277 278 279 289 290 291 292 293 303 304 306 307 309 310 312 313 315 316 317 318 319 329 330 331 332 333 343 344 345 346 347 348 349 350 351 361 362 363 373 374 boxes input scores ," 4 | "scores boxes ," 5 | " 95 ," 6 | "Convolution 185 1 1 input 185 1 3 16 3 3 2 2 1 1 1 -1 1 1 ," 7 | "ReLU 187 1 1 185 187 ," 8 | "Convolution 188 1 1 187 188 16 1 16 3 3 1 1 1 1 1 -1 1 1 ," 9 | "ReLU 190 1 1 188 190 ," 10 | "Convolution 191 1 1 190 191 1 16 32 1 1 1 1 0 0 1 -1 1 1 ," 11 | "ReLU 193 1 1 191 193 ," 12 | "Convolution 194 1 1 193 194 32 1 32 3 3 2 2 1 1 1 -1 1 1 ," 13 | "ReLU 196 1 1 194 196 ," 14 | "Convolution 197 1 1 196 197 1 32 32 1 1 1 1 0 0 1 -1 1 1 ," 15 | "ReLU 199 1 1 197 199 ," 16 | "Convolution 200 1 1 199 200 32 1 32 3 3 1 1 1 1 1 -1 1 1 ," 17 | "ReLU 202 1 1 200 202 ," 18 | "Convolution 203 1 1 202 203 1 32 32 1 1 1 1 0 0 1 -1 1 1 ," 19 | "ReLU 205 1 1 203 205 ," 20 | "Convolution 206 1 1 205 206 32 1 32 3 3 2 2 1 1 1 -1 1 1 ," 21 | "ReLU 208 1 1 206 208 ," 22 | "Convolution 209 1 1 208 209 1 32 64 1 1 1 1 0 0 1 -1 1 1 ," 23 | "ReLU 211 1 1 209 211 ," 24 | "Convolution 212 1 1 211 212 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 25 | "ReLU 214 1 1 212 214 ," 26 | "Convolution 215 1 1 214 215 1 64 64 1 1 1 1 0 0 1 -1 1 1 ," 27 | "ReLU 217 1 1 215 217 ," 28 | "Convolution 218 1 1 217 218 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 29 | "ReLU 220 1 1 218 220 ," 30 | "Convolution 221 1 1 220 221 1 64 64 1 1 1 1 0 0 1 -1 1 1 ," 31 | "ReLU 223 1 1 221 223 ," 32 | "Convolution 224 1 1 223 224 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 33 | "ReLU 226 1 1 224 226 ," 34 | "Convolution 227 1 1 226 227 1 64 64 1 1 1 1 0 0 1 -1 1 1 ," 35 | "ReLU 229 1 1 227 229 ," 36 | "Convolution 230 1 1 229 230 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 37 | "ReLU 231 1 1 230 231 ," 38 | "Convolution 232 1 1 231 232 1 64 6 1 1 1 1 0 0 1 -1 1 1 ," 39 | "Permute 233 1 1 232 233 4 0 2 3 1 ," 40 | "Reshape 243 1 1 233 243 0 4 4 0 -1 2 1 ," 41 | "Convolution 244 1 1 229 244 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 42 | "ReLU 245 1 1 244 245 ," 43 | "Convolution 246 1 1 245 246 1 64 12 1 1 1 1 0 0 1 -1 1 1 ," 44 | "Permute 247 1 1 246 247 4 0 2 3 1 ," 45 | "Reshape 257 1 1 247 257 0 4 4 0 -1 4 1 ," 46 | "Convolution 258 1 1 229 258 64 1 64 3 3 2 2 1 1 1 -1 1 1 ," 47 | "ReLU 260 1 1 258 260 ," 48 | "Convolution 261 1 1 260 261 1 64 128 1 1 1 1 0 0 1 -1 1 1 ," 49 | "ReLU 263 1 1 261 263 ," 50 | "Convolution 264 1 1 263 264 128 1 128 3 3 1 1 1 1 1 -1 1 1 ," 51 | "ReLU 266 1 1 264 266 ," 52 | "Convolution 267 1 1 266 267 1 128 128 1 1 1 1 0 0 1 -1 1 1 ," 53 | "ReLU 269 1 1 267 269 ," 54 | "Convolution 270 1 1 269 270 128 1 128 3 3 1 1 1 1 1 -1 1 1 ," 55 | "ReLU 272 1 1 270 272 ," 56 | "Convolution 273 1 1 272 273 1 128 128 1 1 1 1 0 0 1 -1 1 1 ," 57 | "ReLU 275 1 1 273 275 ," 58 | "Convolution 276 1 1 275 276 128 1 128 3 3 1 1 1 1 1 -1 1 1 ," 59 | "ReLU 277 1 1 276 277 ," 60 | "Convolution 278 1 1 277 278 1 128 4 1 1 1 1 0 0 1 -1 1 1 ," 61 | "Permute 279 1 1 278 279 4 0 2 3 1 ," 62 | "Reshape 289 1 1 279 289 0 4 4 0 -1 2 1 ," 63 | "Convolution 290 1 1 275 290 128 1 128 3 3 1 1 1 1 1 -1 1 1 ," 64 | "ReLU 291 1 1 290 291 ," 65 | "Convolution 292 1 1 291 292 1 128 8 1 1 1 1 0 0 1 -1 1 1 ," 66 | "Permute 293 1 1 292 293 4 0 2 3 1 ," 67 | "Reshape 303 1 1 293 303 0 4 4 0 -1 4 1 ," 68 | "Convolution 304 1 1 275 304 128 1 128 3 3 2 2 1 1 1 -1 1 1 ," 69 | "ReLU 306 1 1 304 306 ," 70 | "Convolution 307 1 1 306 307 1 128 256 1 1 1 1 0 0 1 -1 1 1 ," 71 | "ReLU 309 1 1 307 309 ," 72 | "Convolution 310 1 1 309 310 256 1 256 3 3 1 1 1 1 1 -1 1 1 ," 73 | "ReLU 312 1 1 310 312 ," 74 | "Convolution 313 1 1 312 313 1 256 256 1 1 1 1 0 0 1 -1 1 1 ," 75 | "ReLU 315 1 1 313 315 ," 76 | "Convolution 316 1 1 315 316 256 1 256 3 3 1 1 1 1 1 -1 1 1 ," 77 | "ReLU 317 1 1 316 317 ," 78 | "Convolution 318 1 1 317 318 1 256 4 1 1 1 1 0 0 1 -1 1 1 ," 79 | "Permute 319 1 1 318 319 4 0 2 3 1 ," 80 | "Reshape 329 1 1 319 329 0 4 4 0 -1 2 1 ," 81 | "Convolution 330 1 1 315 330 256 1 256 3 3 1 1 1 1 1 -1 1 1 ," 82 | "ReLU 331 1 1 330 331 ," 83 | "Convolution 332 1 1 331 332 1 256 8 1 1 1 1 0 0 1 -1 1 1 ," 84 | "Permute 333 1 1 332 333 4 0 2 3 1 ," 85 | "Reshape 343 1 1 333 343 0 4 4 0 -1 4 1 ," 86 | "Convolution 344 1 1 315 344 1 256 64 1 1 1 1 0 0 1 -1 1 1 ," 87 | "ReLU 345 1 1 344 345 ," 88 | "Convolution 346 1 1 345 346 64 1 64 3 3 2 2 1 1 1 -1 1 1 ," 89 | "ReLU 347 1 1 346 347 ," 90 | "Convolution 348 1 1 347 348 1 64 256 1 1 1 1 0 0 1 -1 1 1 ," 91 | "ReLU 349 1 1 348 349 ," 92 | "Convolution 350 1 1 349 350 1 256 6 3 3 1 1 1 1 1 -1 1 1 ," 93 | "Permute 351 1 1 350 351 4 0 2 3 1 ," 94 | "Reshape 361 1 1 351 361 0 4 4 0 -1 2 1 ," 95 | "Convolution 362 1 1 349 362 1 256 12 3 3 1 1 1 1 1 -1 1 1 ," 96 | "Permute 363 1 1 362 363 4 0 2 3 1 ," 97 | "Reshape 373 1 1 363 373 0 4 4 0 -1 4 1 ," 98 | "Concat 374 4 1 243 289 329 361 374 1 ," 99 | "Concat boxes 4 1 257 303 343 373 boxes 1 ," 100 | "SoftmaxCaffe scores 1 1 374 scores 2 ," 101 | -------------------------------------------------------------------------------- /face-detector/version-slim-320_simplified.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:16dcc886ac4a7573475d1a39450420ff4cdbedc13f5ed7a11417cebe2a1dc82b 3 | size 1034234 4 | -------------------------------------------------------------------------------- /face-detector/version-slim-320_simplified.tnnproto: -------------------------------------------------------------------------------- 1 | "1 96 1 4206624770 ," 2 | "input 1 3 240 320 ," 3 | " 185 187 188 190 191 193 194 196 197 199 200 202 203 205 206 208 209 211 212 214 215 217 218 220 221 223 224 226 227 229 230 231 232 233 243 244 245 246 247 257 258 260 261 263 264 266 267 269 270 272 273 275 276 277 278 279 289 290 291 292 293 303 304 306 307 309 310 312 313 315 316 317 318 319 329 330 331 332 333 343 344 345 346 347 348 349 350 351 361 362 363 373 374 boxes input scores ," 4 | "scores boxes ," 5 | " 95 ," 6 | "Convolution 185 1 1 input 185 1 3 16 3 3 2 2 1 1 1 -1 1 1 ," 7 | "ReLU 187 1 1 185 187 ," 8 | "Convolution 188 1 1 187 188 16 1 16 3 3 1 1 1 1 1 -1 1 1 ," 9 | "ReLU 190 1 1 188 190 ," 10 | "Convolution 191 1 1 190 191 1 16 32 1 1 1 1 0 0 1 -1 1 1 ," 11 | "ReLU 193 1 1 191 193 ," 12 | "Convolution 194 1 1 193 194 32 1 32 3 3 2 2 1 1 1 -1 1 1 ," 13 | "ReLU 196 1 1 194 196 ," 14 | "Convolution 197 1 1 196 197 1 32 32 1 1 1 1 0 0 1 -1 1 1 ," 15 | "ReLU 199 1 1 197 199 ," 16 | "Convolution 200 1 1 199 200 32 1 32 3 3 1 1 1 1 1 -1 1 1 ," 17 | "ReLU 202 1 1 200 202 ," 18 | "Convolution 203 1 1 202 203 1 32 32 1 1 1 1 0 0 1 -1 1 1 ," 19 | "ReLU 205 1 1 203 205 ," 20 | "Convolution 206 1 1 205 206 32 1 32 3 3 2 2 1 1 1 -1 1 1 ," 21 | "ReLU 208 1 1 206 208 ," 22 | "Convolution 209 1 1 208 209 1 32 64 1 1 1 1 0 0 1 -1 1 1 ," 23 | "ReLU 211 1 1 209 211 ," 24 | "Convolution 212 1 1 211 212 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 25 | "ReLU 214 1 1 212 214 ," 26 | "Convolution 215 1 1 214 215 1 64 64 1 1 1 1 0 0 1 -1 1 1 ," 27 | "ReLU 217 1 1 215 217 ," 28 | "Convolution 218 1 1 217 218 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 29 | "ReLU 220 1 1 218 220 ," 30 | "Convolution 221 1 1 220 221 1 64 64 1 1 1 1 0 0 1 -1 1 1 ," 31 | "ReLU 223 1 1 221 223 ," 32 | "Convolution 224 1 1 223 224 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 33 | "ReLU 226 1 1 224 226 ," 34 | "Convolution 227 1 1 226 227 1 64 64 1 1 1 1 0 0 1 -1 1 1 ," 35 | "ReLU 229 1 1 227 229 ," 36 | "Convolution 230 1 1 229 230 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 37 | "ReLU 231 1 1 230 231 ," 38 | "Convolution 232 1 1 231 232 1 64 6 1 1 1 1 0 0 1 -1 1 1 ," 39 | "Permute 233 1 1 232 233 4 0 2 3 1 ," 40 | "Reshape 243 1 1 233 243 0 4 4 0 -1 2 1 ," 41 | "Convolution 244 1 1 229 244 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 42 | "ReLU 245 1 1 244 245 ," 43 | "Convolution 246 1 1 245 246 1 64 12 1 1 1 1 0 0 1 -1 1 1 ," 44 | "Permute 247 1 1 246 247 4 0 2 3 1 ," 45 | "Reshape 257 1 1 247 257 0 4 4 0 -1 4 1 ," 46 | "Convolution 258 1 1 229 258 64 1 64 3 3 2 2 1 1 1 -1 1 1 ," 47 | "ReLU 260 1 1 258 260 ," 48 | "Convolution 261 1 1 260 261 1 64 128 1 1 1 1 0 0 1 -1 1 1 ," 49 | "ReLU 263 1 1 261 263 ," 50 | "Convolution 264 1 1 263 264 128 1 128 3 3 1 1 1 1 1 -1 1 1 ," 51 | "ReLU 266 1 1 264 266 ," 52 | "Convolution 267 1 1 266 267 1 128 128 1 1 1 1 0 0 1 -1 1 1 ," 53 | "ReLU 269 1 1 267 269 ," 54 | "Convolution 270 1 1 269 270 128 1 128 3 3 1 1 1 1 1 -1 1 1 ," 55 | "ReLU 272 1 1 270 272 ," 56 | "Convolution 273 1 1 272 273 1 128 128 1 1 1 1 0 0 1 -1 1 1 ," 57 | "ReLU 275 1 1 273 275 ," 58 | "Convolution 276 1 1 275 276 128 1 128 3 3 1 1 1 1 1 -1 1 1 ," 59 | "ReLU 277 1 1 276 277 ," 60 | "Convolution 278 1 1 277 278 1 128 4 1 1 1 1 0 0 1 -1 1 1 ," 61 | "Permute 279 1 1 278 279 4 0 2 3 1 ," 62 | "Reshape 289 1 1 279 289 0 4 4 0 -1 2 1 ," 63 | "Convolution 290 1 1 275 290 128 1 128 3 3 1 1 1 1 1 -1 1 1 ," 64 | "ReLU 291 1 1 290 291 ," 65 | "Convolution 292 1 1 291 292 1 128 8 1 1 1 1 0 0 1 -1 1 1 ," 66 | "Permute 293 1 1 292 293 4 0 2 3 1 ," 67 | "Reshape 303 1 1 293 303 0 4 4 0 -1 4 1 ," 68 | "Convolution 304 1 1 275 304 128 1 128 3 3 2 2 1 1 1 -1 1 1 ," 69 | "ReLU 306 1 1 304 306 ," 70 | "Convolution 307 1 1 306 307 1 128 256 1 1 1 1 0 0 1 -1 1 1 ," 71 | "ReLU 309 1 1 307 309 ," 72 | "Convolution 310 1 1 309 310 256 1 256 3 3 1 1 1 1 1 -1 1 1 ," 73 | "ReLU 312 1 1 310 312 ," 74 | "Convolution 313 1 1 312 313 1 256 256 1 1 1 1 0 0 1 -1 1 1 ," 75 | "ReLU 315 1 1 313 315 ," 76 | "Convolution 316 1 1 315 316 256 1 256 3 3 1 1 1 1 1 -1 1 1 ," 77 | "ReLU 317 1 1 316 317 ," 78 | "Convolution 318 1 1 317 318 1 256 4 1 1 1 1 0 0 1 -1 1 1 ," 79 | "Permute 319 1 1 318 319 4 0 2 3 1 ," 80 | "Reshape 329 1 1 319 329 0 4 4 0 -1 2 1 ," 81 | "Convolution 330 1 1 315 330 256 1 256 3 3 1 1 1 1 1 -1 1 1 ," 82 | "ReLU 331 1 1 330 331 ," 83 | "Convolution 332 1 1 331 332 1 256 8 1 1 1 1 0 0 1 -1 1 1 ," 84 | "Permute 333 1 1 332 333 4 0 2 3 1 ," 85 | "Reshape 343 1 1 333 343 0 4 4 0 -1 4 1 ," 86 | "Convolution 344 1 1 315 344 1 256 64 1 1 1 1 0 0 1 -1 1 1 ," 87 | "ReLU 345 1 1 344 345 ," 88 | "Convolution 346 1 1 345 346 64 1 64 3 3 2 2 1 1 1 -1 1 1 ," 89 | "ReLU 347 1 1 346 347 ," 90 | "Convolution 348 1 1 347 348 1 64 256 1 1 1 1 0 0 1 -1 1 1 ," 91 | "ReLU 349 1 1 348 349 ," 92 | "Convolution 350 1 1 349 350 1 256 6 3 3 1 1 1 1 1 -1 1 1 ," 93 | "Permute 351 1 1 350 351 4 0 2 3 1 ," 94 | "Reshape 361 1 1 351 361 0 4 4 0 -1 2 1 ," 95 | "Convolution 362 1 1 349 362 1 256 12 3 3 1 1 1 1 1 -1 1 1 ," 96 | "Permute 363 1 1 362 363 4 0 2 3 1 ," 97 | "Reshape 373 1 1 363 373 0 4 4 0 -1 4 1 ," 98 | "Concat 374 4 1 243 289 329 361 374 1 ," 99 | "Concat boxes 4 1 257 303 343 373 boxes 1 ," 100 | "SoftmaxCaffe scores 1 1 374 scores 2 ," 101 | -------------------------------------------------------------------------------- /mobilenet_v2/mobilenet_v2.onnx.opt.onnx.rapidmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0bd4e45faaabd68048e51ebd59c5d82c73c1d16a373fafd4fc765fbc3816d843 3 | size 13959890 4 | -------------------------------------------------------------------------------- /mobilenet_v2/mobilenet_v2.onnx.opt.onnx.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0bd4e45faaabd68048e51ebd59c5d82c73c1d16a373fafd4fc765fbc3816d843 3 | size 13959890 4 | -------------------------------------------------------------------------------- /mobilenet_v2/mobilenet_v2.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0bd4e45faaabd68048e51ebd59c5d82c73c1d16a373fafd4fc765fbc3816d843 3 | size 13959890 4 | -------------------------------------------------------------------------------- /model/bert-based/bert-based.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:28ef925988774d738c3394d1d1aadad8426b2573f891a88c957c844f15005fe8 3 | size 409091976 4 | -------------------------------------------------------------------------------- /model/bertsquad10/bertsquad10_clean.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:86f1fc197b82ab44c15b9f5dbc27dcaeeb0c12036feae1c57b4ec8d563979e14 3 | size 434818907 4 | -------------------------------------------------------------------------------- /model/blazeface/blazeface.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f6471a197cc09aa2642908f51d61f4497b706cbe532704f76b383156bdfd805c 3 | size 408185 4 | -------------------------------------------------------------------------------- /model/blazeface/blazeface.tnnproto: -------------------------------------------------------------------------------- 1 | "1 99 1 4206624770 ," 2 | "x.1 1 3 128 128 ," 3 | " 102 103 104 105 106 107 131 132 133 134 135 159 160 184 185 186 187 188 212 213 214 215 216 240 241 242 243 244 268 269 293 294 295 296 297 321 322 323 324 325 349 350 351 352 353 377 378 379 380 381 405 406 407 408 409 433 434 435 436 437 461 462 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 515 516 517 524 525 526 527 534 535 536 543 544 545 546 98 x.1 ," 4 | "544 546 ," 5 | " 100 ," 6 | "Pad Pad_23 1 1 x.1 98 0 0 1 2 1 2 0 0 0 0 ," 7 | "Convolution Conv_27 1 1 98 102 1 3 24 5 5 2 2 0 0 1 -1 1 1 ," 8 | "ReLU Relu_28 1 1 102 103 ," 9 | "Convolution Conv_29 1 1 103 104 24 1 24 3 3 1 1 1 1 1 -1 1 1 ," 10 | "Convolution Conv_30 1 1 104 105 1 24 24 1 1 1 1 0 0 1 -1 1 1 ," 11 | "Add Add_31 2 1 105 103 106 ," 12 | "ReLU Relu_32 1 1 106 107 ," 13 | "Pad Pad_56 1 1 107 131 0 0 0 0 0 0 0 4 0 0 ," 14 | "Convolution Conv_57 1 1 107 132 24 1 24 3 3 1 1 1 1 1 -1 1 1 ," 15 | "Convolution Conv_58 1 1 132 133 1 24 28 1 1 1 1 0 0 1 -1 1 1 ," 16 | "Add Add_59 2 1 133 131 134 ," 17 | "ReLU Relu_60 1 1 134 135 ," 18 | "Pad Pad_84 1 1 135 159 0 0 0 2 0 2 0 0 0 0 ," 19 | "Pooling MaxPool_85 1 1 135 160 0 2 2 2 2 0 0 -1 -1 -1 0 ," 20 | "Pad Pad_109 1 1 160 184 0 0 0 0 0 0 0 4 0 0 ," 21 | "Convolution Conv_110 1 1 159 185 28 1 28 3 3 2 2 0 0 1 -1 1 1 ," 22 | "Convolution Conv_111 1 1 185 186 1 28 32 1 1 1 1 0 0 1 -1 1 1 ," 23 | "Add Add_112 2 1 186 184 187 ," 24 | "ReLU Relu_113 1 1 187 188 ," 25 | "Pad Pad_137 1 1 188 212 0 0 0 0 0 0 0 4 0 0 ," 26 | "Convolution Conv_138 1 1 188 213 32 1 32 3 3 1 1 1 1 1 -1 1 1 ," 27 | "Convolution Conv_139 1 1 213 214 1 32 36 1 1 1 1 0 0 1 -1 1 1 ," 28 | "Add Add_140 2 1 214 212 215 ," 29 | "ReLU Relu_141 1 1 215 216 ," 30 | "Pad Pad_165 1 1 216 240 0 0 0 0 0 0 0 6 0 0 ," 31 | "Convolution Conv_166 1 1 216 241 36 1 36 3 3 1 1 1 1 1 -1 1 1 ," 32 | "Convolution Conv_167 1 1 241 242 1 36 42 1 1 1 1 0 0 1 -1 1 1 ," 33 | "Add Add_168 2 1 242 240 243 ," 34 | "ReLU Relu_169 1 1 243 244 ," 35 | "Pad Pad_193 1 1 244 268 0 0 0 2 0 2 0 0 0 0 ," 36 | "Pooling MaxPool_194 1 1 244 269 0 2 2 2 2 0 0 -1 -1 -1 0 ," 37 | "Pad Pad_218 1 1 269 293 0 0 0 0 0 0 0 6 0 0 ," 38 | "Convolution Conv_219 1 1 268 294 42 1 42 3 3 2 2 0 0 1 -1 1 1 ," 39 | "Convolution Conv_220 1 1 294 295 1 42 48 1 1 1 1 0 0 1 -1 1 1 ," 40 | "Add Add_221 2 1 295 293 296 ," 41 | "ReLU Relu_222 1 1 296 297 ," 42 | "Pad Pad_246 1 1 297 321 0 0 0 0 0 0 0 8 0 0 ," 43 | "Convolution Conv_247 1 1 297 322 48 1 48 3 3 1 1 1 1 1 -1 1 1 ," 44 | "Convolution Conv_248 1 1 322 323 1 48 56 1 1 1 1 0 0 1 -1 1 1 ," 45 | "Add Add_249 2 1 323 321 324 ," 46 | "ReLU Relu_250 1 1 324 325 ," 47 | "Pad Pad_274 1 1 325 349 0 0 0 0 0 0 0 8 0 0 ," 48 | "Convolution Conv_275 1 1 325 350 56 1 56 3 3 1 1 1 1 1 -1 1 1 ," 49 | "Convolution Conv_276 1 1 350 351 1 56 64 1 1 1 1 0 0 1 -1 1 1 ," 50 | "Add Add_277 2 1 351 349 352 ," 51 | "ReLU Relu_278 1 1 352 353 ," 52 | "Pad Pad_302 1 1 353 377 0 0 0 0 0 0 0 8 0 0 ," 53 | "Convolution Conv_303 1 1 353 378 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 54 | "Convolution Conv_304 1 1 378 379 1 64 72 1 1 1 1 0 0 1 -1 1 1 ," 55 | "Add Add_305 2 1 379 377 380 ," 56 | "ReLU Relu_306 1 1 380 381 ," 57 | "Pad Pad_330 1 1 381 405 0 0 0 0 0 0 0 8 0 0 ," 58 | "Convolution Conv_331 1 1 381 406 72 1 72 3 3 1 1 1 1 1 -1 1 1 ," 59 | "Convolution Conv_332 1 1 406 407 1 72 80 1 1 1 1 0 0 1 -1 1 1 ," 60 | "Add Add_333 2 1 407 405 408 ," 61 | "ReLU Relu_334 1 1 408 409 ," 62 | "Pad Pad_358 1 1 409 433 0 0 0 0 0 0 0 8 0 0 ," 63 | "Convolution Conv_359 1 1 409 434 80 1 80 3 3 1 1 1 1 1 -1 1 1 ," 64 | "Convolution Conv_360 1 1 434 435 1 80 88 1 1 1 1 0 0 1 -1 1 1 ," 65 | "Add Add_361 2 1 435 433 436 ," 66 | "ReLU Relu_362 1 1 436 437 ," 67 | "Pad Pad_386 1 1 437 461 0 0 0 2 0 2 0 0 0 0 ," 68 | "Pooling MaxPool_387 1 1 437 462 0 2 2 2 2 0 0 -1 -1 -1 0 ," 69 | "Pad Pad_411 1 1 462 486 0 0 0 0 0 0 0 8 0 0 ," 70 | "Convolution Conv_412 1 1 461 487 88 1 88 3 3 2 2 0 0 1 -1 1 1 ," 71 | "Convolution Conv_413 1 1 487 488 1 88 96 1 1 1 1 0 0 1 -1 1 1 ," 72 | "Add Add_414 2 1 488 486 489 ," 73 | "ReLU Relu_415 1 1 489 490 ," 74 | "Convolution Conv_416 1 1 490 491 96 1 96 3 3 1 1 1 1 1 -1 1 1 ," 75 | "Convolution Conv_417 1 1 491 492 1 96 96 1 1 1 1 0 0 1 -1 1 1 ," 76 | "Add Add_418 2 1 492 490 493 ," 77 | "ReLU Relu_419 1 1 493 494 ," 78 | "Convolution Conv_420 1 1 494 495 96 1 96 3 3 1 1 1 1 1 -1 1 1 ," 79 | "Convolution Conv_421 1 1 495 496 1 96 96 1 1 1 1 0 0 1 -1 1 1 ," 80 | "Add Add_422 2 1 496 494 497 ," 81 | "ReLU Relu_423 1 1 497 498 ," 82 | "Convolution Conv_424 1 1 498 499 96 1 96 3 3 1 1 1 1 1 -1 1 1 ," 83 | "Convolution Conv_425 1 1 499 500 1 96 96 1 1 1 1 0 0 1 -1 1 1 ," 84 | "Add Add_426 2 1 500 498 501 ," 85 | "ReLU Relu_427 1 1 501 502 ," 86 | "Convolution Conv_428 1 1 502 503 96 1 96 3 3 1 1 1 1 1 -1 1 1 ," 87 | "Convolution Conv_429 1 1 503 504 1 96 96 1 1 1 1 0 0 1 -1 1 1 ," 88 | "Add Add_430 2 1 504 502 505 ," 89 | "ReLU Relu_431 1 1 505 506 ," 90 | "Convolution Conv_432 1 1 437 507 1 88 2 1 1 1 1 0 0 1 -1 1 1 ," 91 | "Permute Transpose_433 1 1 507 508 4 0 2 3 1 ," 92 | "Reshape Reshape_440 1 1 508 515 0 4 4 0 -1 1 1 ," 93 | "Convolution Conv_441 1 1 506 516 1 96 6 1 1 1 1 0 0 1 -1 1 1 ," 94 | "Permute Transpose_442 1 1 516 517 4 0 2 3 1 ," 95 | "Reshape Reshape_449 1 1 517 524 0 4 4 0 -1 1 1 ," 96 | "Concat Concat_450 2 1 515 524 525 1 ," 97 | "Clip Clip_Score 1 1 525 545 -100.0 100.0 ," 98 | "Sigmoid Sigmoid_Score 1 1 545 546 ," 99 | "Convolution Conv_451 1 1 437 526 1 88 32 1 1 1 1 0 0 1 -1 1 1 ," 100 | "Permute Transpose_452 1 1 526 527 4 0 2 3 1 ," 101 | "Reshape Reshape_459 1 1 527 534 0 4 4 0 -1 16 1 ," 102 | "Convolution Conv_460 1 1 506 535 1 96 96 1 1 1 1 0 0 1 -1 1 1 ," 103 | "Permute Transpose_461 1 1 535 536 4 0 2 3 1 ," 104 | "Reshape Reshape_468 1 1 536 543 0 4 4 0 -1 16 1 ," 105 | "Concat Concat_469 2 1 534 543 544 1 ," 106 | -------------------------------------------------------------------------------- /model/blazepose/pose_detection.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0af039715a159368c81693646cb46b4f030382c81465caef4d57adb94eef6ce1 3 | size 3277883 4 | -------------------------------------------------------------------------------- /model/blazepose/pose_landmark_full_body.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:490c48f2a1b6366c3dcd236d5e05d5b76e6d22b4565981904b4effedd73451fc 3 | size 13703662 4 | -------------------------------------------------------------------------------- /model/blazepose/pose_landmark_upper_body.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:78048df9583ff58eba641b7aadfafc8cb22e62e99ac3375c428e6a5db2f78512 3 | size 13520808 4 | -------------------------------------------------------------------------------- /model/chinese-ocr/angle_net.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8a27b2b8af3e4b6486ea3a16f3094df9ecefc4630fb16286e42f18759b03257a 3 | size 763906 4 | -------------------------------------------------------------------------------- /model/chinese-ocr/angle_net.tnnproto: -------------------------------------------------------------------------------- 1 | "1 156 1 4206624772 ," 2 | "input 4 1 3 32 192 0 ," 3 | " 339 341 342 343 345 347 348 350 351 353 355 356 361 362 363 364 366 367 369 371 372 377 378 379 380 382 383 385 387 388 393 394 395 396 398 399 401 403 404 409 410 412 414 415 417 418 420 422 423 428 429 430 431 433 434 436 438 439 444 445 446 447 449 450 452 454 455 460 461 462 463 465 466 468 470 471 476 477 478 479 481 482 484 486 487 492 493 494 495 497 498 500 502 503 508 509 510 511 513 514 516 518 519 524 525 526 527 529 530 532 534 535 540 541 543 545 546 548 549 551 553 554 559 560 561 562 564 565 567 569 570 575 576 577 578 580 581 583 585 586 591 592 593 594 596 597 599 601 602 607 608 610 611 612 input out ," 4 | "out ," 5 | " 142 ," 6 | "Convolution 339 1 1 input 339 1 3 24 3 3 2 2 1 1 1 -1 1 1 0 ," 7 | "ReLU 341 1 1 339 341 ," 8 | "Pooling 342 1 1 341 342 0 3 3 1 2 1 1 -1 -1 -1 0 ," 9 | "Convolution 343 1 1 342 343 24 1 24 3 3 2 2 1 1 1 -1 1 1 0 ," 10 | "Convolution 345 1 1 343 345 1 24 24 1 1 1 1 0 0 1 -1 1 1 0 ," 11 | "ReLU 347 1 1 345 347 ," 12 | "Convolution 348 1 1 342 348 1 24 24 1 1 1 1 0 0 1 -1 1 1 0 ," 13 | "ReLU 350 1 1 348 350 ," 14 | "Convolution 351 1 1 350 351 24 1 24 3 3 2 2 1 1 1 -1 1 1 0 ," 15 | "Convolution 353 1 1 351 353 1 24 24 1 1 1 1 0 0 1 -1 1 1 0 ," 16 | "ReLU 355 1 1 353 355 ," 17 | "Concat 356 2 1 347 355 356 1 ," 18 | "ShuffleChannel 361 1 1 356 361 2 ," 19 | "SplitV 362 1 2 361 362 363 1 2 24 24 ," 20 | "Convolution 364 1 1 363 364 1 24 24 1 1 1 1 0 0 1 -1 1 1 0 ," 21 | "ReLU 366 1 1 364 366 ," 22 | "Convolution 367 1 1 366 367 24 1 24 3 3 1 1 1 1 1 -1 1 1 0 ," 23 | "Convolution 369 1 1 367 369 1 24 24 1 1 1 1 0 0 1 -1 1 1 0 ," 24 | "ReLU 371 1 1 369 371 ," 25 | "Concat 372 2 1 362 371 372 1 ," 26 | "ShuffleChannel 377 1 1 372 377 2 ," 27 | "SplitV 378 1 2 377 378 379 1 2 24 24 ," 28 | "Convolution 380 1 1 379 380 1 24 24 1 1 1 1 0 0 1 -1 1 1 0 ," 29 | "ReLU 382 1 1 380 382 ," 30 | "Convolution 383 1 1 382 383 24 1 24 3 3 1 1 1 1 1 -1 1 1 0 ," 31 | "Convolution 385 1 1 383 385 1 24 24 1 1 1 1 0 0 1 -1 1 1 0 ," 32 | "ReLU 387 1 1 385 387 ," 33 | "Concat 388 2 1 378 387 388 1 ," 34 | "ShuffleChannel 393 1 1 388 393 2 ," 35 | "SplitV 394 1 2 393 394 395 1 2 24 24 ," 36 | "Convolution 396 1 1 395 396 1 24 24 1 1 1 1 0 0 1 -1 1 1 0 ," 37 | "ReLU 398 1 1 396 398 ," 38 | "Convolution 399 1 1 398 399 24 1 24 3 3 1 1 1 1 1 -1 1 1 0 ," 39 | "Convolution 401 1 1 399 401 1 24 24 1 1 1 1 0 0 1 -1 1 1 0 ," 40 | "ReLU 403 1 1 401 403 ," 41 | "Concat 404 2 1 394 403 404 1 ," 42 | "ShuffleChannel 409 1 1 404 409 2 ," 43 | "Convolution 410 1 1 409 410 48 1 48 3 3 2 2 1 1 1 -1 1 1 0 ," 44 | "Convolution 412 1 1 410 412 1 48 48 1 1 1 1 0 0 1 -1 1 1 0 ," 45 | "ReLU 414 1 1 412 414 ," 46 | "Convolution 415 1 1 409 415 1 48 48 1 1 1 1 0 0 1 -1 1 1 0 ," 47 | "ReLU 417 1 1 415 417 ," 48 | "Convolution 418 1 1 417 418 48 1 48 3 3 2 2 1 1 1 -1 1 1 0 ," 49 | "Convolution 420 1 1 418 420 1 48 48 1 1 1 1 0 0 1 -1 1 1 0 ," 50 | "ReLU 422 1 1 420 422 ," 51 | "Concat 423 2 1 414 422 423 1 ," 52 | "ShuffleChannel 428 1 1 423 428 2 ," 53 | "SplitV 429 1 2 428 429 430 1 2 48 48 ," 54 | "Convolution 431 1 1 430 431 1 48 48 1 1 1 1 0 0 1 -1 1 1 0 ," 55 | "ReLU 433 1 1 431 433 ," 56 | "Convolution 434 1 1 433 434 48 1 48 3 3 1 1 1 1 1 -1 1 1 0 ," 57 | "Convolution 436 1 1 434 436 1 48 48 1 1 1 1 0 0 1 -1 1 1 0 ," 58 | "ReLU 438 1 1 436 438 ," 59 | "Concat 439 2 1 429 438 439 1 ," 60 | "ShuffleChannel 444 1 1 439 444 2 ," 61 | "SplitV 445 1 2 444 445 446 1 2 48 48 ," 62 | "Convolution 447 1 1 446 447 1 48 48 1 1 1 1 0 0 1 -1 1 1 0 ," 63 | "ReLU 449 1 1 447 449 ," 64 | "Convolution 450 1 1 449 450 48 1 48 3 3 1 1 1 1 1 -1 1 1 0 ," 65 | "Convolution 452 1 1 450 452 1 48 48 1 1 1 1 0 0 1 -1 1 1 0 ," 66 | "ReLU 454 1 1 452 454 ," 67 | "Concat 455 2 1 445 454 455 1 ," 68 | "ShuffleChannel 460 1 1 455 460 2 ," 69 | "SplitV 461 1 2 460 461 462 1 2 48 48 ," 70 | "Convolution 463 1 1 462 463 1 48 48 1 1 1 1 0 0 1 -1 1 1 0 ," 71 | "ReLU 465 1 1 463 465 ," 72 | "Convolution 466 1 1 465 466 48 1 48 3 3 1 1 1 1 1 -1 1 1 0 ," 73 | "Convolution 468 1 1 466 468 1 48 48 1 1 1 1 0 0 1 -1 1 1 0 ," 74 | "ReLU 470 1 1 468 470 ," 75 | "Concat 471 2 1 461 470 471 1 ," 76 | "ShuffleChannel 476 1 1 471 476 2 ," 77 | "SplitV 477 1 2 476 477 478 1 2 48 48 ," 78 | "Convolution 479 1 1 478 479 1 48 48 1 1 1 1 0 0 1 -1 1 1 0 ," 79 | "ReLU 481 1 1 479 481 ," 80 | "Convolution 482 1 1 481 482 48 1 48 3 3 1 1 1 1 1 -1 1 1 0 ," 81 | "Convolution 484 1 1 482 484 1 48 48 1 1 1 1 0 0 1 -1 1 1 0 ," 82 | "ReLU 486 1 1 484 486 ," 83 | "Concat 487 2 1 477 486 487 1 ," 84 | "ShuffleChannel 492 1 1 487 492 2 ," 85 | "SplitV 493 1 2 492 493 494 1 2 48 48 ," 86 | "Convolution 495 1 1 494 495 1 48 48 1 1 1 1 0 0 1 -1 1 1 0 ," 87 | "ReLU 497 1 1 495 497 ," 88 | "Convolution 498 1 1 497 498 48 1 48 3 3 1 1 1 1 1 -1 1 1 0 ," 89 | "Convolution 500 1 1 498 500 1 48 48 1 1 1 1 0 0 1 -1 1 1 0 ," 90 | "ReLU 502 1 1 500 502 ," 91 | "Concat 503 2 1 493 502 503 1 ," 92 | "ShuffleChannel 508 1 1 503 508 2 ," 93 | "SplitV 509 1 2 508 509 510 1 2 48 48 ," 94 | "Convolution 511 1 1 510 511 1 48 48 1 1 1 1 0 0 1 -1 1 1 0 ," 95 | "ReLU 513 1 1 511 513 ," 96 | "Convolution 514 1 1 513 514 48 1 48 3 3 1 1 1 1 1 -1 1 1 0 ," 97 | "Convolution 516 1 1 514 516 1 48 48 1 1 1 1 0 0 1 -1 1 1 0 ," 98 | "ReLU 518 1 1 516 518 ," 99 | "Concat 519 2 1 509 518 519 1 ," 100 | "ShuffleChannel 524 1 1 519 524 2 ," 101 | "SplitV 525 1 2 524 525 526 1 2 48 48 ," 102 | "Convolution 527 1 1 526 527 1 48 48 1 1 1 1 0 0 1 -1 1 1 0 ," 103 | "ReLU 529 1 1 527 529 ," 104 | "Convolution 530 1 1 529 530 48 1 48 3 3 1 1 1 1 1 -1 1 1 0 ," 105 | "Convolution 532 1 1 530 532 1 48 48 1 1 1 1 0 0 1 -1 1 1 0 ," 106 | "ReLU 534 1 1 532 534 ," 107 | "Concat 535 2 1 525 534 535 1 ," 108 | "ShuffleChannel 540 1 1 535 540 2 ," 109 | "Convolution 541 1 1 540 541 96 1 96 3 3 2 2 1 1 1 -1 1 1 0 ," 110 | "Convolution 543 1 1 541 543 1 96 96 1 1 1 1 0 0 1 -1 1 1 0 ," 111 | "ReLU 545 1 1 543 545 ," 112 | "Convolution 546 1 1 540 546 1 96 96 1 1 1 1 0 0 1 -1 1 1 0 ," 113 | "ReLU 548 1 1 546 548 ," 114 | "Convolution 549 1 1 548 549 96 1 96 3 3 2 2 1 1 1 -1 1 1 0 ," 115 | "Convolution 551 1 1 549 551 1 96 96 1 1 1 1 0 0 1 -1 1 1 0 ," 116 | "ReLU 553 1 1 551 553 ," 117 | "Concat 554 2 1 545 553 554 1 ," 118 | "ShuffleChannel 559 1 1 554 559 2 ," 119 | "SplitV 560 1 2 559 560 561 1 2 96 96 ," 120 | "Convolution 562 1 1 561 562 1 96 96 1 1 1 1 0 0 1 -1 1 1 0 ," 121 | "ReLU 564 1 1 562 564 ," 122 | "Convolution 565 1 1 564 565 96 1 96 3 3 1 1 1 1 1 -1 1 1 0 ," 123 | "Convolution 567 1 1 565 567 1 96 96 1 1 1 1 0 0 1 -1 1 1 0 ," 124 | "ReLU 569 1 1 567 569 ," 125 | "Concat 570 2 1 560 569 570 1 ," 126 | "ShuffleChannel 575 1 1 570 575 2 ," 127 | "SplitV 576 1 2 575 576 577 1 2 96 96 ," 128 | "Convolution 578 1 1 577 578 1 96 96 1 1 1 1 0 0 1 -1 1 1 0 ," 129 | "ReLU 580 1 1 578 580 ," 130 | "Convolution 581 1 1 580 581 96 1 96 3 3 1 1 1 1 1 -1 1 1 0 ," 131 | "Convolution 583 1 1 581 583 1 96 96 1 1 1 1 0 0 1 -1 1 1 0 ," 132 | "ReLU 585 1 1 583 585 ," 133 | "Concat 586 2 1 576 585 586 1 ," 134 | "ShuffleChannel 591 1 1 586 591 2 ," 135 | "SplitV 592 1 2 591 592 593 1 2 96 96 ," 136 | "Convolution 594 1 1 593 594 1 96 96 1 1 1 1 0 0 1 -1 1 1 0 ," 137 | "ReLU 596 1 1 594 596 ," 138 | "Convolution 597 1 1 596 597 96 1 96 3 3 1 1 1 1 1 -1 1 1 0 ," 139 | "Convolution 599 1 1 597 599 1 96 96 1 1 1 1 0 0 1 -1 1 1 0 ," 140 | "ReLU 601 1 1 599 601 ," 141 | "Concat 602 2 1 592 601 602 1 ," 142 | "ShuffleChannel 607 1 1 602 607 2 ," 143 | "Convolution 608 1 1 607 608 1 192 256 1 1 1 1 0 0 1 -1 1 1 0 ," 144 | "ReLU 610 1 1 608 610 ," 145 | "ReduceMean 611 1 1 610 611 0 2 3 ," 146 | "InnerProduct 612 1 1 611 612 2 1 0 1 ," 147 | "SoftmaxCaffe out 1 1 612 out 1 ," 148 | -------------------------------------------------------------------------------- /model/chinese-ocr/crnn_lite_lstm.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:39da5d8f0a6f8833d494fda47648ed1003b258a63d94ca0645fec2aa077155a1 3 | size 5232768 4 | -------------------------------------------------------------------------------- /model/chinese-ocr/dbnet.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d161bd0e5873f62782d7d30632bc07fafa89068339c03cef83b8e43bbb237c7a 3 | size 3623026 4 | -------------------------------------------------------------------------------- /model/chinese-ocr/dbnet.tnnproto: -------------------------------------------------------------------------------- 1 | "1 154 1 4206624772 ," 2 | "input0 4 1 3 320 320 0 ," 3 | " 331 338 339 341 342 344 345 347 348 350 351 353 355 356 358 359 361 362 364 365 373 377 378 379 380 385 393 394 395 396 398 400 401 409 413 414 415 416 421 429 430 431 432 434 435 437 438 446 450 451 452 453 458 466 467 468 469 471 472 479 480 487 488 490 497 498 505 506 508 509 516 517 524 525 527 528 535 536 543 544 546 547 554 555 563 567 568 569 570 575 583 584 590 591 593 600 601 609 613 614 615 616 621 629 630 636 637 639 640 647 648 656 660 661 662 663 668 676 677 683 684 686 688 689 691 708 709 710 712 713 715 732 733 734 736 737 739 756 757 758 760 777 788 799 800 801 803 804 806 808 809 810 input0 out1 ," 4 | "out1 ," 5 | " 153 ," 6 | "Convolution 331 1 1 input0 331 1 3 16 3 3 2 2 1 1 1 -1 1 1 0 ," 7 | "HardSwish 338 1 1 331 338 0.166667 0.5 ," 8 | "Convolution 339 1 1 338 339 16 1 16 3 3 1 1 1 1 1 -1 1 1 0 ," 9 | "ReLU 341 1 1 339 341 ," 10 | "Convolution 342 1 1 341 342 1 16 16 1 1 1 1 0 0 1 -1 1 1 0 ," 11 | "Add 344 2 1 338 342 344 1 ," 12 | "Convolution 345 1 1 344 345 1 16 64 1 1 1 1 0 0 1 -1 1 1 0 ," 13 | "ReLU 347 1 1 345 347 ," 14 | "Convolution 348 1 1 347 348 64 1 64 3 3 2 2 1 1 1 -1 1 1 0 ," 15 | "ReLU 350 1 1 348 350 ," 16 | "Convolution 351 1 1 350 351 1 64 24 1 1 1 1 0 0 1 -1 1 1 0 ," 17 | "Convolution 353 1 1 351 353 1 24 72 1 1 1 1 0 0 1 -1 1 1 0 ," 18 | "ReLU 355 1 1 353 355 ," 19 | "Convolution 356 1 1 355 356 72 1 72 3 3 1 1 1 1 1 -1 1 1 0 ," 20 | "ReLU 358 1 1 356 358 ," 21 | "Convolution 359 1 1 358 359 1 72 24 1 1 1 1 0 0 1 -1 1 1 0 ," 22 | "Add 361 2 1 351 359 361 1 ," 23 | "Convolution 362 1 1 361 362 1 24 72 1 1 1 1 0 0 1 -1 1 1 0 ," 24 | "ReLU 364 1 1 362 364 ," 25 | "Convolution 365 1 1 364 365 72 1 72 5 5 2 2 2 2 1 -1 1 1 0 ," 26 | "Pooling 373 1 1 365 373 1 0 0 1 1 0 0 -1 -1 -1 0 ," 27 | "Reshape 377 1 1 373 377 0 2 2 0 0 0 ," 28 | "InnerProduct 378 1 1 377 378 24 1 0 1 ," 29 | "ReLU 379 1 1 378 379 ," 30 | "InnerProduct 380 1 1 379 380 72 1 0 1 ," 31 | "HardSigmoid 385 1 1 380 385 0.166667 0.5 ," 32 | "Reshape 393 1 1 385 393 0 4 4 0 0 1 1 0 ," 33 | "Mul 394 2 1 365 393 394 1 ," 34 | "ReLU 395 1 1 394 395 ," 35 | "Convolution 396 1 1 395 396 1 72 32 1 1 1 1 0 0 1 -1 1 1 0 ," 36 | "Convolution 398 1 1 396 398 1 32 96 1 1 1 1 0 0 1 -1 1 1 0 ," 37 | "ReLU 400 1 1 398 400 ," 38 | "Convolution 401 1 1 400 401 96 1 96 5 5 1 1 2 2 1 -1 1 1 0 ," 39 | "Pooling 409 1 1 401 409 1 0 0 1 1 0 0 -1 -1 -1 0 ," 40 | "Reshape 413 1 1 409 413 0 2 2 0 0 0 ," 41 | "InnerProduct 414 1 1 413 414 24 1 0 1 ," 42 | "ReLU 415 1 1 414 415 ," 43 | "InnerProduct 416 1 1 415 416 96 1 0 1 ," 44 | "HardSigmoid 421 1 1 416 421 0.166667 0.5 ," 45 | "Reshape 429 1 1 421 429 0 4 4 0 0 1 1 0 ," 46 | "Mul 430 2 1 401 429 430 1 ," 47 | "ReLU 431 1 1 430 431 ," 48 | "Convolution 432 1 1 431 432 1 96 32 1 1 1 1 0 0 1 -1 1 1 0 ," 49 | "Add 434 2 1 396 432 434 1 ," 50 | "Convolution 435 1 1 434 435 1 32 96 1 1 1 1 0 0 1 -1 1 1 0 ," 51 | "ReLU 437 1 1 435 437 ," 52 | "Convolution 438 1 1 437 438 96 1 96 5 5 1 1 2 2 1 -1 1 1 0 ," 53 | "Pooling 446 1 1 438 446 1 0 0 1 1 0 0 -1 -1 -1 0 ," 54 | "Reshape 450 1 1 446 450 0 2 2 0 0 0 ," 55 | "InnerProduct 451 1 1 450 451 24 1 0 1 ," 56 | "ReLU 452 1 1 451 452 ," 57 | "InnerProduct 453 1 1 452 453 96 1 0 1 ," 58 | "HardSigmoid 458 1 1 453 458 0.166667 0.5 ," 59 | "Reshape 466 1 1 458 466 0 4 4 0 0 1 1 0 ," 60 | "Mul 467 2 1 438 466 467 1 ," 61 | "ReLU 468 1 1 467 468 ," 62 | "Convolution 469 1 1 468 469 1 96 32 1 1 1 1 0 0 1 -1 1 1 0 ," 63 | "Add 471 2 1 434 469 471 1 ," 64 | "Convolution 472 1 1 471 472 1 32 192 1 1 1 1 0 0 1 -1 1 1 0 ," 65 | "HardSwish 479 1 1 472 479 0.166667 0.5 ," 66 | "Convolution 480 1 1 479 480 192 1 192 3 3 2 2 1 1 1 -1 1 1 0 ," 67 | "HardSwish 487 1 1 480 487 0.166667 0.5 ," 68 | "Convolution 488 1 1 487 488 1 192 64 1 1 1 1 0 0 1 -1 1 1 0 ," 69 | "Convolution 490 1 1 488 490 1 64 160 1 1 1 1 0 0 1 -1 1 1 0 ," 70 | "HardSwish 497 1 1 490 497 0.166667 0.5 ," 71 | "Convolution 498 1 1 497 498 160 1 160 3 3 1 1 1 1 1 -1 1 1 0 ," 72 | "HardSwish 505 1 1 498 505 0.166667 0.5 ," 73 | "Convolution 506 1 1 505 506 1 160 64 1 1 1 1 0 0 1 -1 1 1 0 ," 74 | "Add 508 2 1 488 506 508 1 ," 75 | "Convolution 509 1 1 508 509 1 64 144 1 1 1 1 0 0 1 -1 1 1 0 ," 76 | "HardSwish 516 1 1 509 516 0.166667 0.5 ," 77 | "Convolution 517 1 1 516 517 144 1 144 3 3 1 1 1 1 1 -1 1 1 0 ," 78 | "HardSwish 524 1 1 517 524 0.166667 0.5 ," 79 | "Convolution 525 1 1 524 525 1 144 64 1 1 1 1 0 0 1 -1 1 1 0 ," 80 | "Add 527 2 1 508 525 527 1 ," 81 | "Convolution 528 1 1 527 528 1 64 144 1 1 1 1 0 0 1 -1 1 1 0 ," 82 | "HardSwish 535 1 1 528 535 0.166667 0.5 ," 83 | "Convolution 536 1 1 535 536 144 1 144 3 3 1 1 1 1 1 -1 1 1 0 ," 84 | "HardSwish 543 1 1 536 543 0.166667 0.5 ," 85 | "Convolution 544 1 1 543 544 1 144 64 1 1 1 1 0 0 1 -1 1 1 0 ," 86 | "Add 546 2 1 527 544 546 1 ," 87 | "Convolution 547 1 1 546 547 1 64 384 1 1 1 1 0 0 1 -1 1 1 0 ," 88 | "HardSwish 554 1 1 547 554 0.166667 0.5 ," 89 | "Convolution 555 1 1 554 555 384 1 384 3 3 1 1 1 1 1 -1 1 1 0 ," 90 | "Pooling 563 1 1 555 563 1 0 0 1 1 0 0 -1 -1 -1 0 ," 91 | "Reshape 567 1 1 563 567 0 2 2 0 0 0 ," 92 | "InnerProduct 568 1 1 567 568 96 1 0 1 ," 93 | "ReLU 569 1 1 568 569 ," 94 | "InnerProduct 570 1 1 569 570 384 1 0 1 ," 95 | "HardSigmoid 575 1 1 570 575 0.166667 0.5 ," 96 | "Reshape 583 1 1 575 583 0 4 4 0 0 1 1 0 ," 97 | "Mul 584 2 1 555 583 584 1 ," 98 | "HardSwish 590 1 1 584 590 0.166667 0.5 ," 99 | "Convolution 591 1 1 590 591 1 384 88 1 1 1 1 0 0 1 -1 1 1 0 ," 100 | "Convolution 593 1 1 591 593 1 88 528 1 1 1 1 0 0 1 -1 1 1 0 ," 101 | "HardSwish 600 1 1 593 600 0.166667 0.5 ," 102 | "Convolution 601 1 1 600 601 528 1 528 3 3 1 1 1 1 1 -1 1 1 0 ," 103 | "Pooling 609 1 1 601 609 1 0 0 1 1 0 0 -1 -1 -1 0 ," 104 | "Reshape 613 1 1 609 613 0 2 2 0 0 0 ," 105 | "InnerProduct 614 1 1 613 614 136 1 0 1 ," 106 | "ReLU 615 1 1 614 615 ," 107 | "InnerProduct 616 1 1 615 616 528 1 0 1 ," 108 | "HardSigmoid 621 1 1 616 621 0.166667 0.5 ," 109 | "Reshape 629 1 1 621 629 0 4 4 0 0 1 1 0 ," 110 | "Mul 630 2 1 601 629 630 1 ," 111 | "HardSwish 636 1 1 630 636 0.166667 0.5 ," 112 | "Convolution 637 1 1 636 637 1 528 88 1 1 1 1 0 0 1 -1 1 1 0 ," 113 | "Add 639 2 1 591 637 639 1 ," 114 | "Convolution 640 1 1 639 640 1 88 528 1 1 1 1 0 0 1 -1 1 1 0 ," 115 | "HardSwish 647 1 1 640 647 0.166667 0.5 ," 116 | "Convolution 648 1 1 647 648 528 1 528 5 5 2 2 2 2 1 -1 1 1 0 ," 117 | "Pooling 656 1 1 648 656 1 0 0 1 1 0 0 -1 -1 -1 0 ," 118 | "Reshape 660 1 1 656 660 0 2 2 0 0 0 ," 119 | "InnerProduct 661 1 1 660 661 136 1 0 1 ," 120 | "ReLU 662 1 1 661 662 ," 121 | "InnerProduct 663 1 1 662 663 528 1 0 1 ," 122 | "HardSigmoid 668 1 1 663 668 0.166667 0.5 ," 123 | "Reshape 676 1 1 668 676 0 4 4 0 0 1 1 0 ," 124 | "Mul 677 2 1 648 676 677 1 ," 125 | "HardSwish 683 1 1 677 683 0.166667 0.5 ," 126 | "Convolution 684 1 1 683 684 1 528 120 1 1 1 1 0 0 1 -1 1 1 0 ," 127 | "Convolution 686 1 1 684 686 1 120 24 1 1 1 1 0 0 1 -1 1 1 0 ," 128 | "ReLU 688 1 1 686 688 ," 129 | "Convolution 689 1 1 639 689 1 88 24 1 1 1 1 0 0 1 -1 1 1 0 ," 130 | "ReLU 691 1 1 689 691 ," 131 | "Upsample 708 1 1 688 708 1 2 2 0 ," 132 | "Add 709 2 1 708 691 709 1 ," 133 | "Convolution 710 1 1 709 710 1 24 24 3 3 1 1 1 1 1 -1 1 1 0 ," 134 | "ReLU 712 1 1 710 712 ," 135 | "Convolution 713 1 1 471 713 1 32 24 1 1 1 1 0 0 1 -1 1 1 0 ," 136 | "ReLU 715 1 1 713 715 ," 137 | "Upsample 732 1 1 712 732 1 2 2 0 ," 138 | "Add 733 2 1 732 715 733 1 ," 139 | "Convolution 734 1 1 733 734 1 24 24 3 3 1 1 1 1 1 -1 1 1 0 ," 140 | "ReLU 736 1 1 734 736 ," 141 | "Convolution 737 1 1 361 737 1 24 24 1 1 1 1 0 0 1 -1 1 1 0 ," 142 | "ReLU 739 1 1 737 739 ," 143 | "Upsample 756 1 1 736 756 1 2 2 0 ," 144 | "Add 757 2 1 756 739 757 1 ," 145 | "Convolution 758 1 1 757 758 1 24 24 3 3 1 1 1 1 1 -1 1 1 0 ," 146 | "ReLU 760 1 1 758 760 ," 147 | "Upsample 777 1 1 736 777 1 2 2 0 ," 148 | "Upsample 788 1 1 712 788 1 4 4 0 ," 149 | "Upsample 799 1 1 688 799 1 8 8 0 ," 150 | "Concat 800 4 1 760 777 788 799 800 1 ," 151 | "Convolution 801 1 1 800 801 1 96 96 3 3 1 1 1 1 1 -1 1 1 0 ," 152 | "ReLU 803 1 1 801 803 ," 153 | "Convolution 804 1 1 803 804 1 96 24 3 3 1 1 1 1 1 -1 1 1 0 ," 154 | "ReLU 806 1 1 804 806 ," 155 | "Deconvolution 808 1 1 806 808 1 24 24 2 2 2 2 0 0 1 -1 1 1 0 ," 156 | "ReLU 809 1 1 808 809 ," 157 | "Deconvolution 810 1 1 809 810 1 24 1 2 2 2 2 0 0 1 -1 1 1 0 ," 158 | "Sigmoid out1 1 1 810 out1 ," 159 | -------------------------------------------------------------------------------- /model/face-detector/version-slim-320_simplified.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/model/face-detector/version-slim-320_simplified.bin -------------------------------------------------------------------------------- /model/face-detector/version-slim-320_simplified.onnx: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5b38ea4cbf1fc97bad3523197ddb65bcc4d19bf27f4043edc322ac296323bbe4 3 | size 1047682 4 | -------------------------------------------------------------------------------- /model/face-detector/version-slim-320_simplified.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 100 107 3 | Input input 0 1 input 0=240 1=320 2=3 4 | Convolution 185 1 1 input 185 0=16 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=432 5 | ReLU 187 1 1 185 187 6 | ConvolutionDepthWise 188 1 1 187 188 0=16 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=144 7=16 7 | ReLU 190 1 1 188 190 8 | Convolution 191 1 1 190 191 0=32 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=512 9 | ReLU 193 1 1 191 193 10 | ConvolutionDepthWise 194 1 1 193 194 0=32 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=288 7=32 11 | ReLU 196 1 1 194 196 12 | Convolution 197 1 1 196 197 0=32 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=1024 13 | ReLU 199 1 1 197 199 14 | ConvolutionDepthWise 200 1 1 199 200 0=32 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=288 7=32 15 | ReLU 202 1 1 200 202 16 | Convolution 203 1 1 202 203 0=32 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=1024 17 | ReLU 205 1 1 203 205 18 | ConvolutionDepthWise 206 1 1 205 206 0=32 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=288 7=32 19 | ReLU 208 1 1 206 208 20 | Convolution 209 1 1 208 209 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=2048 21 | ReLU 211 1 1 209 211 22 | ConvolutionDepthWise 212 1 1 211 212 0=64 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=576 7=64 23 | ReLU 214 1 1 212 214 24 | Convolution 215 1 1 214 215 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=4096 25 | ReLU 217 1 1 215 217 26 | ConvolutionDepthWise 218 1 1 217 218 0=64 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=576 7=64 27 | ReLU 220 1 1 218 220 28 | Convolution 221 1 1 220 221 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=4096 29 | ReLU 223 1 1 221 223 30 | ConvolutionDepthWise 224 1 1 223 224 0=64 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=576 7=64 31 | ReLU 226 1 1 224 226 32 | Convolution 227 1 1 226 227 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=4096 33 | ReLU 229 1 1 227 229 34 | Split splitncnn_0 1 3 229 229_splitncnn_0 229_splitncnn_1 229_splitncnn_2 35 | ConvolutionDepthWise 230 1 1 229_splitncnn_2 230 0=64 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=576 7=64 36 | ReLU 231 1 1 230 231 37 | Convolution 232 1 1 231 232 0=6 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=384 38 | Permute 233 1 1 232 233 0=3 39 | Reshape 243 1 1 233 243 0=2 1=-1 40 | ConvolutionDepthWise 244 1 1 229_splitncnn_1 244 0=64 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=576 7=64 41 | ReLU 245 1 1 244 245 42 | Convolution 246 1 1 245 246 0=12 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=768 43 | Permute 247 1 1 246 247 0=3 44 | Reshape 257 1 1 247 257 0=4 1=-1 45 | ConvolutionDepthWise 258 1 1 229_splitncnn_0 258 0=64 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=576 7=64 46 | ReLU 260 1 1 258 260 47 | Convolution 261 1 1 260 261 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=8192 48 | ReLU 263 1 1 261 263 49 | ConvolutionDepthWise 264 1 1 263 264 0=128 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=1152 7=128 50 | ReLU 266 1 1 264 266 51 | Convolution 267 1 1 266 267 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=16384 52 | ReLU 269 1 1 267 269 53 | ConvolutionDepthWise 270 1 1 269 270 0=128 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=1152 7=128 54 | ReLU 272 1 1 270 272 55 | Convolution 273 1 1 272 273 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=16384 56 | ReLU 275 1 1 273 275 57 | Split splitncnn_1 1 3 275 275_splitncnn_0 275_splitncnn_1 275_splitncnn_2 58 | ConvolutionDepthWise 276 1 1 275_splitncnn_2 276 0=128 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=1152 7=128 59 | ReLU 277 1 1 276 277 60 | Convolution 278 1 1 277 278 0=4 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=512 61 | Permute 279 1 1 278 279 0=3 62 | Reshape 289 1 1 279 289 0=2 1=-1 63 | ConvolutionDepthWise 290 1 1 275_splitncnn_1 290 0=128 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=1152 7=128 64 | ReLU 291 1 1 290 291 65 | Convolution 292 1 1 291 292 0=8 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=1024 66 | Permute 293 1 1 292 293 0=3 67 | Reshape 303 1 1 293 303 0=4 1=-1 68 | ConvolutionDepthWise 304 1 1 275_splitncnn_0 304 0=128 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=1152 7=128 69 | ReLU 306 1 1 304 306 70 | Convolution 307 1 1 306 307 0=256 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=32768 71 | ReLU 309 1 1 307 309 72 | ConvolutionDepthWise 310 1 1 309 310 0=256 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=2304 7=256 73 | ReLU 312 1 1 310 312 74 | Convolution 313 1 1 312 313 0=256 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=65536 75 | ReLU 315 1 1 313 315 76 | Split splitncnn_2 1 3 315 315_splitncnn_0 315_splitncnn_1 315_splitncnn_2 77 | ConvolutionDepthWise 316 1 1 315_splitncnn_2 316 0=256 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=2304 7=256 78 | ReLU 317 1 1 316 317 79 | Convolution 318 1 1 317 318 0=4 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=1024 80 | Permute 319 1 1 318 319 0=3 81 | Reshape 329 1 1 319 329 0=2 1=-1 82 | ConvolutionDepthWise 330 1 1 315_splitncnn_1 330 0=256 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=2304 7=256 83 | ReLU 331 1 1 330 331 84 | Convolution 332 1 1 331 332 0=8 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=2048 85 | Permute 333 1 1 332 333 0=3 86 | Reshape 343 1 1 333 343 0=4 1=-1 87 | Convolution 344 1 1 315_splitncnn_0 344 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=16384 88 | ReLU 345 1 1 344 345 89 | ConvolutionDepthWise 346 1 1 345 346 0=64 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=576 7=64 90 | ReLU 347 1 1 346 347 91 | Convolution 348 1 1 347 348 0=256 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=16384 92 | ReLU 349 1 1 348 349 93 | Split splitncnn_3 1 2 349 349_splitncnn_0 349_splitncnn_1 94 | Convolution 350 1 1 349_splitncnn_1 350 0=6 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=13824 95 | Permute 351 1 1 350 351 0=3 96 | Reshape 361 1 1 351 361 0=2 1=-1 97 | Convolution 362 1 1 349_splitncnn_0 362 0=12 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=27648 98 | Permute 363 1 1 362 363 0=3 99 | Reshape 373 1 1 363 373 0=4 1=-1 100 | Concat 374 4 1 243 289 329 361 374 0=0 101 | Concat boxes 4 1 257 303 343 373 boxes 0=0 102 | Softmax scores 1 1 374 scores 0=1 1=1 103 | -------------------------------------------------------------------------------- /model/face-detector/version-slim-320_simplified.rapidmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:16dcc886ac4a7573475d1a39450420ff4cdbedc13f5ed7a11417cebe2a1dc82b 3 | size 1034234 4 | -------------------------------------------------------------------------------- /model/face-detector/version-slim-320_simplified.rapidproto: -------------------------------------------------------------------------------- 1 | "1 96 1 4206624770 ," 2 | "input 1 3 240 320 ," 3 | " 185 187 188 190 191 193 194 196 197 199 200 202 203 205 206 208 209 211 212 214 215 217 218 220 221 223 224 226 227 229 230 231 232 233 243 244 245 246 247 257 258 260 261 263 264 266 267 269 270 272 273 275 276 277 278 279 289 290 291 292 293 303 304 306 307 309 310 312 313 315 316 317 318 319 329 330 331 332 333 343 344 345 346 347 348 349 350 351 361 362 363 373 374 boxes input scores ," 4 | "scores boxes ," 5 | " 95 ," 6 | "Convolution 185 1 1 input 185 1 3 16 3 3 2 2 1 1 1 -1 1 1 ," 7 | "ReLU 187 1 1 185 187 ," 8 | "Convolution 188 1 1 187 188 16 1 16 3 3 1 1 1 1 1 -1 1 1 ," 9 | "ReLU 190 1 1 188 190 ," 10 | "Convolution 191 1 1 190 191 1 16 32 1 1 1 1 0 0 1 -1 1 1 ," 11 | "ReLU 193 1 1 191 193 ," 12 | "Convolution 194 1 1 193 194 32 1 32 3 3 2 2 1 1 1 -1 1 1 ," 13 | "ReLU 196 1 1 194 196 ," 14 | "Convolution 197 1 1 196 197 1 32 32 1 1 1 1 0 0 1 -1 1 1 ," 15 | "ReLU 199 1 1 197 199 ," 16 | "Convolution 200 1 1 199 200 32 1 32 3 3 1 1 1 1 1 -1 1 1 ," 17 | "ReLU 202 1 1 200 202 ," 18 | "Convolution 203 1 1 202 203 1 32 32 1 1 1 1 0 0 1 -1 1 1 ," 19 | "ReLU 205 1 1 203 205 ," 20 | "Convolution 206 1 1 205 206 32 1 32 3 3 2 2 1 1 1 -1 1 1 ," 21 | "ReLU 208 1 1 206 208 ," 22 | "Convolution 209 1 1 208 209 1 32 64 1 1 1 1 0 0 1 -1 1 1 ," 23 | "ReLU 211 1 1 209 211 ," 24 | "Convolution 212 1 1 211 212 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 25 | "ReLU 214 1 1 212 214 ," 26 | "Convolution 215 1 1 214 215 1 64 64 1 1 1 1 0 0 1 -1 1 1 ," 27 | "ReLU 217 1 1 215 217 ," 28 | "Convolution 218 1 1 217 218 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 29 | "ReLU 220 1 1 218 220 ," 30 | "Convolution 221 1 1 220 221 1 64 64 1 1 1 1 0 0 1 -1 1 1 ," 31 | "ReLU 223 1 1 221 223 ," 32 | "Convolution 224 1 1 223 224 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 33 | "ReLU 226 1 1 224 226 ," 34 | "Convolution 227 1 1 226 227 1 64 64 1 1 1 1 0 0 1 -1 1 1 ," 35 | "ReLU 229 1 1 227 229 ," 36 | "Convolution 230 1 1 229 230 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 37 | "ReLU 231 1 1 230 231 ," 38 | "Convolution 232 1 1 231 232 1 64 6 1 1 1 1 0 0 1 -1 1 1 ," 39 | "Permute 233 1 1 232 233 4 0 2 3 1 ," 40 | "Reshape 243 1 1 233 243 0 4 4 0 -1 2 1 ," 41 | "Convolution 244 1 1 229 244 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 42 | "ReLU 245 1 1 244 245 ," 43 | "Convolution 246 1 1 245 246 1 64 12 1 1 1 1 0 0 1 -1 1 1 ," 44 | "Permute 247 1 1 246 247 4 0 2 3 1 ," 45 | "Reshape 257 1 1 247 257 0 4 4 0 -1 4 1 ," 46 | "Convolution 258 1 1 229 258 64 1 64 3 3 2 2 1 1 1 -1 1 1 ," 47 | "ReLU 260 1 1 258 260 ," 48 | "Convolution 261 1 1 260 261 1 64 128 1 1 1 1 0 0 1 -1 1 1 ," 49 | "ReLU 263 1 1 261 263 ," 50 | "Convolution 264 1 1 263 264 128 1 128 3 3 1 1 1 1 1 -1 1 1 ," 51 | "ReLU 266 1 1 264 266 ," 52 | "Convolution 267 1 1 266 267 1 128 128 1 1 1 1 0 0 1 -1 1 1 ," 53 | "ReLU 269 1 1 267 269 ," 54 | "Convolution 270 1 1 269 270 128 1 128 3 3 1 1 1 1 1 -1 1 1 ," 55 | "ReLU 272 1 1 270 272 ," 56 | "Convolution 273 1 1 272 273 1 128 128 1 1 1 1 0 0 1 -1 1 1 ," 57 | "ReLU 275 1 1 273 275 ," 58 | "Convolution 276 1 1 275 276 128 1 128 3 3 1 1 1 1 1 -1 1 1 ," 59 | "ReLU 277 1 1 276 277 ," 60 | "Convolution 278 1 1 277 278 1 128 4 1 1 1 1 0 0 1 -1 1 1 ," 61 | "Permute 279 1 1 278 279 4 0 2 3 1 ," 62 | "Reshape 289 1 1 279 289 0 4 4 0 -1 2 1 ," 63 | "Convolution 290 1 1 275 290 128 1 128 3 3 1 1 1 1 1 -1 1 1 ," 64 | "ReLU 291 1 1 290 291 ," 65 | "Convolution 292 1 1 291 292 1 128 8 1 1 1 1 0 0 1 -1 1 1 ," 66 | "Permute 293 1 1 292 293 4 0 2 3 1 ," 67 | "Reshape 303 1 1 293 303 0 4 4 0 -1 4 1 ," 68 | "Convolution 304 1 1 275 304 128 1 128 3 3 2 2 1 1 1 -1 1 1 ," 69 | "ReLU 306 1 1 304 306 ," 70 | "Convolution 307 1 1 306 307 1 128 256 1 1 1 1 0 0 1 -1 1 1 ," 71 | "ReLU 309 1 1 307 309 ," 72 | "Convolution 310 1 1 309 310 256 1 256 3 3 1 1 1 1 1 -1 1 1 ," 73 | "ReLU 312 1 1 310 312 ," 74 | "Convolution 313 1 1 312 313 1 256 256 1 1 1 1 0 0 1 -1 1 1 ," 75 | "ReLU 315 1 1 313 315 ," 76 | "Convolution 316 1 1 315 316 256 1 256 3 3 1 1 1 1 1 -1 1 1 ," 77 | "ReLU 317 1 1 316 317 ," 78 | "Convolution 318 1 1 317 318 1 256 4 1 1 1 1 0 0 1 -1 1 1 ," 79 | "Permute 319 1 1 318 319 4 0 2 3 1 ," 80 | "Reshape 329 1 1 319 329 0 4 4 0 -1 2 1 ," 81 | "Convolution 330 1 1 315 330 256 1 256 3 3 1 1 1 1 1 -1 1 1 ," 82 | "ReLU 331 1 1 330 331 ," 83 | "Convolution 332 1 1 331 332 1 256 8 1 1 1 1 0 0 1 -1 1 1 ," 84 | "Permute 333 1 1 332 333 4 0 2 3 1 ," 85 | "Reshape 343 1 1 333 343 0 4 4 0 -1 4 1 ," 86 | "Convolution 344 1 1 315 344 1 256 64 1 1 1 1 0 0 1 -1 1 1 ," 87 | "ReLU 345 1 1 344 345 ," 88 | "Convolution 346 1 1 345 346 64 1 64 3 3 2 2 1 1 1 -1 1 1 ," 89 | "ReLU 347 1 1 346 347 ," 90 | "Convolution 348 1 1 347 348 1 64 256 1 1 1 1 0 0 1 -1 1 1 ," 91 | "ReLU 349 1 1 348 349 ," 92 | "Convolution 350 1 1 349 350 1 256 6 3 3 1 1 1 1 1 -1 1 1 ," 93 | "Permute 351 1 1 350 351 4 0 2 3 1 ," 94 | "Reshape 361 1 1 351 361 0 4 4 0 -1 2 1 ," 95 | "Convolution 362 1 1 349 362 1 256 12 3 3 1 1 1 1 1 -1 1 1 ," 96 | "Permute 363 1 1 362 363 4 0 2 3 1 ," 97 | "Reshape 373 1 1 363 373 0 4 4 0 -1 4 1 ," 98 | "Concat 374 4 1 243 289 329 361 374 1 ," 99 | "Concat boxes 4 1 257 303 343 373 boxes 1 ," 100 | "SoftmaxCaffe scores 1 1 374 scores 2 ," 101 | -------------------------------------------------------------------------------- /model/face-detector/version-slim-320_simplified.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:16dcc886ac4a7573475d1a39450420ff4cdbedc13f5ed7a11417cebe2a1dc82b 3 | size 1034234 4 | -------------------------------------------------------------------------------- /model/face-detector/version-slim-320_simplified.tnnproto: -------------------------------------------------------------------------------- 1 | "1 96 1 4206624770 ," 2 | "input 1 3 240 320 ," 3 | " 185 187 188 190 191 193 194 196 197 199 200 202 203 205 206 208 209 211 212 214 215 217 218 220 221 223 224 226 227 229 230 231 232 233 243 244 245 246 247 257 258 260 261 263 264 266 267 269 270 272 273 275 276 277 278 279 289 290 291 292 293 303 304 306 307 309 310 312 313 315 316 317 318 319 329 330 331 332 333 343 344 345 346 347 348 349 350 351 361 362 363 373 374 boxes input scores ," 4 | "scores boxes ," 5 | " 95 ," 6 | "Convolution 185 1 1 input 185 1 3 16 3 3 2 2 1 1 1 -1 1 1 ," 7 | "ReLU 187 1 1 185 187 ," 8 | "Convolution 188 1 1 187 188 16 1 16 3 3 1 1 1 1 1 -1 1 1 ," 9 | "ReLU 190 1 1 188 190 ," 10 | "Convolution 191 1 1 190 191 1 16 32 1 1 1 1 0 0 1 -1 1 1 ," 11 | "ReLU 193 1 1 191 193 ," 12 | "Convolution 194 1 1 193 194 32 1 32 3 3 2 2 1 1 1 -1 1 1 ," 13 | "ReLU 196 1 1 194 196 ," 14 | "Convolution 197 1 1 196 197 1 32 32 1 1 1 1 0 0 1 -1 1 1 ," 15 | "ReLU 199 1 1 197 199 ," 16 | "Convolution 200 1 1 199 200 32 1 32 3 3 1 1 1 1 1 -1 1 1 ," 17 | "ReLU 202 1 1 200 202 ," 18 | "Convolution 203 1 1 202 203 1 32 32 1 1 1 1 0 0 1 -1 1 1 ," 19 | "ReLU 205 1 1 203 205 ," 20 | "Convolution 206 1 1 205 206 32 1 32 3 3 2 2 1 1 1 -1 1 1 ," 21 | "ReLU 208 1 1 206 208 ," 22 | "Convolution 209 1 1 208 209 1 32 64 1 1 1 1 0 0 1 -1 1 1 ," 23 | "ReLU 211 1 1 209 211 ," 24 | "Convolution 212 1 1 211 212 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 25 | "ReLU 214 1 1 212 214 ," 26 | "Convolution 215 1 1 214 215 1 64 64 1 1 1 1 0 0 1 -1 1 1 ," 27 | "ReLU 217 1 1 215 217 ," 28 | "Convolution 218 1 1 217 218 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 29 | "ReLU 220 1 1 218 220 ," 30 | "Convolution 221 1 1 220 221 1 64 64 1 1 1 1 0 0 1 -1 1 1 ," 31 | "ReLU 223 1 1 221 223 ," 32 | "Convolution 224 1 1 223 224 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 33 | "ReLU 226 1 1 224 226 ," 34 | "Convolution 227 1 1 226 227 1 64 64 1 1 1 1 0 0 1 -1 1 1 ," 35 | "ReLU 229 1 1 227 229 ," 36 | "Convolution 230 1 1 229 230 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 37 | "ReLU 231 1 1 230 231 ," 38 | "Convolution 232 1 1 231 232 1 64 6 1 1 1 1 0 0 1 -1 1 1 ," 39 | "Permute 233 1 1 232 233 4 0 2 3 1 ," 40 | "Reshape 243 1 1 233 243 0 4 4 0 -1 2 1 ," 41 | "Convolution 244 1 1 229 244 64 1 64 3 3 1 1 1 1 1 -1 1 1 ," 42 | "ReLU 245 1 1 244 245 ," 43 | "Convolution 246 1 1 245 246 1 64 12 1 1 1 1 0 0 1 -1 1 1 ," 44 | "Permute 247 1 1 246 247 4 0 2 3 1 ," 45 | "Reshape 257 1 1 247 257 0 4 4 0 -1 4 1 ," 46 | "Convolution 258 1 1 229 258 64 1 64 3 3 2 2 1 1 1 -1 1 1 ," 47 | "ReLU 260 1 1 258 260 ," 48 | "Convolution 261 1 1 260 261 1 64 128 1 1 1 1 0 0 1 -1 1 1 ," 49 | "ReLU 263 1 1 261 263 ," 50 | "Convolution 264 1 1 263 264 128 1 128 3 3 1 1 1 1 1 -1 1 1 ," 51 | "ReLU 266 1 1 264 266 ," 52 | "Convolution 267 1 1 266 267 1 128 128 1 1 1 1 0 0 1 -1 1 1 ," 53 | "ReLU 269 1 1 267 269 ," 54 | "Convolution 270 1 1 269 270 128 1 128 3 3 1 1 1 1 1 -1 1 1 ," 55 | "ReLU 272 1 1 270 272 ," 56 | "Convolution 273 1 1 272 273 1 128 128 1 1 1 1 0 0 1 -1 1 1 ," 57 | "ReLU 275 1 1 273 275 ," 58 | "Convolution 276 1 1 275 276 128 1 128 3 3 1 1 1 1 1 -1 1 1 ," 59 | "ReLU 277 1 1 276 277 ," 60 | "Convolution 278 1 1 277 278 1 128 4 1 1 1 1 0 0 1 -1 1 1 ," 61 | "Permute 279 1 1 278 279 4 0 2 3 1 ," 62 | "Reshape 289 1 1 279 289 0 4 4 0 -1 2 1 ," 63 | "Convolution 290 1 1 275 290 128 1 128 3 3 1 1 1 1 1 -1 1 1 ," 64 | "ReLU 291 1 1 290 291 ," 65 | "Convolution 292 1 1 291 292 1 128 8 1 1 1 1 0 0 1 -1 1 1 ," 66 | "Permute 293 1 1 292 293 4 0 2 3 1 ," 67 | "Reshape 303 1 1 293 303 0 4 4 0 -1 4 1 ," 68 | "Convolution 304 1 1 275 304 128 1 128 3 3 2 2 1 1 1 -1 1 1 ," 69 | "ReLU 306 1 1 304 306 ," 70 | "Convolution 307 1 1 306 307 1 128 256 1 1 1 1 0 0 1 -1 1 1 ," 71 | "ReLU 309 1 1 307 309 ," 72 | "Convolution 310 1 1 309 310 256 1 256 3 3 1 1 1 1 1 -1 1 1 ," 73 | "ReLU 312 1 1 310 312 ," 74 | "Convolution 313 1 1 312 313 1 256 256 1 1 1 1 0 0 1 -1 1 1 ," 75 | "ReLU 315 1 1 313 315 ," 76 | "Convolution 316 1 1 315 316 256 1 256 3 3 1 1 1 1 1 -1 1 1 ," 77 | "ReLU 317 1 1 316 317 ," 78 | "Convolution 318 1 1 317 318 1 256 4 1 1 1 1 0 0 1 -1 1 1 ," 79 | "Permute 319 1 1 318 319 4 0 2 3 1 ," 80 | "Reshape 329 1 1 319 329 0 4 4 0 -1 2 1 ," 81 | "Convolution 330 1 1 315 330 256 1 256 3 3 1 1 1 1 1 -1 1 1 ," 82 | "ReLU 331 1 1 330 331 ," 83 | "Convolution 332 1 1 331 332 1 256 8 1 1 1 1 0 0 1 -1 1 1 ," 84 | "Permute 333 1 1 332 333 4 0 2 3 1 ," 85 | "Reshape 343 1 1 333 343 0 4 4 0 -1 4 1 ," 86 | "Convolution 344 1 1 315 344 1 256 64 1 1 1 1 0 0 1 -1 1 1 ," 87 | "ReLU 345 1 1 344 345 ," 88 | "Convolution 346 1 1 345 346 64 1 64 3 3 2 2 1 1 1 -1 1 1 ," 89 | "ReLU 347 1 1 346 347 ," 90 | "Convolution 348 1 1 347 348 1 64 256 1 1 1 1 0 0 1 -1 1 1 ," 91 | "ReLU 349 1 1 348 349 ," 92 | "Convolution 350 1 1 349 350 1 256 6 3 3 1 1 1 1 1 -1 1 1 ," 93 | "Permute 351 1 1 350 351 4 0 2 3 1 ," 94 | "Reshape 361 1 1 351 361 0 4 4 0 -1 2 1 ," 95 | "Convolution 362 1 1 349 362 1 256 12 3 3 1 1 1 1 1 -1 1 1 ," 96 | "Permute 363 1 1 362 363 4 0 2 3 1 ," 97 | "Reshape 373 1 1 363 373 0 4 4 0 -1 4 1 ," 98 | "Concat 374 4 1 243 289 329 361 374 1 ," 99 | "Concat boxes 4 1 257 303 343 373 boxes 1 ," 100 | "SoftmaxCaffe scores 1 1 374 scores 2 ," 101 | -------------------------------------------------------------------------------- /model/face_mesh/face_mesh.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b3b671574b9e595cf0c86d86b6a0bc79d08fdde8f7f2826ec14468dc2881afb6 3 | size 2423580 4 | -------------------------------------------------------------------------------- /model/face_mesh/face_mesh.tnnproto: -------------------------------------------------------------------------------- 1 | "1 0 1 4206624770 ," 2 | "input_1 1 3 192 192 ," 3 | " ," 4 | "conv2d_20 conv2d_30 ," 5 | " 97 ," 6 | "Convolution conv2d 1 1 input_1 conv2d 1 3 16 3 3 2 2 0 0 1 0 1 1 0 ," 7 | "PReLU p_re_lu 1 1 conv2d p_re_lu 0 0 ," 8 | "Convolution depthwise_conv2d 1 1 p_re_lu depthwise_conv2d 16 16 16 3 3 1 1 0 0 1 0 1 1 0 ," 9 | "Convolution conv2d_1 1 1 depthwise_conv2d conv2d_1 1 16 16 1 1 1 1 0 0 1 -1 1 1 0 ," 10 | "Add add 2 1 p_re_lu conv2d_1 add -1 ," 11 | "PReLU p_re_lu_1 1 1 add p_re_lu_1 0 0 ," 12 | "Convolution depthwise_conv2d_1 1 1 p_re_lu_1 depthwise_conv2d_1 16 16 16 3 3 1 1 0 0 1 0 1 1 0 ," 13 | "Convolution conv2d_2 1 1 depthwise_conv2d_1 conv2d_2 1 16 16 1 1 1 1 0 0 1 -1 1 1 0 ," 14 | "Add add_1 2 1 p_re_lu_1 conv2d_2 add_1 -1 ," 15 | "PReLU p_re_lu_2 1 1 add_1 p_re_lu_2 0 0 ," 16 | "Convolution depthwise_conv2d_2 1 1 p_re_lu_2 depthwise_conv2d_2 16 16 16 3 3 2 2 0 0 1 0 1 1 0 ," 17 | "Pooling max_pooling2d 1 1 p_re_lu_2 max_pooling2d 0 2 2 2 2 0 0 -1 -1 1 1 ," 18 | "Convolution conv2d_3 1 1 depthwise_conv2d_2 conv2d_3 1 16 32 1 1 1 1 0 0 1 -1 1 1 0 ," 19 | "Pad channel_padding 1 1 max_pooling2d channel_padding 0 0 0 0 0 0 0 16 0 ," 20 | "Add add_2 2 1 channel_padding conv2d_3 add_2 -1 ," 21 | "PReLU p_re_lu_3 1 1 add_2 p_re_lu_3 0 0 ," 22 | "Convolution depthwise_conv2d_3 1 1 p_re_lu_3 depthwise_conv2d_3 32 32 32 3 3 1 1 0 0 1 0 1 1 0 ," 23 | "Convolution conv2d_4 1 1 depthwise_conv2d_3 conv2d_4 1 32 32 1 1 1 1 0 0 1 -1 1 1 0 ," 24 | "Add add_3 2 1 p_re_lu_3 conv2d_4 add_3 -1 ," 25 | "PReLU p_re_lu_4 1 1 add_3 p_re_lu_4 0 0 ," 26 | "Convolution depthwise_conv2d_4 1 1 p_re_lu_4 depthwise_conv2d_4 32 32 32 3 3 1 1 0 0 1 0 1 1 0 ," 27 | "Convolution conv2d_5 1 1 depthwise_conv2d_4 conv2d_5 1 32 32 1 1 1 1 0 0 1 -1 1 1 0 ," 28 | "Add add_4 2 1 p_re_lu_4 conv2d_5 add_4 -1 ," 29 | "PReLU p_re_lu_5 1 1 add_4 p_re_lu_5 0 0 ," 30 | "Convolution depthwise_conv2d_5 1 1 p_re_lu_5 depthwise_conv2d_5 32 32 32 3 3 2 2 0 0 1 0 1 1 0 ," 31 | "Pooling max_pooling2d_1 1 1 p_re_lu_5 max_pooling2d_1 0 2 2 2 2 0 0 -1 -1 1 1 ," 32 | "Convolution conv2d_6 1 1 depthwise_conv2d_5 conv2d_6 1 32 64 1 1 1 1 0 0 1 -1 1 1 0 ," 33 | "Pad channel_padding_1 1 1 max_pooling2d_1 channel_padding_1 0 0 0 0 0 0 0 32 0 ," 34 | "Add add_5 2 1 channel_padding_1 conv2d_6 add_5 -1 ," 35 | "PReLU p_re_lu_6 1 1 add_5 p_re_lu_6 0 0 ," 36 | "Convolution depthwise_conv2d_6 1 1 p_re_lu_6 depthwise_conv2d_6 64 64 64 3 3 1 1 0 0 1 0 1 1 0 ," 37 | "Convolution conv2d_7 1 1 depthwise_conv2d_6 conv2d_7 1 64 64 1 1 1 1 0 0 1 -1 1 1 0 ," 38 | "Add add_6 2 1 p_re_lu_6 conv2d_7 add_6 -1 ," 39 | "PReLU p_re_lu_7 1 1 add_6 p_re_lu_7 0 0 ," 40 | "Convolution depthwise_conv2d_7 1 1 p_re_lu_7 depthwise_conv2d_7 64 64 64 3 3 1 1 0 0 1 0 1 1 0 ," 41 | "Convolution conv2d_8 1 1 depthwise_conv2d_7 conv2d_8 1 64 64 1 1 1 1 0 0 1 -1 1 1 0 ," 42 | "Add add_7 2 1 p_re_lu_7 conv2d_8 add_7 -1 ," 43 | "PReLU p_re_lu_8 1 1 add_7 p_re_lu_8 0 0 ," 44 | "Convolution depthwise_conv2d_8 1 1 p_re_lu_8 depthwise_conv2d_8 64 64 64 3 3 2 2 0 0 1 0 1 1 0 ," 45 | "Pooling max_pooling2d_2 1 1 p_re_lu_8 max_pooling2d_2 0 2 2 2 2 0 0 -1 -1 1 1 ," 46 | "Convolution conv2d_9 1 1 depthwise_conv2d_8 conv2d_9 1 64 128 1 1 1 1 0 0 1 -1 1 1 0 ," 47 | "Pad channel_padding_2 1 1 max_pooling2d_2 channel_padding_2 0 0 0 0 0 0 0 64 0 ," 48 | "Add add_8 2 1 channel_padding_2 conv2d_9 add_8 -1 ," 49 | "PReLU p_re_lu_9 1 1 add_8 p_re_lu_9 0 0 ," 50 | "Convolution depthwise_conv2d_9 1 1 p_re_lu_9 depthwise_conv2d_9 128 128 128 3 3 1 1 0 0 1 0 1 1 0 ," 51 | "Convolution conv2d_10 1 1 depthwise_conv2d_9 conv2d_10 1 128 128 1 1 1 1 0 0 1 -1 1 1 0 ," 52 | "Add add_9 2 1 p_re_lu_9 conv2d_10 add_9 -1 ," 53 | "PReLU p_re_lu_10 1 1 add_9 p_re_lu_10 0 0 ," 54 | "Convolution depthwise_conv2d_10 1 1 p_re_lu_10 depthwise_conv2d_10 128 128 128 3 3 1 1 0 0 1 0 1 1 0 ," 55 | "Convolution conv2d_11 1 1 depthwise_conv2d_10 conv2d_11 1 128 128 1 1 1 1 0 0 1 -1 1 1 0 ," 56 | "Add add_10 2 1 p_re_lu_10 conv2d_11 add_10 -1 ," 57 | "PReLU p_re_lu_11 1 1 add_10 p_re_lu_11 0 0 ," 58 | "Convolution depthwise_conv2d_11 1 1 p_re_lu_11 depthwise_conv2d_11 128 128 128 3 3 2 2 0 0 1 0 1 1 0 ," 59 | "Convolution conv2d_12 1 1 depthwise_conv2d_11 conv2d_12 1 128 128 1 1 1 1 0 0 1 -1 1 1 0 ," 60 | "Pooling max_pooling2d_3 1 1 p_re_lu_11 max_pooling2d_3 0 2 2 2 2 0 0 -1 -1 1 1 ," 61 | "Add add_11 2 1 max_pooling2d_3 conv2d_12 add_11 -1 ," 62 | "PReLU p_re_lu_12 1 1 add_11 p_re_lu_12 0 0 ," 63 | "Convolution depthwise_conv2d_12 1 1 p_re_lu_12 depthwise_conv2d_12 128 128 128 3 3 1 1 0 0 1 0 1 1 0 ," 64 | "Convolution conv2d_13 1 1 depthwise_conv2d_12 conv2d_13 1 128 128 1 1 1 1 0 0 1 -1 1 1 0 ," 65 | "Add add_12 2 1 p_re_lu_12 conv2d_13 add_12 -1 ," 66 | "PReLU p_re_lu_13 1 1 add_12 p_re_lu_13 0 0 ," 67 | "Convolution depthwise_conv2d_13 1 1 p_re_lu_13 depthwise_conv2d_13 128 128 128 3 3 1 1 0 0 1 0 1 1 0 ," 68 | "Convolution conv2d_14 1 1 depthwise_conv2d_13 conv2d_14 1 128 128 1 1 1 1 0 0 1 -1 1 1 0 ," 69 | "Add add_13 2 1 p_re_lu_13 conv2d_14 add_13 -1 ," 70 | "PReLU p_re_lu_14 1 1 add_13 p_re_lu_14 0 0 ," 71 | "Convolution depthwise_conv2d_14 1 1 p_re_lu_14 depthwise_conv2d_14 128 128 128 3 3 2 2 0 0 1 0 1 1 0 ," 72 | "Convolution conv2d_15 1 1 depthwise_conv2d_14 conv2d_15 1 128 128 1 1 1 1 0 0 1 -1 1 1 0 ," 73 | "Pooling max_pooling2d_4 1 1 p_re_lu_14 max_pooling2d_4 0 2 2 2 2 0 0 -1 -1 1 1 ," 74 | "Add add_14 2 1 max_pooling2d_4 conv2d_15 add_14 -1 ," 75 | "PReLU p_re_lu_15 1 1 add_14 p_re_lu_15 0 0 ," 76 | "Convolution depthwise_conv2d_15 1 1 p_re_lu_15 depthwise_conv2d_15 128 128 128 3 3 1 1 0 0 1 0 1 1 0 ," 77 | "Convolution conv2d_16 1 1 depthwise_conv2d_15 conv2d_16 1 128 128 1 1 1 1 0 0 1 -1 1 1 0 ," 78 | "Add add_15 2 1 p_re_lu_15 conv2d_16 add_15 -1 ," 79 | "PReLU p_re_lu_16 1 1 add_15 p_re_lu_16 0 0 ," 80 | "Convolution depthwise_conv2d_22 1 1 p_re_lu_14 depthwise_conv2d_22 128 128 128 3 3 2 2 0 0 1 0 1 1 0 ," 81 | "Convolution depthwise_conv2d_16 1 1 p_re_lu_16 depthwise_conv2d_16 128 128 128 3 3 1 1 0 0 1 0 1 1 0 ," 82 | "Convolution conv2d_27 1 1 depthwise_conv2d_22 conv2d_27 1 128 128 1 1 1 1 0 0 1 -1 1 1 0 ," 83 | "Convolution conv2d_17 1 1 depthwise_conv2d_16 conv2d_17 1 128 128 1 1 1 1 0 0 1 -1 1 1 0 ," 84 | "Pooling max_pooling2d_6 1 1 p_re_lu_14 max_pooling2d_6 0 2 2 2 2 0 0 -1 -1 1 1 ," 85 | "Add add_22 2 1 max_pooling2d_6 conv2d_27 add_22 -1 ," 86 | "Add add_16 2 1 p_re_lu_16 conv2d_17 add_16 -1 ," 87 | "PReLU p_re_lu_25 1 1 add_22 p_re_lu_25 0 0 ," 88 | "PReLU p_re_lu_17 1 1 add_16 p_re_lu_17 0 0 ," 89 | "Convolution conv2d_28 1 1 p_re_lu_25 conv2d_28 1 128 32 1 1 1 1 0 0 1 -1 1 1 0 ," 90 | "Convolution conv2d_18 1 1 p_re_lu_17 conv2d_18 1 128 32 1 1 1 1 0 0 1 -1 1 1 0 ," 91 | "PReLU p_re_lu_26 1 1 conv2d_28 p_re_lu_26 0 0 ," 92 | "PReLU p_re_lu_18 1 1 conv2d_18 p_re_lu_18 0 0 ," 93 | "Convolution depthwise_conv2d_23 1 1 p_re_lu_26 depthwise_conv2d_23 32 32 32 3 3 1 1 0 0 1 0 1 1 0 ," 94 | "Convolution depthwise_conv2d_17 1 1 p_re_lu_18 depthwise_conv2d_17 32 32 32 3 3 1 1 0 0 1 0 1 1 0 ," 95 | "Convolution conv2d_29 1 1 depthwise_conv2d_23 conv2d_29 1 32 32 1 1 1 1 0 0 1 -1 1 1 0 ," 96 | "Convolution conv2d_19 1 1 depthwise_conv2d_17 conv2d_19 1 32 32 1 1 1 1 0 0 1 -1 1 1 0 ," 97 | "Add add_23 2 1 p_re_lu_26 conv2d_29 add_23 -1 ," 98 | "Add add_17 2 1 p_re_lu_18 conv2d_19 add_17 -1 ," 99 | "PReLU p_re_lu_27 1 1 add_23 p_re_lu_27 0 0 ," 100 | "PReLU p_re_lu_19 1 1 add_17 p_re_lu_19 0 0 ," 101 | "Convolution conv2d_30 1 1 p_re_lu_27 conv2d_30 1 32 1 3 3 3 3 0 0 1 -1 1 1 0 ," 102 | "Convolution conv2d_20 1 1 p_re_lu_19 conv2d_20 1 32 1404 3 3 3 3 0 0 1 -1 1 1 0 ," 103 | -------------------------------------------------------------------------------- /model/gray_transfer/G_8_GRAY2RGB_256.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:862baec2421d316066bfd2e8f4a13a5d27312ae3816fca6cb79874af478d0976 3 | size 17078300 4 | -------------------------------------------------------------------------------- /model/hair_segmentation/segmentation.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:762aaf187ba437188af95dadaac34fddcc5bd42828bf7a452ae9a65151014909 3 | size 854598 4 | -------------------------------------------------------------------------------- /model/hair_segmentation/segmentation.tnnproto: -------------------------------------------------------------------------------- 1 | "1 155 1 4206624770 ," 2 | "input_array 1 3 256 256 ," 3 | " 541 542 544 545 547 548 550 551 553 555 556 558 559 561 562 564 565 567 568 570 572 573 575 576 578 579 581 582 584 585 587 588 590 591 593 594 596 597 599 600 602 603 605 607 608 610 611 613 614 616 617 619 620 622 623 625 626 628 629 631 633 634 636 637 639 640 642 643 645 646 648 650 651 653 654 656 657 659 660 662 663 665 666 668 669 671 672 674 675 677 678 680 681 683 684 686 687 689 690 692 693 695 696 698 699 701 702 704 705 707 708 710 711 713 714 716 717 719 721 722 724 725 727 729 730 731 733 734 736 737 738 740 741 742 744 745 746 747 749 750 751 753 754 755 756 758 759 760 762 763 765 766 767 input_array output_array background foreground ," 4 | "background foreground ," 5 | " 156 ," 6 | "Convolution 541 1 1 input_array 541 1 3 8 3 3 2 2 1 1 1 -1 1 1 ," 7 | "ReLU 542 1 1 541 542 ," 8 | "Convolution 544 1 1 542 544 1 8 4 3 3 1 1 1 1 1 -1 1 1 ," 9 | "ReLU 545 1 1 544 545 ," 10 | "Convolution 547 1 1 545 547 1 4 12 1 1 1 1 0 0 1 -1 1 1 ," 11 | "ReLU 548 1 1 547 548 ," 12 | "Convolution 550 1 1 548 550 12 1 12 3 3 2 2 1 1 1 -1 1 1 ," 13 | "ReLU 551 1 1 550 551 ," 14 | "Convolution 553 1 1 551 553 1 12 6 1 1 1 1 0 0 1 -1 1 1 ," 15 | "Convolution 555 1 1 553 555 1 6 18 1 1 1 1 0 0 1 -1 1 1 ," 16 | "ReLU 556 1 1 555 556 ," 17 | "Convolution 558 1 1 556 558 18 1 18 3 3 1 1 1 1 1 -1 1 1 ," 18 | "ReLU 559 1 1 558 559 ," 19 | "Convolution 561 1 1 559 561 1 18 6 1 1 1 1 0 0 1 -1 1 1 ," 20 | "Add 562 2 1 561 553 562 ," 21 | "Convolution 564 1 1 562 564 1 6 18 1 1 1 1 0 0 1 -1 1 1 ," 22 | "ReLU 565 1 1 564 565 ," 23 | "Convolution 567 1 1 565 567 18 1 18 3 3 2 2 1 1 1 -1 1 1 ," 24 | "ReLU 568 1 1 567 568 ," 25 | "Convolution 570 1 1 568 570 1 18 10 1 1 1 1 0 0 1 -1 1 1 ," 26 | "Convolution 572 1 1 570 572 1 10 30 1 1 1 1 0 0 1 -1 1 1 ," 27 | "ReLU 573 1 1 572 573 ," 28 | "Convolution 575 1 1 573 575 30 1 30 3 3 1 1 1 1 1 -1 1 1 ," 29 | "ReLU 576 1 1 575 576 ," 30 | "Convolution 578 1 1 576 578 1 30 10 1 1 1 1 0 0 1 -1 1 1 ," 31 | "Add 579 2 1 578 570 579 ," 32 | "Convolution 581 1 1 579 581 1 10 30 1 1 1 1 0 0 1 -1 1 1 ," 33 | "ReLU 582 1 1 581 582 ," 34 | "Convolution 584 1 1 582 584 30 1 30 3 3 1 1 1 1 1 -1 1 1 ," 35 | "ReLU 585 1 1 584 585 ," 36 | "Convolution 587 1 1 585 587 1 30 10 1 1 1 1 0 0 1 -1 1 1 ," 37 | "Add 588 2 1 587 579 588 ," 38 | "Convolution 590 1 1 588 590 1 10 30 1 1 1 1 0 0 1 -1 1 1 ," 39 | "ReLU 591 1 1 590 591 ," 40 | "Convolution 593 1 1 591 593 30 1 30 3 3 1 1 1 1 1 -1 1 1 ," 41 | "ReLU 594 1 1 593 594 ," 42 | "Convolution 596 1 1 594 596 1 30 10 1 1 1 1 0 0 1 -1 1 1 ," 43 | "Add 597 2 1 596 588 597 ," 44 | "Convolution 599 1 1 597 599 1 10 60 1 1 1 1 0 0 1 -1 1 1 ," 45 | "ReLU 600 1 1 599 600 ," 46 | "Convolution 602 1 1 600 602 60 1 60 3 3 2 2 1 1 1 -1 1 1 ," 47 | "ReLU 603 1 1 602 603 ," 48 | "Convolution 605 1 1 603 605 1 60 20 1 1 1 1 0 0 1 -1 1 1 ," 49 | "Convolution 607 1 1 605 607 1 20 120 1 1 1 1 0 0 1 -1 1 1 ," 50 | "ReLU 608 1 1 607 608 ," 51 | "Convolution 610 1 1 608 610 120 1 120 3 3 1 1 1 1 1 -1 1 1 ," 52 | "ReLU 611 1 1 610 611 ," 53 | "Convolution 613 1 1 611 613 1 120 20 1 1 1 1 0 0 1 -1 1 1 ," 54 | "Add 614 2 1 613 605 614 ," 55 | "Convolution 616 1 1 614 616 1 20 120 1 1 1 1 0 0 1 -1 1 1 ," 56 | "ReLU 617 1 1 616 617 ," 57 | "Convolution 619 1 1 617 619 120 1 120 3 3 1 1 1 1 1 -1 1 1 ," 58 | "ReLU 620 1 1 619 620 ," 59 | "Convolution 622 1 1 620 622 1 120 20 1 1 1 1 0 0 1 -1 1 1 ," 60 | "Add 623 2 1 622 614 623 ," 61 | "Convolution 625 1 1 623 625 1 20 120 1 1 1 1 0 0 1 -1 1 1 ," 62 | "ReLU 626 1 1 625 626 ," 63 | "Convolution 628 1 1 626 628 120 1 120 3 3 1 1 1 1 1 -1 1 1 ," 64 | "ReLU 629 1 1 628 629 ," 65 | "Convolution 631 1 1 629 631 1 120 24 1 1 1 1 0 0 1 -1 1 1 ," 66 | "Convolution 633 1 1 631 633 1 24 144 1 1 1 1 0 0 1 -1 1 1 ," 67 | "ReLU 634 1 1 633 634 ," 68 | "Convolution 636 1 1 634 636 144 1 144 3 3 1 1 1 1 1 -1 1 1 ," 69 | "ReLU 637 1 1 636 637 ," 70 | "Convolution 639 1 1 637 639 1 144 24 1 1 1 1 0 0 1 -1 1 1 ," 71 | "Add 640 2 1 639 631 640 ," 72 | "Convolution 642 1 1 640 642 1 24 144 1 1 1 1 0 0 1 -1 1 1 ," 73 | "ReLU 643 1 1 642 643 ," 74 | "Convolution 645 1 1 643 645 144 1 144 3 3 2 2 1 1 1 -1 1 1 ," 75 | "ReLU 646 1 1 645 646 ," 76 | "Convolution 648 1 1 646 648 1 144 32 1 1 1 1 0 0 1 -1 1 1 ," 77 | "Convolution 650 1 1 648 650 1 32 192 1 1 1 1 0 0 1 -1 1 1 ," 78 | "ReLU 651 1 1 650 651 ," 79 | "Convolution 653 1 1 651 653 192 1 192 3 3 1 1 1 1 1 -1 1 1 ," 80 | "ReLU 654 1 1 653 654 ," 81 | "Convolution 656 1 1 654 656 1 192 32 1 1 1 1 0 0 1 -1 1 1 ," 82 | "Add 657 2 1 656 648 657 ," 83 | "Convolution 659 1 1 657 659 1 32 192 1 1 1 1 0 0 1 -1 1 1 ," 84 | "ReLU 660 1 1 659 660 ," 85 | "Convolution 662 1 1 660 662 192 1 192 3 3 1 1 1 1 1 -1 1 1 ," 86 | "ReLU 663 1 1 662 663 ," 87 | "Convolution 665 1 1 663 665 1 192 32 1 1 1 1 0 0 1 -1 1 1 ," 88 | "Add 666 2 1 665 657 666 ," 89 | "Convolution 668 1 1 666 668 1 32 192 1 1 1 1 0 0 1 -1 1 1 ," 90 | "ReLU 669 1 1 668 669 ," 91 | "Convolution 671 1 1 669 671 192 1 192 3 3 1 1 1 1 1 -1 1 1 ," 92 | "ReLU 672 1 1 671 672 ," 93 | "Convolution 674 1 1 672 674 1 192 32 1 1 1 1 0 0 1 -1 1 1 ," 94 | "Add 675 2 1 674 666 675 ," 95 | "Convolution 677 1 1 675 677 1 32 192 1 1 1 1 0 0 1 -1 1 1 ," 96 | "ReLU 678 1 1 677 678 ," 97 | "Convolution 680 1 1 678 680 192 1 192 3 3 1 1 1 1 1 -1 1 1 ," 98 | "ReLU 681 1 1 680 681 ," 99 | "Convolution 683 1 1 681 683 1 192 32 1 1 1 1 0 0 1 -1 1 1 ," 100 | "Add 684 2 1 683 675 684 ," 101 | "Convolution 686 1 1 684 686 1 32 192 1 1 1 1 0 0 1 -1 1 1 ," 102 | "ReLU 687 1 1 686 687 ," 103 | "Convolution 689 1 1 687 689 192 1 192 3 3 1 1 1 1 1 -1 1 1 ," 104 | "ReLU 690 1 1 689 690 ," 105 | "Convolution 692 1 1 690 692 1 192 32 1 1 1 1 0 0 1 -1 1 1 ," 106 | "Add 693 2 1 692 684 693 ," 107 | "Convolution 695 1 1 693 695 1 32 192 1 1 1 1 0 0 1 -1 1 1 ," 108 | "ReLU 696 1 1 695 696 ," 109 | "Convolution 698 1 1 696 698 192 1 192 3 3 1 1 1 1 1 -1 1 1 ," 110 | "ReLU 699 1 1 698 699 ," 111 | "Convolution 701 1 1 699 701 1 192 32 1 1 1 1 0 0 1 -1 1 1 ," 112 | "Add 702 2 1 701 693 702 ," 113 | "Convolution 704 1 1 702 704 1 32 192 1 1 1 1 0 0 1 -1 1 1 ," 114 | "ReLU 705 1 1 704 705 ," 115 | "Convolution 707 1 1 705 707 192 1 192 3 3 1 1 1 1 1 -1 1 1 ," 116 | "ReLU 708 1 1 707 708 ," 117 | "Convolution 710 1 1 708 710 1 192 32 1 1 1 1 0 0 1 -1 1 1 ," 118 | "Add 711 2 1 710 702 711 ," 119 | "Convolution 713 1 1 711 713 1 32 192 1 1 1 1 0 0 1 -1 1 1 ," 120 | "ReLU 714 1 1 713 714 ," 121 | "Convolution 716 1 1 714 716 192 1 192 3 3 1 1 1 1 1 -1 1 1 ," 122 | "ReLU 717 1 1 716 717 ," 123 | "Convolution 719 1 1 717 719 1 192 48 1 1 1 1 0 0 1 -1 1 1 ," 124 | "Convolution 721 1 1 719 721 1 48 288 1 1 1 1 0 0 1 -1 1 1 ," 125 | "ReLU 722 1 1 721 722 ," 126 | "Convolution 724 1 1 722 724 288 1 288 3 3 1 1 1 1 1 -1 1 1 ," 127 | "ReLU 725 1 1 724 725 ," 128 | "Convolution 727 1 1 725 727 1 288 80 1 1 1 1 0 0 1 -1 1 1 ," 129 | "Convolution 729 1 1 727 729 1 80 48 1 1 1 1 0 0 1 -1 1 1 ," 130 | "ReLU 730 1 1 729 730 ," 131 | "Add 731 2 1 719 730 731 ," 132 | "Convolution 733 1 1 731 733 1 48 48 1 1 1 1 0 0 1 -1 1 1 ," 133 | "ReLU 734 1 1 733 734 ," 134 | "Convolution 736 1 1 734 736 1 48 20 1 1 1 1 0 0 1 -1 1 1 ," 135 | "ReLU 737 1 1 736 737 ," 136 | "Convolution 738 1 1 623 738 1 20 20 1 1 1 1 0 0 1 -1 1 1 ," 137 | "Deconvolution 740 1 1 737 740 20 1 20 4 4 2 2 1 1 1 -1 1 1 ," 138 | "ReLU 741 1 1 740 741 ," 139 | "Add 742 2 1 738 741 742 ," 140 | "Convolution 744 1 1 742 744 1 20 20 1 1 1 1 0 0 1 -1 1 1 ," 141 | "ReLU 745 1 1 744 745 ," 142 | "Convolution 746 1 1 745 746 1 20 10 1 1 1 1 0 0 1 -1 1 1 ," 143 | "Convolution 747 1 1 588 747 1 10 10 1 1 1 1 0 0 1 -1 1 1 ," 144 | "Deconvolution 749 1 1 746 749 10 1 10 4 4 2 2 1 1 1 -1 1 1 ," 145 | "ReLU 750 1 1 749 750 ," 146 | "Add 751 2 1 747 750 751 ," 147 | "Convolution 753 1 1 751 753 1 10 10 1 1 1 1 0 0 1 -1 1 1 ," 148 | "ReLU 754 1 1 753 754 ," 149 | "Convolution 755 1 1 754 755 1 10 6 1 1 1 1 0 0 1 -1 1 1 ," 150 | "Convolution 756 1 1 562 756 1 6 6 1 1 1 1 0 0 1 -1 1 1 ," 151 | "Deconvolution 758 1 1 755 758 6 1 6 4 4 2 2 1 1 1 -1 1 1 ," 152 | "ReLU 759 1 1 758 759 ," 153 | "Add 760 2 1 756 759 760 ," 154 | "Convolution 762 1 1 760 762 1 6 6 1 1 1 1 0 0 1 -1 1 1 ," 155 | "ReLU 763 1 1 762 763 ," 156 | "Deconvolution 765 1 1 763 765 6 1 6 4 4 2 2 1 1 1 -1 1 1 ," 157 | "ReLU 766 1 1 765 766 ," 158 | "Convolution 767 1 1 766 767 1 6 4 3 3 1 1 1 1 1 -1 1 1 ," 159 | "Deconvolution output_array 1 1 767 output_array 2 2 2 4 4 2 2 1 1 1 -1 1 1 ," 160 | "Softmax softmax 1 1 output_array softmax_output ," 161 | "SplitV splitv 1 2 softmax_output background foreground 1 ," 162 | -------------------------------------------------------------------------------- /model/mobilenet_v2-ssd/README.md: -------------------------------------------------------------------------------- 1 | mobilenetv2_ssd is supported by TNN before 2021.12.23, which is converted from caffe model with priorbox layer. 2 | mobilenetv2_ssd_tf is converted from tensorflow version by ssdlite_tf2onnx.py, TNN supportes it since 2021.12.23. mobilenetv2_ssd_tf has no priorbox layer, the priorbox has been precomputed in the source code as ssd_anchors (detector_utils.h). 3 | mobilenetv2_ssd_tf_fix_box is also converted from tensorflow version with the post porocess for decoding the output boxes. TNN supportes it since 2022.04.18 4 | -------------------------------------------------------------------------------- /model/mobilenet_v2-ssd/mobilenetv2_ssd.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:57a50470f1ef88af19e4eb75b358af5c518cdef29ac3f86b749fcb5d2eaad4fd 3 | size 23137157 4 | -------------------------------------------------------------------------------- /model/mobilenet_v2-ssd/mobilenetv2_ssd_tf.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b57b74e18e0d75b062c7f8ac8672aa7894a5e550f39031da1cf67b2253f3d7b8 3 | size 17914969 4 | -------------------------------------------------------------------------------- /model/mobilenet_v2-ssd/mobilenetv2_ssd_tf_fix_box.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:34c2d34571468641fe7bca554e7eb9a474737948364522e97d45b3dae1ada154 3 | size 17957639 4 | -------------------------------------------------------------------------------- /model/mobilenet_v2-ssd/ssdlite_tf2onnx.py: -------------------------------------------------------------------------------- 1 | # Converts the MobileNetV2+SSDLite model to ONNX. 2 | # 3 | # This script creates a pipeline with three models: 4 | # 1. MobileNetV2 + SSDLite 5 | # 2. A neural network that decodes the coordinate predictions using the anchor boxes. 6 | # 7 | # This is the model from the paper 'SSD: Single Shot MultiBox Detector' by Liu et al (2015), 8 | # https://arxiv.org/abs/1512.02325, with MobileNetV2 as the backbone and depthwise separable 9 | # convolutions for the SSD layers (also known as SSDLite). 10 | # 11 | # The version of the model used is ssdlite_mobilenet_v2_coco, downloaded from: 12 | # http://download.tensorflow.org/models/object_detection/ssdlite_mobilenet_v2_coco_2018_05_09.tar.gz 13 | # 14 | # It was originally trained with the TensorFlow Object Detection API: 15 | # https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md 16 | # 17 | # The model expects input images of 300x300 pixels and detects objects from the COCO dataset. 18 | # 19 | # NOTE: The conversion script reads from saved_model.pb, not from frozen_inference_graph.pb. 20 | # (Using the frozen graph gives an error, "ValueError: Graph has cycles".) 21 | # 22 | # Tested with Python 3.6.5, Tensorflow 1.7.0, coremltools 2.0, tfcoreml 0.3.0. 23 | # See also: https://github.com/tf-coreml/tf-coreml/blob/master/examples/ssd_example.ipynb 24 | 25 | 26 | # system tensorflow 1.15.1 dont use tensorflow2.x 27 | import os 28 | import sys 29 | 30 | import numpy as np 31 | 32 | import tensorflow as tf 33 | from tensorflow.python.tools import strip_unused_lib 34 | from tensorflow.python.framework import dtypes 35 | from tensorflow.python.platform import gfile 36 | 37 | import onnx 38 | from tf2onnx.tfonnx import process_tf_graph 39 | from tf2onnx import constants, logging, utils, optimizer 40 | from tf2onnx import tf_loader 41 | from tf2onnx.graph import ExternalTensorStorage 42 | from tf2onnx.tf_utils import compress_graph_def 43 | 44 | 45 | # From where to load the saved_model.pb file. 46 | saved_model_path = "saved_model" 47 | 48 | # Where to save the final Core ML model file. 49 | onnx_model_path = "mobilenetv2-ssdlite.onnx" 50 | 51 | # The number of predicted classes, excluding background. 52 | num_classes = 90 53 | 54 | # The number of predicted bounding boxes. 55 | num_anchors = 1917 56 | 57 | # Size of the expected input image. 58 | input_width = 300 59 | input_height = 300 60 | 61 | 62 | # Temporary file. You can delete this after the conversion is done. 63 | frozen_model_file = "frozen_model.pb" 64 | 65 | # Names of the interesting tensors in the graph. We use "Postprocessor/convert_scores" 66 | # instead of "concat_1" because this already applies the sigmoid to the class scores. 67 | input_node = "Preprocessor/sub" 68 | bbox_output_node = "concat" 69 | class_output_node = "Postprocessor/convert_scores" 70 | 71 | input_tensor = input_node + ":0" 72 | bbox_output_tensor = bbox_output_node + ":0" 73 | class_output_tensor = class_output_node + ":0" 74 | 75 | input_names=[input_tensor] 76 | output_names=[class_output_tensor, bbox_output_tensor] 77 | inputs_as_nchw=[input_tensor] 78 | 79 | 80 | def convert2onnx(frozen_graph, name="unknown", large_model=False, output_path=None, 81 | output_frozen_graph=None, custom_ops=None, custom_op_handlers=None, **kwargs): 82 | """Common processing for conversion.""" 83 | 84 | model_proto = None 85 | external_tensor_storage = None 86 | const_node_values = None 87 | 88 | if custom_ops is not None: 89 | if custom_op_handlers is None: 90 | custom_op_handlers = {} 91 | custom_op_handlers.update( 92 | {op: (make_default_custom_op_handler(domain), []) for op, domain in custom_ops.items()}) 93 | 94 | with tf.Graph().as_default() as tf_graph: 95 | if large_model: 96 | const_node_values = compress_graph_def(frozen_graph) 97 | external_tensor_storage = ExternalTensorStorage() 98 | if output_frozen_graph: 99 | utils.save_protobuf(output_frozen_graph, frozen_graph) 100 | if not kwargs.get("tflite_path") and not kwargs.get("tfjs_path"): 101 | tf.import_graph_def(frozen_graph, name='') 102 | g = process_tf_graph(tf_graph, const_node_values=const_node_values, 103 | custom_op_handlers=custom_op_handlers, **kwargs) 104 | if constants.ENV_TF2ONNX_CATCH_ERRORS in os.environ: 105 | catch_errors = constants.ENV_TF2ONNX_CATCH_ERRORS.upper() == "TRUE" 106 | else: 107 | catch_errors = not large_model 108 | onnx_graph = optimizer.optimize_graph(g, catch_errors) 109 | model_proto = onnx_graph.make_model("converted from {}".format(name), 110 | external_tensor_storage=external_tensor_storage) 111 | if output_path: 112 | if large_model: 113 | utils.save_onnx_zip(output_path, model_proto, external_tensor_storage) 114 | else: 115 | utils.save_protobuf(output_path, model_proto) 116 | 117 | return model_proto, external_tensor_storage 118 | 119 | 120 | def load_saved_model(path): 121 | """Loads a saved model into a graph.""" 122 | graph_def, inputs, outputs, initialized_tables, tensors_to_rename = tf_loader.from_saved_model( 123 | path, input_names, output_names, return_initialized_tables=True, return_tensors_to_rename=True) 124 | return graph_def 125 | 126 | 127 | # Load the original graph and remove anything we don't need. 128 | the_graph = load_saved_model(saved_model_path) 129 | 130 | # Convert to ONNX model. 131 | onnx_graph, external_tensor_storage = convert2onnx(the_graph, output_path=onnx_model_path, 132 | input_names=[input_tensor], output_names=[class_output_tensor, bbox_output_tensor], 133 | inputs_as_nchw=[input_tensor]) 134 | -------------------------------------------------------------------------------- /model/mobilenet_v2/mobilenet_v2.onnx.opt.onnx.rapidmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0bd4e45faaabd68048e51ebd59c5d82c73c1d16a373fafd4fc765fbc3816d843 3 | size 13959890 4 | -------------------------------------------------------------------------------- /model/mobilenet_v2/mobilenet_v2.onnx.opt.onnx.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0bd4e45faaabd68048e51ebd59c5d82c73c1d16a373fafd4fc765fbc3816d843 3 | size 13959890 4 | -------------------------------------------------------------------------------- /model/mobilenet_v2/mobilenet_v2.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0bd4e45faaabd68048e51ebd59c5d82c73c1d16a373fafd4fc765fbc3816d843 3 | size 13959890 4 | -------------------------------------------------------------------------------- /model/monodepth_pydnet/monodepth_pydnet.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c246bb7f8c77982f22e44216b189b1b46289366d55e0c19b6520ecae7521e5be 3 | size 7899577 4 | -------------------------------------------------------------------------------- /model/nanodet/nanodet_e1.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:29d8fff05f627eab4cf42ef5171b30af9756fb77e0234639c1fab89759813001 3 | size 15876087 4 | -------------------------------------------------------------------------------- /model/nanodet/nanodet_m.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d813e1311482beed115d38cf328a21addc7b13de7bcfdf28bea6e6ab8a603f00 3 | size 3777801 4 | -------------------------------------------------------------------------------- /model/nanodet/nanodet_t.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:500f258c1a463d32f2d3fcb04a6cbc70c76f46db4e4d25ddd9479a285d468573 3 | size 5301724 4 | -------------------------------------------------------------------------------- /model/objectron/objectron_shoes.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:df1211208dc4afcdec3489f08b08399df50f367716f0f5468e03542c8df5c44d 3 | size 5783664 4 | -------------------------------------------------------------------------------- /model/resnet50/resnet50.opt.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:97f28f005bb40c1c15b5fc0933257114f9ba7efa3959d24c6dd3035213bfc628 3 | size 102127847 4 | -------------------------------------------------------------------------------- /model/shufflenet_v2/shufflenet_v2.onnx.opt.onnx.rapidmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:507a35d834842b3b40eed8db5f554007aac8d482373eeb28686f1160dd038595 3 | size 5456142 4 | -------------------------------------------------------------------------------- /model/shufflenet_v2/shufflenet_v2.onnx.opt.onnx.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:507a35d834842b3b40eed8db5f554007aac8d482373eeb28686f1160dd038595 3 | size 5456142 4 | -------------------------------------------------------------------------------- /model/shufflenet_v2/shufflenet_v2.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:507a35d834842b3b40eed8db5f554007aac8d482373eeb28686f1160dd038595 3 | size 5456142 4 | -------------------------------------------------------------------------------- /model/skeleton/skeleton.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b9f208a0a315dc4da0ff23916b31c374c2af20ae6dca3274e65ab106130ada38 3 | size 7213353 4 | -------------------------------------------------------------------------------- /model/tiny-bert/tiny-bert-squad-fixed-256.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bb55fbd3d59405bfc2c5811807074509abe5ad4030e42278627d158836a7771f 3 | size 25291711 4 | -------------------------------------------------------------------------------- /model/tiny-bert/tiny-bert-squad.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c02c1dffd97a85d8dfc72734b61ad0080277b98e9ce2eb033595bec84751b729 3 | size 25431132 4 | -------------------------------------------------------------------------------- /model/yolov5/yolov5s.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bf94d2d693feffffe1604c4c9ec7fd3fb50d2aea8d7e27929254fe22525332bc 3 | size 29849719 4 | -------------------------------------------------------------------------------- /model/youtu_face_alignment/youtu_face_alignment_phase1.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:422b0459d6bbe79b3e13db13b5c088e60b5ca195d7327e4e6c4dbe0e1058d534 3 | size 2800318 4 | -------------------------------------------------------------------------------- /model/youtu_face_alignment/youtu_face_alignment_phase1.tnnproto: -------------------------------------------------------------------------------- 1 | "1 82 1 4206624770 ," 2 | "input 1 1 128 128 ," 3 | " 260 261 275 276 290 304 305 319 320 334 348 349 363 364 378 379 393 394 408 409 423 437 438 452 453 467 468 482 483 497 498 512 513 527 528 542 543 557 558 572 573 587 588 602 603 617 618 632 633 647 648 662 663 677 678 692 693 707 708 722 723 737 738 752 753 767 768 782 796 797 811 812 826 827 841 842 843 851 852 853 854 input ," 4 | "852 855 ," 5 | " 81 ," 6 | "Convolution 260 1 1 input 260 1 1 16 3 3 2 2 1 1 1 -1 1 1 ," 7 | "ReLU 261 1 1 260 261 ," 8 | "Convolution 275 1 1 261 275 16 1 16 3 3 2 2 1 1 1 -1 1 1 ," 9 | "ReLU 276 1 1 275 276 ," 10 | "Convolution 290 1 1 276 290 1 16 32 1 1 1 1 0 0 1 -1 1 1 ," 11 | "Convolution 304 1 1 290 304 1 32 192 1 1 1 1 0 0 1 -1 1 1 ," 12 | "ReLU 305 1 1 304 305 ," 13 | "Convolution 319 1 1 305 319 192 1 192 3 3 2 2 1 1 1 -1 1 1 ," 14 | "ReLU 320 1 1 319 320 ," 15 | "Convolution 334 1 1 320 334 1 192 48 1 1 1 1 0 0 1 -1 1 1 ," 16 | "Convolution 348 1 1 334 348 1 48 288 1 1 1 1 0 0 1 -1 1 1 ," 17 | "ReLU 349 1 1 348 349 ," 18 | "Convolution 363 1 1 349 363 288 1 288 3 3 1 1 1 1 1 -1 1 1 ," 19 | "ReLU 364 1 1 363 364 ," 20 | "Convolution 378 1 1 364 378 1 288 48 1 1 1 1 0 0 1 -1 1 1 ," 21 | "Add 379 2 1 334 378 379 ," 22 | "Convolution 393 1 1 379 393 1 48 288 1 1 1 1 0 0 1 -1 1 1 ," 23 | "ReLU 394 1 1 393 394 ," 24 | "Convolution 408 1 1 394 408 288 1 288 3 3 2 2 1 1 1 -1 1 1 ," 25 | "ReLU 409 1 1 408 409 ," 26 | "Convolution 423 1 1 409 423 1 288 64 1 1 1 1 0 0 1 -1 1 1 ," 27 | "Convolution 437 1 1 423 437 1 64 384 1 1 1 1 0 0 1 -1 1 1 ," 28 | "ReLU 438 1 1 437 438 ," 29 | "Convolution 452 1 1 438 452 384 1 384 3 3 1 1 1 1 1 -1 1 1 ," 30 | "ReLU 453 1 1 452 453 ," 31 | "Convolution 467 1 1 453 467 1 384 64 1 1 1 1 0 0 1 -1 1 1 ," 32 | "Add 468 2 1 423 467 468 ," 33 | "Convolution 482 1 1 468 482 1 64 384 1 1 1 1 0 0 1 -1 1 1 ," 34 | "ReLU 483 1 1 482 483 ," 35 | "Convolution 497 1 1 483 497 384 1 384 3 3 1 1 1 1 1 -1 1 1 ," 36 | "ReLU 498 1 1 497 498 ," 37 | "Convolution 512 1 1 498 512 1 384 64 1 1 1 1 0 0 1 -1 1 1 ," 38 | "Add 513 2 1 468 512 513 ," 39 | "Convolution 527 1 1 513 527 1 64 384 1 1 1 1 0 0 1 -1 1 1 ," 40 | "ReLU 528 1 1 527 528 ," 41 | "Convolution 542 1 1 528 542 384 1 384 3 3 1 1 1 1 1 -1 1 1 ," 42 | "ReLU 543 1 1 542 543 ," 43 | "Convolution 557 1 1 543 557 1 384 64 1 1 1 1 0 0 1 -1 1 1 ," 44 | "Add 558 2 1 513 557 558 ," 45 | "Convolution 572 1 1 558 572 1 64 384 1 1 1 1 0 0 1 -1 1 1 ," 46 | "ReLU 573 1 1 572 573 ," 47 | "Convolution 587 1 1 573 587 384 1 384 3 3 1 1 1 1 1 -1 1 1 ," 48 | "ReLU 588 1 1 587 588 ," 49 | "Convolution 602 1 1 588 602 1 384 64 1 1 1 1 0 0 1 -1 1 1 ," 50 | "Add 603 2 1 558 602 603 ," 51 | "Convolution 617 1 1 603 617 1 64 384 1 1 1 1 0 0 1 -1 1 1 ," 52 | "ReLU 618 1 1 617 618 ," 53 | "Convolution 632 1 1 618 632 384 1 384 3 3 1 1 1 1 1 -1 1 1 ," 54 | "ReLU 633 1 1 632 633 ," 55 | "Convolution 647 1 1 633 647 1 384 64 1 1 1 1 0 0 1 -1 1 1 ," 56 | "Add 648 2 1 603 647 648 ," 57 | "Convolution 662 1 1 648 662 1 64 384 1 1 1 1 0 0 1 -1 1 1 ," 58 | "ReLU 663 1 1 662 663 ," 59 | "Convolution 677 1 1 663 677 384 1 384 3 3 1 1 1 1 1 -1 1 1 ," 60 | "ReLU 678 1 1 677 678 ," 61 | "Convolution 692 1 1 678 692 1 384 64 1 1 1 1 0 0 1 -1 1 1 ," 62 | "Add 693 2 1 648 692 693 ," 63 | "Convolution 707 1 1 693 707 1 64 384 1 1 1 1 0 0 1 -1 1 1 ," 64 | "ReLU 708 1 1 707 708 ," 65 | "Convolution 722 1 1 708 722 384 1 384 3 3 1 1 1 1 1 -1 1 1 ," 66 | "ReLU 723 1 1 722 723 ," 67 | "Convolution 737 1 1 723 737 1 384 64 1 1 1 1 0 0 1 -1 1 1 ," 68 | "Add 738 2 1 693 737 738 ," 69 | "Convolution 752 1 1 738 752 1 64 384 1 1 1 1 0 0 1 -1 1 1 ," 70 | "ReLU 753 1 1 752 753 ," 71 | "Convolution 767 1 1 753 767 384 1 384 3 3 2 2 1 1 1 -1 1 1 ," 72 | "ReLU 768 1 1 767 768 ," 73 | "Convolution 782 1 1 768 782 1 384 96 1 1 1 1 0 0 1 -1 1 1 ," 74 | "Convolution 796 1 1 782 796 1 96 576 1 1 1 1 0 0 1 -1 1 1 ," 75 | "ReLU 797 1 1 796 797 ," 76 | "Convolution 811 1 1 797 811 576 1 576 3 3 1 1 1 1 1 -1 1 1 ," 77 | "ReLU 812 1 1 811 812 ," 78 | "Convolution 826 1 1 812 826 1 576 96 1 1 1 1 0 0 1 -1 1 1 ," 79 | "Add 827 2 1 782 826 827 ," 80 | "Convolution 841 1 1 827 841 1 96 128 1 1 1 1 0 0 1 -1 1 1 ," 81 | "ReLU 842 1 1 841 842 ," 82 | "Pooling 843 1 1 842 843 1 0 0 1 1 0 0 -1 -1 -1 0 ," 83 | "Reshape 851 1 1 843 851 0 4 4 0 -1 1 1 ," 84 | "InnerProduct 852 1 1 851 852 234 1 0 1 ," 85 | "InnerProduct 854 1 1 851 854 1 1 0 1 ," 86 | "Sigmoid label_sigmoid 1 1 854 855 ," -------------------------------------------------------------------------------- /model/youtu_face_alignment/youtu_face_alignment_phase2.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ff6c6cb3f6b12a80ccdde2c111f1a9b1a41aa56996fc363bc75dfcd627a032a9 3 | size 2774572 4 | -------------------------------------------------------------------------------- /model/youtu_face_alignment/youtu_face_alignment_phase2.tnnproto: -------------------------------------------------------------------------------- 1 | "1 81 1 4206624770 ," 2 | "input 1 1 128 128 ," 3 | " 258 259 273 274 288 302 303 317 318 332 346 347 361 362 376 377 391 392 406 407 421 422 436 437 451 452 466 480 481 495 496 510 511 525 526 540 541 555 556 570 571 585 586 600 601 615 616 630 631 645 646 660 661 675 676 690 691 705 706 720 721 735 736 750 751 765 766 780 794 795 809 810 824 825 839 840 841 849 850 851 input ," 4 | "850 ," 5 | " 79 ," 6 | "Convolution 258 1 1 input 258 1 1 24 3 3 2 2 1 1 1 -1 1 1 ," 7 | "ReLU 259 1 1 258 259 ," 8 | "Convolution 273 1 1 259 273 24 1 24 3 3 2 2 1 1 1 -1 1 1 ," 9 | "ReLU 274 1 1 273 274 ," 10 | "Convolution 288 1 1 274 288 1 24 32 1 1 1 1 0 0 1 -1 1 1 ," 11 | "Convolution 302 1 1 288 302 1 32 192 1 1 1 1 0 0 1 -1 1 1 ," 12 | "ReLU 303 1 1 302 303 ," 13 | "Convolution 317 1 1 303 317 192 1 192 3 3 2 2 1 1 1 -1 1 1 ," 14 | "ReLU 318 1 1 317 318 ," 15 | "Convolution 332 1 1 318 332 1 192 48 1 1 1 1 0 0 1 -1 1 1 ," 16 | "Convolution 346 1 1 332 346 1 48 288 1 1 1 1 0 0 1 -1 1 1 ," 17 | "ReLU 347 1 1 346 347 ," 18 | "Convolution 361 1 1 347 361 288 1 288 3 3 1 1 1 1 1 -1 1 1 ," 19 | "ReLU 362 1 1 361 362 ," 20 | "Convolution 376 1 1 362 376 1 288 48 1 1 1 1 0 0 1 -1 1 1 ," 21 | "Add 377 2 1 332 376 377 ," 22 | "Convolution 391 1 1 377 391 1 48 288 1 1 1 1 0 0 1 -1 1 1 ," 23 | "ReLU 392 1 1 391 392 ," 24 | "Convolution 406 1 1 392 406 288 1 288 3 3 1 1 1 1 1 -1 1 1 ," 25 | "ReLU 407 1 1 406 407 ," 26 | "Convolution 421 1 1 407 421 1 288 48 1 1 1 1 0 0 1 -1 1 1 ," 27 | "Add 422 2 1 377 421 422 ," 28 | "Convolution 436 1 1 422 436 1 48 288 1 1 1 1 0 0 1 -1 1 1 ," 29 | "ReLU 437 1 1 436 437 ," 30 | "Convolution 451 1 1 437 451 288 1 288 3 3 2 2 1 1 1 -1 1 1 ," 31 | "ReLU 452 1 1 451 452 ," 32 | "Convolution 466 1 1 452 466 1 288 64 1 1 1 1 0 0 1 -1 1 1 ," 33 | "Convolution 480 1 1 466 480 1 64 384 1 1 1 1 0 0 1 -1 1 1 ," 34 | "ReLU 481 1 1 480 481 ," 35 | "Convolution 495 1 1 481 495 384 1 384 3 3 1 1 1 1 1 -1 1 1 ," 36 | "ReLU 496 1 1 495 496 ," 37 | "Convolution 510 1 1 496 510 1 384 64 1 1 1 1 0 0 1 -1 1 1 ," 38 | "Add 511 2 1 466 510 511 ," 39 | "Convolution 525 1 1 511 525 1 64 384 1 1 1 1 0 0 1 -1 1 1 ," 40 | "ReLU 526 1 1 525 526 ," 41 | "Convolution 540 1 1 526 540 384 1 384 3 3 1 1 1 1 1 -1 1 1 ," 42 | "ReLU 541 1 1 540 541 ," 43 | "Convolution 555 1 1 541 555 1 384 64 1 1 1 1 0 0 1 -1 1 1 ," 44 | "Add 556 2 1 511 555 556 ," 45 | "Convolution 570 1 1 556 570 1 64 384 1 1 1 1 0 0 1 -1 1 1 ," 46 | "ReLU 571 1 1 570 571 ," 47 | "Convolution 585 1 1 571 585 384 1 384 3 3 1 1 1 1 1 -1 1 1 ," 48 | "ReLU 586 1 1 585 586 ," 49 | "Convolution 600 1 1 586 600 1 384 64 1 1 1 1 0 0 1 -1 1 1 ," 50 | "Add 601 2 1 556 600 601 ," 51 | "Convolution 615 1 1 601 615 1 64 384 1 1 1 1 0 0 1 -1 1 1 ," 52 | "ReLU 616 1 1 615 616 ," 53 | "Convolution 630 1 1 616 630 384 1 384 3 3 1 1 1 1 1 -1 1 1 ," 54 | "ReLU 631 1 1 630 631 ," 55 | "Convolution 645 1 1 631 645 1 384 64 1 1 1 1 0 0 1 -1 1 1 ," 56 | "Add 646 2 1 601 645 646 ," 57 | "Convolution 660 1 1 646 660 1 64 384 1 1 1 1 0 0 1 -1 1 1 ," 58 | "ReLU 661 1 1 660 661 ," 59 | "Convolution 675 1 1 661 675 384 1 384 3 3 1 1 1 1 1 -1 1 1 ," 60 | "ReLU 676 1 1 675 676 ," 61 | "Convolution 690 1 1 676 690 1 384 64 1 1 1 1 0 0 1 -1 1 1 ," 62 | "Add 691 2 1 646 690 691 ," 63 | "Convolution 705 1 1 691 705 1 64 384 1 1 1 1 0 0 1 -1 1 1 ," 64 | "ReLU 706 1 1 705 706 ," 65 | "Convolution 720 1 1 706 720 384 1 384 3 3 1 1 1 1 1 -1 1 1 ," 66 | "ReLU 721 1 1 720 721 ," 67 | "Convolution 735 1 1 721 735 1 384 64 1 1 1 1 0 0 1 -1 1 1 ," 68 | "Add 736 2 1 691 735 736 ," 69 | "Convolution 750 1 1 736 750 1 64 384 1 1 1 1 0 0 1 -1 1 1 ," 70 | "ReLU 751 1 1 750 751 ," 71 | "Convolution 765 1 1 751 765 384 1 384 3 3 2 2 1 1 1 -1 1 1 ," 72 | "ReLU 766 1 1 765 766 ," 73 | "Convolution 780 1 1 766 780 1 384 96 1 1 1 1 0 0 1 -1 1 1 ," 74 | "Convolution 794 1 1 780 794 1 96 576 1 1 1 1 0 0 1 -1 1 1 ," 75 | "ReLU 795 1 1 794 795 ," 76 | "Convolution 809 1 1 795 809 576 1 576 3 3 1 1 1 1 1 -1 1 1 ," 77 | "ReLU 810 1 1 809 810 ," 78 | "Convolution 824 1 1 810 824 1 576 96 1 1 1 1 0 0 1 -1 1 1 ," 79 | "Add 825 2 1 780 824 825 ," 80 | "Convolution 839 1 1 825 839 1 96 128 1 1 1 1 0 0 1 -1 1 1 ," 81 | "ReLU 840 1 1 839 840 ," 82 | "Pooling 841 1 1 840 841 1 0 0 1 1 0 0 -1 -1 -1 0 ," 83 | "Reshape 849 1 1 841 849 0 4 4 0 -1 1 1 ," 84 | "InnerProduct 850 1 1 849 850 316 1 0 1 ," -------------------------------------------------------------------------------- /model/youtu_face_alignment/youtu_mean_pts_phase1.txt: -------------------------------------------------------------------------------- 1 | 15.941798618861606 2 | 9.926826477050781 3 | 24.884270804268972 4 | 8.73504202706473 5 | 34.03078351702009 6 | 8.315585000174385 7 | 43.202767508370535 8 | 8.905578068324496 9 | 52.227116176060264 10 | 9.469189235142299 11 | 46.048754010881694 12 | 1.6381108420235768 13 | 34.56376211983817 14 | 0.0 15 | 23.394317626953125 16 | 1.9033783503941126 17 | 112.05820138113839 18 | 9.926826477050781 19 | 103.11574009486607 20 | 8.73504202706473 21 | 93.96921212332589 22 | 8.315585000174385 23 | 84.7972412109375 24 | 8.905578068324496 25 | 75.77287946428571 26 | 9.469189235142299 27 | 81.95124162946428 28 | 1.6381108420235768 29 | 93.43623570033482 30 | 0.0 31 | 104.60566929408482 32 | 1.9033783503941126 33 | 26.18139212472098 34 | 25.667587280273438 35 | 30.945561000279017 36 | 27.8785400390625 37 | 36.33588300432478 38 | 28.732448032924104 39 | 41.82240077427455 40 | 28.302178519112722 41 | 47.0606689453125 42 | 27.047511509486604 43 | 42.936854771205354 44 | 23.41505650111607 45 | 37.08025687081473 46 | 22.198366437639507 47 | 31.10617937360491 48 | 22.9532230922154 49 | 101.81861223493303 50 | 25.667587280273438 51 | 97.05445207868303 52 | 27.8785400390625 53 | 91.66411481584821 54 | 28.732448032924104 55 | 86.17760358537946 56 | 28.302178519112722 57 | 80.93933977399553 58 | 27.047511509486604 59 | 85.06314522879464 60 | 23.41505650111607 61 | 90.91973876953125 62 | 22.198366437639507 63 | 96.89381626674107 64 | 22.9532230922154 65 | 64.0 66 | 54.491991315569194 67 | 64.0 68 | 47.76159232003348 69 | 64.0 70 | 41.0318123953683 71 | 64.0 72 | 34.301572527204236 73 | 64.0 74 | 27.57185799734933 75 | 57.46892874581473 76 | 27.543951851981024 77 | 54.74309430803571 78 | 39.03560529436384 79 | 51.40421840122767 80 | 50.329010009765625 81 | 46.23475428989955 82 | 59.220977783203125 83 | 47.325993129185264 84 | 64.26312691824776 85 | 54.644413539341514 86 | 67.39312308175222 87 | 64.0 88 | 67.82386125837053 89 | 73.35558210100446 90 | 67.39312308175222 91 | 80.67401123046875 92 | 64.26312691824776 93 | 81.76524135044643 94 | 59.220977783203125 95 | 76.59578159877232 96 | 50.329010009765625 97 | 73.25690569196428 98 | 39.03560529436384 99 | 70.53107125418526 100 | 27.543951851981024 101 | 59.80152675083705 102 | 35.15744890485491 103 | 55.603053501674104 104 | 42.74344744001116 105 | 68.19847324916294 106 | 35.15744890485491 107 | 72.39694649832589 108 | 42.74344744001116 109 | 43.504887172154014 110 | 88.50916399274553 111 | 48.7764892578125 112 | 94.39142717633928 113 | 55.624664306640625 114 | 98.8087158203125 115 | 64.0 116 | 100.29350934709821 117 | 72.37533569335938 118 | 98.8087158203125 119 | 79.2235107421875 120 | 94.39142717633928 121 | 84.49510846819196 122 | 88.50916399274553 123 | 77.83380998883928 124 | 83.34629603794643 125 | 69.27566528320312 126 | 79.58379255022321 127 | 64.0 128 | 80.6008562360491 129 | 58.724334716796875 130 | 79.58379255022321 131 | 50.16619001116071 132 | 83.34629603794643 133 | 50.89141845703125 134 | 89.74724469866071 135 | 57.3452889578683 136 | 90.64471435546875 137 | 64.0 138 | 91.18742152622768 139 | 70.6547110421317 140 | 90.64471435546875 141 | 77.10858154296875 142 | 89.74724469866071 143 | 77.07768031529018 144 | 87.48964146205357 145 | 70.63646153041294 146 | 86.86642020089285 147 | 64.0 148 | 86.96722412109375 149 | 57.36353846958705 150 | 86.86642020089285 151 | 50.9223153250558 152 | 87.48964146205357 153 | 0.0183851420879364 154 | 28.108745029994417 155 | 0.0 156 | 34.72972978864397 157 | 0.06494628531592232 158 | 41.350777762276785 159 | 0.41133373124258854 160 | 47.96626935686383 161 | 1.0741017205374581 162 | 54.56809779575892 163 | 2.1054571696690147 164 | 61.13047572544642 165 | 3.48410279410226 166 | 67.63246808733258 167 | 5.19008799961635 168 | 74.0465349469866 169 | 7.2999758039202005 170 | 80.32695661272321 171 | 9.84906005859375 172 | 86.4172624860491 173 | 12.966961451939174 174 | 92.20993477957589 175 | 16.58299146379743 176 | 97.6715349469866 177 | 20.691375732421875 178 | 102.7428240094866 179 | 25.146484375 180 | 107.48412214006696 181 | 29.89637974330357 182 | 111.89399937220982 183 | 34.84847150530134 184 | 116.02112688337053 185 | 39.985382080078125 186 | 119.81998116629464 187 | 45.38229806082589 188 | 123.17197963169642 189 | 51.17150006975446 190 | 125.84141322544642 191 | 57.44042096819196 192 | 127.51022774832589 193 | 64.0 194 | 128.00000871930803 195 | 70.55957903180803 196 | 127.51022774832589 197 | 76.82849993024553 198 | 125.84141322544642 199 | 82.6177019391741 200 | 123.17197963169642 201 | 88.01460484095982 202 | 119.81998116629464 203 | 93.15153285435267 204 | 116.02112688337053 205 | 98.10362025669642 206 | 111.89399937220982 207 | 102.85349818638392 208 | 107.48412214006696 209 | 107.30861118861607 210 | 102.7428240094866 211 | 111.41700962611607 212 | 97.6715349469866 213 | 115.03303745814732 214 | 92.20993477957589 215 | 118.15093122209821 216 | 86.4172624860491 217 | 120.70002092633928 218 | 80.32695661272321 219 | 122.80990164620535 220 | 74.0465349469866 221 | 124.5158952985491 222 | 67.63246808733258 223 | 125.89454868861607 224 | 61.13047572544642 225 | 126.92589460100446 226 | 54.56809779575892 227 | 127.58866664341517 228 | 47.96626935686383 229 | 127.93504987444196 230 | 41.350777762276785 231 | 128.0 232 | 34.72972978864397 233 | 127.98161097935267 234 | 28.108745029994417 -------------------------------------------------------------------------------- /model/youtu_face_alignment/youtu_mean_pts_phase2.txt: -------------------------------------------------------------------------------- 1 | 0.0 2 | 12.669152396065847 3 | 11.908857073102677 4 | 11.148134504045759 5 | 24.08943394252232 6 | 10.61280277797154 7 | 36.30393327985491 8 | 11.365781511579241 9 | 48.32182965959821 10 | 12.085093906947543 11 | 40.093985421316965 12 | 2.090649196079799 13 | 24.799209594726562 14 | 0.0 15 | 9.924659729003906 16 | 2.429197583879743 17 | 127.99999128069196 18 | 12.669152396065847 19 | 116.09113420758928 20 | 11.148134504045759 21 | 103.9105486188616 22 | 10.61280277797154 23 | 91.6960710797991 24 | 11.365781511579241 25 | 79.67816162109375 26 | 12.085093906947543 27 | 87.90598842075893 28 | 2.090649196079799 29 | 103.20077078683035 30 | 0.0 31 | 118.07530866350446 32 | 2.429197583879743 33 | 13.636254446847097 34 | 32.75836181640625 35 | 19.980789184570312 36 | 35.58009556361607 37 | 27.15917750767299 38 | 36.66990443638392 39 | 34.46567644391741 40 | 36.12076677594866 41 | 41.44157191685267 42 | 34.519496372767854 43 | 35.94981384277344 44 | 29.88356454031808 45 | 28.150475638253347 46 | 28.330753871372767 47 | 20.194686889648438 48 | 29.29414803641183 49 | 114.36373465401785 50 | 32.75836181640625 51 | 108.01921735491071 52 | 35.58009556361607 53 | 100.84081159319196 54 | 36.66990443638392 55 | 93.5343279157366 56 | 36.12076677594866 57 | 86.55841936383928 58 | 34.519496372767854 59 | 92.0501708984375 60 | 29.88356454031808 61 | 99.84950474330357 62 | 28.330753871372767 63 | 107.8052978515625 64 | 29.29414803641183 65 | 63.99999128069196 66 | 69.54562377929688 67 | 63.99999128069196 68 | 60.95592389787946 69 | 63.99999128069196 70 | 52.367013113839285 71 | 63.99999128069196 72 | 43.77752249581473 73 | 63.99999128069196 74 | 35.18869454520089 75 | 55.30244663783482 76 | 35.153080531529014 77 | 51.67239815848214 78 | 49.819344656808035 79 | 47.225956508091514 80 | 64.23260062081472 81 | 40.34169224330357 82 | 75.58101109095982 83 | 41.794908796037944 84 | 82.01606968470982 85 | 51.540985107421875 86 | 86.0107421875 87 | 63.99999128069196 88 | 86.56048583984375 89 | 76.45900181361607 90 | 86.0107421875 91 | 86.20508684430803 92 | 82.01606968470982 93 | 87.65829903738839 94 | 75.58101109095982 95 | 80.77403041294643 96 | 64.23260062081472 97 | 76.32758440290178 98 | 49.819344656808035 99 | 72.6975359235491 100 | 35.153080531529014 101 | 58.40880911690848 102 | 44.869838169642854 103 | 52.81761823381696 104 | 54.55149623325892 105 | 69.59117780412946 106 | 44.869838169642854 107 | 75.18236432756696 108 | 54.55149623325892 109 | 36.70627702985491 110 | 112.96016148158482 111 | 43.726566859654014 112 | 120.4674333844866 113 | 52.846400669642854 114 | 126.10501534598214 115 | 63.99999128069196 116 | 127.99999128069196 117 | 75.15358189174107 118 | 126.10501534598214 119 | 84.27342878069196 120 | 120.4674333844866 121 | 91.29370989118303 122 | 112.96016148158482 123 | 82.4227294921875 124 | 106.37104143415178 125 | 71.02569580078125 126 | 101.56913539341517 127 | 63.99999128069196 128 | 102.86716134207589 129 | 56.974291120256694 130 | 101.56913539341517 131 | 45.577257428850444 132 | 106.37104143415178 133 | 46.54305158342633 134 | 114.54027448381696 135 | 55.13779558454241 136 | 115.68567766462053 137 | 63.99999128069196 138 | 116.37831333705357 139 | 72.86218697684151 140 | 115.68567766462053 141 | 81.4569353376116 142 | 114.54027448381696 143 | 81.41578892299107 144 | 111.65901402064732 145 | 72.83788626534597 146 | 110.86361258370535 147 | 63.99999128069196 148 | 110.99226597377232 149 | 55.162096296037944 150 | 110.86361258370535 151 | 46.584197998046875 152 | 111.65901402064732 -------------------------------------------------------------------------------- /netron/Netron Setup 4.1.1.exe.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/netron/Netron Setup 4.1.1.exe.zip -------------------------------------------------------------------------------- /netron/Netron-4.1.1.AppImage.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darrenyao87/tnn-models/344a19103adfbb10c216f1746f22fc5928f83467/netron/Netron-4.1.1.AppImage.zip -------------------------------------------------------------------------------- /shufflenet_v2/shufflenet_v2.onnx.opt.onnx.rapidmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:507a35d834842b3b40eed8db5f554007aac8d482373eeb28686f1160dd038595 3 | size 5456142 4 | -------------------------------------------------------------------------------- /shufflenet_v2/shufflenet_v2.onnx.opt.onnx.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:507a35d834842b3b40eed8db5f554007aac8d482373eeb28686f1160dd038595 3 | size 5456142 4 | -------------------------------------------------------------------------------- /shufflenet_v2/shufflenet_v2.tnnmodel: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:507a35d834842b3b40eed8db5f554007aac8d482373eeb28686f1160dd038595 3 | size 5456142 4 | --------------------------------------------------------------------------------