[
  {
    "path": "MobileNetSSD_demo/.gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/caches/build_file_checksums.ser\n/.idea/libraries\n/.idea/modules.xml\n/.idea/workspace.xml\n.DS_Store\n/build\n/captures\n.externalNativeBuild\n"
  },
  {
    "path": "MobileNetSSD_demo/.idea/codeStyles/Project.xml",
    "content": "<component name=\"ProjectCodeStyleConfiguration\">\n  <code_scheme name=\"Project\" version=\"173\">\n    <Objective-C-extensions>\n      <file>\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Import\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Macro\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Typedef\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Enum\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Constant\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Global\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Struct\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"FunctionPredecl\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Function\" />\n      </file>\n      <class>\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Property\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Synthesize\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"InitMethod\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"StaticMethod\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"InstanceMethod\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"DeallocMethod\" />\n      </class>\n      <extensions>\n        <pair source=\"cpp\" header=\"h\" fileNamingConvention=\"NONE\" />\n        <pair source=\"c\" header=\"h\" fileNamingConvention=\"NONE\" />\n      </extensions>\n    </Objective-C-extensions>\n  </code_scheme>\n</component>"
  },
  {
    "path": "MobileNetSSD_demo/.idea/gradle.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"GradleSettings\">\n    <option name=\"linkedExternalProjectsSettings\">\n      <GradleProjectSettings>\n        <option name=\"distributionType\" value=\"DEFAULT_WRAPPED\" />\n        <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n        <option name=\"modules\">\n          <set>\n            <option value=\"$PROJECT_DIR$\" />\n            <option value=\"$PROJECT_DIR$/app\" />\n          </set>\n        </option>\n        <option name=\"resolveModulePerSourceSet\" value=\"false\" />\n      </GradleProjectSettings>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": "MobileNetSSD_demo/.idea/misc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"NullableNotNullManager\">\n    <option name=\"myDefaultNullable\" value=\"android.support.annotation.Nullable\" />\n    <option name=\"myDefaultNotNull\" value=\"android.support.annotation.NonNull\" />\n    <option name=\"myNullables\">\n      <value>\n        <list size=\"7\">\n          <item index=\"0\" class=\"java.lang.String\" itemvalue=\"org.jetbrains.annotations.Nullable\" />\n          <item index=\"1\" class=\"java.lang.String\" itemvalue=\"javax.annotation.Nullable\" />\n          <item index=\"2\" class=\"java.lang.String\" itemvalue=\"javax.annotation.CheckForNull\" />\n          <item index=\"3\" class=\"java.lang.String\" itemvalue=\"edu.umd.cs.findbugs.annotations.Nullable\" />\n          <item index=\"4\" class=\"java.lang.String\" itemvalue=\"android.support.annotation.Nullable\" />\n          <item index=\"5\" class=\"java.lang.String\" itemvalue=\"androidx.annotation.Nullable\" />\n          <item index=\"6\" class=\"java.lang.String\" itemvalue=\"androidx.annotation.RecentlyNullable\" />\n        </list>\n      </value>\n    </option>\n    <option name=\"myNotNulls\">\n      <value>\n        <list size=\"6\">\n          <item index=\"0\" class=\"java.lang.String\" itemvalue=\"org.jetbrains.annotations.NotNull\" />\n          <item index=\"1\" class=\"java.lang.String\" itemvalue=\"javax.annotation.Nonnull\" />\n          <item index=\"2\" class=\"java.lang.String\" itemvalue=\"edu.umd.cs.findbugs.annotations.NonNull\" />\n          <item index=\"3\" class=\"java.lang.String\" itemvalue=\"android.support.annotation.NonNull\" />\n          <item index=\"4\" class=\"java.lang.String\" itemvalue=\"androidx.annotation.NonNull\" />\n          <item index=\"5\" class=\"java.lang.String\" itemvalue=\"androidx.annotation.RecentlyNonNull\" />\n        </list>\n      </value>\n    </option>\n  </component>\n  <component name=\"ProjectRootManager\" version=\"2\" languageLevel=\"JDK_1_7\" project-jdk-name=\"1.8\" project-jdk-type=\"JavaSDK\">\n    <output url=\"file://$PROJECT_DIR$/build/classes\" />\n  </component>\n  <component name=\"ProjectType\">\n    <option name=\"id\" value=\"Android\" />\n  </component>\n</project>"
  },
  {
    "path": "MobileNetSSD_demo/app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "MobileNetSSD_demo/app/CMakeLists.txt",
    "content": "# For more information about using CMake with Android Studio, read the\n# documentation: https://d.android.com/studio/projects/add-native-code.html\n\n# Sets the minimum version of CMake required to build the native library.\n\ncmake_minimum_required(VERSION 3.4.1)\n\n# Creates and names a library, sets it as either STATIC\n# or SHARED, and provides the relative paths to its source code.\n# You can define multiple libraries, and CMake builds them for you.\n# Gradle automatically packages shared libraries with your APK.\n\n##需要添加\nset(ncnn_lib ${CMAKE_SOURCE_DIR}/src/main/jniLibs/armeabi-v7a/libncnn.a)\nadd_library (ncnn_lib STATIC IMPORTED)\nset_target_properties(ncnn_lib PROPERTIES IMPORTED_LOCATION ${ncnn_lib})\n\nadd_library( # Sets the name of the library.\n        MobileNetssd ## 为生成.so的文字最好直接和.c名字一样,需要更改\n\n        # Sets the library as a shared library.\n        SHARED\n\n        # Provides a relative path to your source file(s).\n        src/main/cpp/MobileNetssd.cpp)##cpp文件的name\n\n# Searches for a specified prebuilt library and stores the path as a\n# variable. Because CMake includes system libraries in the search path by\n# default, you only need to specify the name of the public NDK library\n# you want to add. CMake verifies that the library exists before\n# completing its build.\n\nfind_library( # Sets the name of the path variable.\n        log-lib\n\n        # Specifies the name of the NDK library that\n        # you want CMake to locate.\n        log)\n\n# Specifies libraries CMake should link to your target library. You\n# can link multiple libraries, such as libraries you define in this\n# build script, prebuilt third-party libraries, or system libraries.\n\ntarget_link_libraries( # Specifies the target library.\n        ##以下三个都要添加\n        MobileNetssd   #和上面一样\n        ncnn_lib       #这个ncnn的lib的add\n        jnigraphics    #这个jni也需要add\n\n        # Links the target library to the log library\n        # included in the NDK.\n        ${log-lib})"
  },
  {
    "path": "MobileNetSSD_demo/app/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 28\n    defaultConfig {\n        applicationId \"com.example.che.mobilenetssd_demo\"\n        minSdkVersion 15\n        targetSdkVersion 28\n        versionCode 1\n        versionName \"1.0\"\n        testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\n        externalNativeBuild {\n            cmake {\n                cppFlags \"-std=c++11 -fopenmp\"//c++,多线程 需要添加need to add\n                abiFilters \"armeabi-v7a\" // 手机的硬件架构，基本所有的硬件都适配\n            }\n        }\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n    externalNativeBuild {\n        cmake {\n            path \"CMakeLists.txt\"\n        }\n    }\n\n    // 需要添加 把 .a文件导入, .a为 ncnn make intall生成的里面的.a文件\n    sourceSets {\n        main {\n            jniLibs.srcDirs = [\"src/main/jniLibs\"]\n            jni.srcDirs = ['src/cpp']\n        }\n    }\n}\n\ndependencies {\n    implementation fileTree(dir: 'libs', include: ['*.jar'])\n    implementation 'com.android.support:appcompat-v7:28.0.0'\n    implementation 'com.android.support.constraint:constraint-layout:1.1.3'\n    testImplementation 'junit:junit:4.12'\n    implementation 'com.github.bumptech.glide:glide:4.3.1'   // need to add增加图片类 bumptech，build自动红线消失\n    androidTestImplementation 'com.android.support.test:runner:1.0.2'\n    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'\n}\n"
  },
  {
    "path": "MobileNetSSD_demo/app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguardFiles setting in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n\n# Uncomment this to preserve the line number information for\n# debugging stack traces.\n#-keepattributes SourceFile,LineNumberTable\n\n# If you keep the line number information, uncomment this to\n# hide the original source file name.\n#-renamesourcefileattribute SourceFile\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/androidTest/java/com/example/che/mobilenetssd_demo/ExampleInstrumentedTest.java",
    "content": "package com.example.che.mobilenetssd_demo;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\nimport android.support.test.runner.AndroidJUnit4;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport static org.junit.Assert.*;\n\n/**\n * Instrumented test, which will execute on an Android device.\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\n@RunWith(AndroidJUnit4.class)\npublic class ExampleInstrumentedTest {\n    @Test\n    public void useAppContext() {\n        // Context of the app under test.\n        Context appContext = InstrumentationRegistry.getTargetContext();\n\n        assertEquals(\"com.example.che.mobilenetssd_demo\", appContext.getPackageName());\n    }\n}\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.example.che.mobilenetssd_demo\">\n\n    <uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n    <uses-permission android:name=\"android.permission.CAMERA\"/>\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:roundIcon=\"@mipmap/ic_launcher_round\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme\">\n        <activity android:name=\".MainActivity\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/assets/words.txt",
    "content": "background\naeroplane\nbicycle\nbird\nboat\nbottle\nbus\ncar\ncat\nchair\ncow\ndiningtable\ndog\nhorse\nmotorbike\nperson\npottedplant\nsheep\nsofa\ntrain\ntvmonitor"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/cpp/MobileNetSSD_deploy.id.h",
    "content": "#ifndef NCNN_INCLUDE_GUARD_MobileNetSSD_deploy_id_h\n#define NCNN_INCLUDE_GUARD_MobileNetSSD_deploy_id_h\nnamespace MobileNetSSD_deploy_param_id {\nconst int LAYER_input = 0;\nconst int BLOB_data = 0;\nconst int LAYER_splitncnn_0 = 1;\nconst int BLOB_data_splitncnn_0 = 1;\nconst int BLOB_data_splitncnn_1 = 2;\nconst int BLOB_data_splitncnn_2 = 3;\nconst int BLOB_data_splitncnn_3 = 4;\nconst int BLOB_data_splitncnn_4 = 5;\nconst int BLOB_data_splitncnn_5 = 6;\nconst int BLOB_data_splitncnn_6 = 7;\nconst int LAYER_conv0 = 2;\nconst int BLOB_conv0 = 8;\nconst int LAYER_conv0_relu = 3;\nconst int BLOB_conv0_conv0_relu = 9;\nconst int LAYER_conv1_dw = 4;\nconst int BLOB_conv1_dw = 10;\nconst int LAYER_conv1_dw_relu = 5;\nconst int BLOB_conv1_dw_conv1_dw_relu = 11;\nconst int LAYER_conv1 = 6;\nconst int BLOB_conv1 = 12;\nconst int LAYER_conv1_relu = 7;\nconst int BLOB_conv1_conv1_relu = 13;\nconst int LAYER_conv2_dw = 8;\nconst int BLOB_conv2_dw = 14;\nconst int LAYER_conv2_dw_relu = 9;\nconst int BLOB_conv2_dw_conv2_dw_relu = 15;\nconst int LAYER_conv2 = 10;\nconst int BLOB_conv2 = 16;\nconst int LAYER_conv2_relu = 11;\nconst int BLOB_conv2_conv2_relu = 17;\nconst int LAYER_conv3_dw = 12;\nconst int BLOB_conv3_dw = 18;\nconst int LAYER_conv3_dw_relu = 13;\nconst int BLOB_conv3_dw_conv3_dw_relu = 19;\nconst int LAYER_conv3 = 14;\nconst int BLOB_conv3 = 20;\nconst int LAYER_conv3_relu = 15;\nconst int BLOB_conv3_conv3_relu = 21;\nconst int LAYER_conv4_dw = 16;\nconst int BLOB_conv4_dw = 22;\nconst int LAYER_conv4_dw_relu = 17;\nconst int BLOB_conv4_dw_conv4_dw_relu = 23;\nconst int LAYER_conv4 = 18;\nconst int BLOB_conv4 = 24;\nconst int LAYER_conv4_relu = 19;\nconst int BLOB_conv4_conv4_relu = 25;\nconst int LAYER_conv5_dw = 20;\nconst int BLOB_conv5_dw = 26;\nconst int LAYER_conv5_dw_relu = 21;\nconst int BLOB_conv5_dw_conv5_dw_relu = 27;\nconst int LAYER_conv5 = 22;\nconst int BLOB_conv5 = 28;\nconst int LAYER_conv5_relu = 23;\nconst int BLOB_conv5_conv5_relu = 29;\nconst int LAYER_conv6_dw = 24;\nconst int BLOB_conv6_dw = 30;\nconst int LAYER_conv6_dw_relu = 25;\nconst int BLOB_conv6_dw_conv6_dw_relu = 31;\nconst int LAYER_conv6 = 26;\nconst int BLOB_conv6 = 32;\nconst int LAYER_conv6_relu = 27;\nconst int BLOB_conv6_conv6_relu = 33;\nconst int LAYER_conv7_dw = 28;\nconst int BLOB_conv7_dw = 34;\nconst int LAYER_conv7_dw_relu = 29;\nconst int BLOB_conv7_dw_conv7_dw_relu = 35;\nconst int LAYER_conv7 = 30;\nconst int BLOB_conv7 = 36;\nconst int LAYER_conv7_relu = 31;\nconst int BLOB_conv7_conv7_relu = 37;\nconst int LAYER_conv8_dw = 32;\nconst int BLOB_conv8_dw = 38;\nconst int LAYER_conv8_dw_relu = 33;\nconst int BLOB_conv8_dw_conv8_dw_relu = 39;\nconst int LAYER_conv8 = 34;\nconst int BLOB_conv8 = 40;\nconst int LAYER_conv8_relu = 35;\nconst int BLOB_conv8_conv8_relu = 41;\nconst int LAYER_conv9_dw = 36;\nconst int BLOB_conv9_dw = 42;\nconst int LAYER_conv9_dw_relu = 37;\nconst int BLOB_conv9_dw_conv9_dw_relu = 43;\nconst int LAYER_conv9 = 38;\nconst int BLOB_conv9 = 44;\nconst int LAYER_conv9_relu = 39;\nconst int BLOB_conv9_conv9_relu = 45;\nconst int LAYER_conv10_dw = 40;\nconst int BLOB_conv10_dw = 46;\nconst int LAYER_conv10_dw_relu = 41;\nconst int BLOB_conv10_dw_conv10_dw_relu = 47;\nconst int LAYER_conv10 = 42;\nconst int BLOB_conv10 = 48;\nconst int LAYER_conv10_relu = 43;\nconst int BLOB_conv10_conv10_relu = 49;\nconst int LAYER_conv11_dw = 44;\nconst int BLOB_conv11_dw = 50;\nconst int LAYER_conv11_dw_relu = 45;\nconst int BLOB_conv11_dw_conv11_dw_relu = 51;\nconst int LAYER_conv11 = 46;\nconst int BLOB_conv11 = 52;\nconst int LAYER_conv11_relu = 47;\nconst int BLOB_conv11_conv11_relu = 53;\nconst int LAYER_splitncnn_1 = 48;\nconst int BLOB_conv11_conv11_relu_splitncnn_0 = 54;\nconst int BLOB_conv11_conv11_relu_splitncnn_1 = 55;\nconst int BLOB_conv11_conv11_relu_splitncnn_2 = 56;\nconst int BLOB_conv11_conv11_relu_splitncnn_3 = 57;\nconst int LAYER_conv12_dw = 49;\nconst int BLOB_conv12_dw = 58;\nconst int LAYER_conv12_dw_relu = 50;\nconst int BLOB_conv12_dw_conv12_dw_relu = 59;\nconst int LAYER_conv12 = 51;\nconst int BLOB_conv12 = 60;\nconst int LAYER_conv12_relu = 52;\nconst int BLOB_conv12_conv12_relu = 61;\nconst int LAYER_conv13_dw = 53;\nconst int BLOB_conv13_dw = 62;\nconst int LAYER_conv13_dw_relu = 54;\nconst int BLOB_conv13_dw_conv13_dw_relu = 63;\nconst int LAYER_conv13 = 55;\nconst int BLOB_conv13 = 64;\nconst int LAYER_conv13_relu = 56;\nconst int BLOB_conv13_conv13_relu = 65;\nconst int LAYER_splitncnn_2 = 57;\nconst int BLOB_conv13_conv13_relu_splitncnn_0 = 66;\nconst int BLOB_conv13_conv13_relu_splitncnn_1 = 67;\nconst int BLOB_conv13_conv13_relu_splitncnn_2 = 68;\nconst int BLOB_conv13_conv13_relu_splitncnn_3 = 69;\nconst int LAYER_conv14_1 = 58;\nconst int BLOB_conv14_1 = 70;\nconst int LAYER_conv14_1_relu = 59;\nconst int BLOB_conv14_1_conv14_1_relu = 71;\nconst int LAYER_conv14_2 = 60;\nconst int BLOB_conv14_2 = 72;\nconst int LAYER_conv14_2_relu = 61;\nconst int BLOB_conv14_2_conv14_2_relu = 73;\nconst int LAYER_splitncnn_3 = 62;\nconst int BLOB_conv14_2_conv14_2_relu_splitncnn_0 = 74;\nconst int BLOB_conv14_2_conv14_2_relu_splitncnn_1 = 75;\nconst int BLOB_conv14_2_conv14_2_relu_splitncnn_2 = 76;\nconst int BLOB_conv14_2_conv14_2_relu_splitncnn_3 = 77;\nconst int LAYER_conv15_1 = 63;\nconst int BLOB_conv15_1 = 78;\nconst int LAYER_conv15_1_relu = 64;\nconst int BLOB_conv15_1_conv15_1_relu = 79;\nconst int LAYER_conv15_2 = 65;\nconst int BLOB_conv15_2 = 80;\nconst int LAYER_conv15_2_relu = 66;\nconst int BLOB_conv15_2_conv15_2_relu = 81;\nconst int LAYER_splitncnn_4 = 67;\nconst int BLOB_conv15_2_conv15_2_relu_splitncnn_0 = 82;\nconst int BLOB_conv15_2_conv15_2_relu_splitncnn_1 = 83;\nconst int BLOB_conv15_2_conv15_2_relu_splitncnn_2 = 84;\nconst int BLOB_conv15_2_conv15_2_relu_splitncnn_3 = 85;\nconst int LAYER_conv16_1 = 68;\nconst int BLOB_conv16_1 = 86;\nconst int LAYER_conv16_1_relu = 69;\nconst int BLOB_conv16_1_conv16_1_relu = 87;\nconst int LAYER_conv16_2 = 70;\nconst int BLOB_conv16_2 = 88;\nconst int LAYER_conv16_2_relu = 71;\nconst int BLOB_conv16_2_conv16_2_relu = 89;\nconst int LAYER_splitncnn_5 = 72;\nconst int BLOB_conv16_2_conv16_2_relu_splitncnn_0 = 90;\nconst int BLOB_conv16_2_conv16_2_relu_splitncnn_1 = 91;\nconst int BLOB_conv16_2_conv16_2_relu_splitncnn_2 = 92;\nconst int BLOB_conv16_2_conv16_2_relu_splitncnn_3 = 93;\nconst int LAYER_conv17_1 = 73;\nconst int BLOB_conv17_1 = 94;\nconst int LAYER_conv17_1_relu = 74;\nconst int BLOB_conv17_1_conv17_1_relu = 95;\nconst int LAYER_conv17_2 = 75;\nconst int BLOB_conv17_2 = 96;\nconst int LAYER_conv17_2_relu = 76;\nconst int BLOB_conv17_2_conv17_2_relu = 97;\nconst int LAYER_splitncnn_6 = 77;\nconst int BLOB_conv17_2_conv17_2_relu_splitncnn_0 = 98;\nconst int BLOB_conv17_2_conv17_2_relu_splitncnn_1 = 99;\nconst int BLOB_conv17_2_conv17_2_relu_splitncnn_2 = 100;\nconst int LAYER_conv11_mbox_loc = 78;\nconst int BLOB_conv11_mbox_loc = 101;\nconst int LAYER_conv11_mbox_loc_perm = 79;\nconst int BLOB_conv11_mbox_loc_perm = 102;\nconst int LAYER_conv11_mbox_loc_flat = 80;\nconst int BLOB_conv11_mbox_loc_flat = 103;\nconst int LAYER_conv11_mbox_conf = 81;\nconst int BLOB_conv11_mbox_conf = 104;\nconst int LAYER_conv11_mbox_conf_perm = 82;\nconst int BLOB_conv11_mbox_conf_perm = 105;\nconst int LAYER_conv11_mbox_conf_flat = 83;\nconst int BLOB_conv11_mbox_conf_flat = 106;\nconst int LAYER_conv11_mbox_priorbox = 84;\nconst int BLOB_conv11_mbox_priorbox = 107;\nconst int LAYER_conv13_mbox_loc = 85;\nconst int BLOB_conv13_mbox_loc = 108;\nconst int LAYER_conv13_mbox_loc_perm = 86;\nconst int BLOB_conv13_mbox_loc_perm = 109;\nconst int LAYER_conv13_mbox_loc_flat = 87;\nconst int BLOB_conv13_mbox_loc_flat = 110;\nconst int LAYER_conv13_mbox_conf = 88;\nconst int BLOB_conv13_mbox_conf = 111;\nconst int LAYER_conv13_mbox_conf_perm = 89;\nconst int BLOB_conv13_mbox_conf_perm = 112;\nconst int LAYER_conv13_mbox_conf_flat = 90;\nconst int BLOB_conv13_mbox_conf_flat = 113;\nconst int LAYER_conv13_mbox_priorbox = 91;\nconst int BLOB_conv13_mbox_priorbox = 114;\nconst int LAYER_conv14_2_mbox_loc = 92;\nconst int BLOB_conv14_2_mbox_loc = 115;\nconst int LAYER_conv14_2_mbox_loc_perm = 93;\nconst int BLOB_conv14_2_mbox_loc_perm = 116;\nconst int LAYER_conv14_2_mbox_loc_flat = 94;\nconst int BLOB_conv14_2_mbox_loc_flat = 117;\nconst int LAYER_conv14_2_mbox_conf = 95;\nconst int BLOB_conv14_2_mbox_conf = 118;\nconst int LAYER_conv14_2_mbox_conf_perm = 96;\nconst int BLOB_conv14_2_mbox_conf_perm = 119;\nconst int LAYER_conv14_2_mbox_conf_flat = 97;\nconst int BLOB_conv14_2_mbox_conf_flat = 120;\nconst int LAYER_conv14_2_mbox_priorbox = 98;\nconst int BLOB_conv14_2_mbox_priorbox = 121;\nconst int LAYER_conv15_2_mbox_loc = 99;\nconst int BLOB_conv15_2_mbox_loc = 122;\nconst int LAYER_conv15_2_mbox_loc_perm = 100;\nconst int BLOB_conv15_2_mbox_loc_perm = 123;\nconst int LAYER_conv15_2_mbox_loc_flat = 101;\nconst int BLOB_conv15_2_mbox_loc_flat = 124;\nconst int LAYER_conv15_2_mbox_conf = 102;\nconst int BLOB_conv15_2_mbox_conf = 125;\nconst int LAYER_conv15_2_mbox_conf_perm = 103;\nconst int BLOB_conv15_2_mbox_conf_perm = 126;\nconst int LAYER_conv15_2_mbox_conf_flat = 104;\nconst int BLOB_conv15_2_mbox_conf_flat = 127;\nconst int LAYER_conv15_2_mbox_priorbox = 105;\nconst int BLOB_conv15_2_mbox_priorbox = 128;\nconst int LAYER_conv16_2_mbox_loc = 106;\nconst int BLOB_conv16_2_mbox_loc = 129;\nconst int LAYER_conv16_2_mbox_loc_perm = 107;\nconst int BLOB_conv16_2_mbox_loc_perm = 130;\nconst int LAYER_conv16_2_mbox_loc_flat = 108;\nconst int BLOB_conv16_2_mbox_loc_flat = 131;\nconst int LAYER_conv16_2_mbox_conf = 109;\nconst int BLOB_conv16_2_mbox_conf = 132;\nconst int LAYER_conv16_2_mbox_conf_perm = 110;\nconst int BLOB_conv16_2_mbox_conf_perm = 133;\nconst int LAYER_conv16_2_mbox_conf_flat = 111;\nconst int BLOB_conv16_2_mbox_conf_flat = 134;\nconst int LAYER_conv16_2_mbox_priorbox = 112;\nconst int BLOB_conv16_2_mbox_priorbox = 135;\nconst int LAYER_conv17_2_mbox_loc = 113;\nconst int BLOB_conv17_2_mbox_loc = 136;\nconst int LAYER_conv17_2_mbox_loc_perm = 114;\nconst int BLOB_conv17_2_mbox_loc_perm = 137;\nconst int LAYER_conv17_2_mbox_loc_flat = 115;\nconst int BLOB_conv17_2_mbox_loc_flat = 138;\nconst int LAYER_conv17_2_mbox_conf = 116;\nconst int BLOB_conv17_2_mbox_conf = 139;\nconst int LAYER_conv17_2_mbox_conf_perm = 117;\nconst int BLOB_conv17_2_mbox_conf_perm = 140;\nconst int LAYER_conv17_2_mbox_conf_flat = 118;\nconst int BLOB_conv17_2_mbox_conf_flat = 141;\nconst int LAYER_conv17_2_mbox_priorbox = 119;\nconst int BLOB_conv17_2_mbox_priorbox = 142;\nconst int LAYER_mbox_loc = 120;\nconst int BLOB_mbox_loc = 143;\nconst int LAYER_mbox_conf = 121;\nconst int BLOB_mbox_conf = 144;\nconst int LAYER_mbox_priorbox = 122;\nconst int BLOB_mbox_priorbox = 145;\nconst int LAYER_mbox_conf_reshape = 123;\nconst int BLOB_mbox_conf_reshape = 146;\nconst int LAYER_mbox_conf_softmax = 124;\nconst int BLOB_mbox_conf_softmax = 147;\nconst int LAYER_mbox_conf_flatten = 125;\nconst int BLOB_mbox_conf_flatten = 148;\nconst int LAYER_detection_out = 126;\nconst int BLOB_detection_out = 149;\n} // namespace MobileNetSSD_deploy_param_id\n#endif // NCNN_INCLUDE_GUARD_MobileNetSSD_deploy_id_h\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/cpp/MobileNetssd.cpp",
    "content": "#include <android/bitmap.h>\n#include <android/log.h>\n#include <jni.h>\n#include <string>\n#include <vector>\n\n// ncnn\n#include \"include/opencv.h\"\n#include \"MobileNetSSD_deploy.id.h\"   //这里看成自己的id.h\n#include <sys/time.h>\n#include <unistd.h>\n#include \"include/net.h\"\n\nstatic ncnn::UnlockedPoolAllocator g_blob_pool_allocator;\nstatic ncnn::PoolAllocator g_workspace_pool_allocator;\n\nstatic ncnn::Mat ncnn_param;\nstatic ncnn::Mat ncnn_bin;\nstatic ncnn::Net ncnn_net;\n\nextern \"C\" {\n\n\n// public native boolean Init(byte[] words,byte[] param, byte[] bin);　　原函数形式（c++） 以下形式为ndk的c++形式\nJNIEXPORT jboolean JNICALL\nJava_com_example_che_mobilenetssd_1demo_MobileNetssd_Init(JNIEnv *env, jobject obj, jbyteArray param, jbyteArray bin) {\n    __android_log_print(ANDROID_LOG_DEBUG, \"MobileNetssd\", \"enter the jni func\");\n    // init param\n    {\n        int len = env->GetArrayLength(param);\n        ncnn_param.create(len, (size_t) 1u);\n        env->GetByteArrayRegion(param, 0, len, (jbyte *) ncnn_param);\n        int ret = ncnn_net.load_param((const unsigned char *) ncnn_param);\n        __android_log_print(ANDROID_LOG_DEBUG, \"MobileNetssd\", \"load_param %d %d\", ret, len);\n    }\n\n    // init bin\n    {\n        int len = env->GetArrayLength(bin);\n        ncnn_bin.create(len, (size_t) 1u);\n        env->GetByteArrayRegion(bin, 0, len, (jbyte *) ncnn_bin);\n        int ret = ncnn_net.load_model((const unsigned char *) ncnn_bin);\n        __android_log_print(ANDROID_LOG_DEBUG, \"MobileNetssd\", \"load_model %d %d\", ret, len);\n    }\n\n    ncnn::Option opt;\n    opt.lightmode = true;\n    opt.num_threads = 4;   //线程 这里可以修改\n    opt.blob_allocator = &g_blob_pool_allocator;\n    opt.workspace_allocator = &g_workspace_pool_allocator;\n\n    ncnn::set_default_option(opt);\n\n    return JNI_TRUE;\n}\n\n// public native String Detect(Bitmap bitmap);\nJNIEXPORT jfloatArray JNICALL Java_com_example_che_mobilenetssd_1demo_MobileNetssd_Detect(JNIEnv* env, jobject thiz, jobject bitmap)\n{\n    // ncnn from bitmap\n    ncnn::Mat in;\n    {\n        AndroidBitmapInfo info;\n        AndroidBitmap_getInfo(env, bitmap, &info);\n//        int origin_w = info.width;\n//        int origin_h = info.height;\n//        int width = 300;\n//        int height = 300;\n        int width = info.width;\n        int height = info.height;\n        if (info.format != ANDROID_BITMAP_FORMAT_RGBA_8888)\n            return NULL;\n\n        void* indata;\n        AndroidBitmap_lockPixels(env, bitmap, &indata);\n        // 把像素转换成data，并指定通道顺序\n        // 因为图像预处理每个网络层输入的数据格式不一样一般为300*300 128*128等等所以这类需要一个resize的操作可以在cpp中写，也可以是java读入图片时有个resize操作\n//      in = ncnn::Mat::from_pixels_resize((const unsigned char*)indata, ncnn::Mat::PIXEL_RGBA2RGB, origin_w, origin_h, width, height);\n\n        in = ncnn::Mat::from_pixels((const unsigned char*)indata, ncnn::Mat::PIXEL_RGBA2RGB, width, height);\n\n        // 下面一行为debug代码\n        //__android_log_print(ANDROID_LOG_DEBUG, \"MobilenetssdJniIn\", \"Mobilenetssd_predict_has_input1, in.w: %d; in.h: %d\", in.w, in.h);\n        AndroidBitmap_unlockPixels(env, bitmap);\n    }\n\n    // ncnn_net\n    std::vector<float> cls_scores;\n    {\n        // 减去均值和乘上比例（这个数据和前面的归一化图片预处理形式一一对应）\n        const float mean_vals[3] = {127.5f, 127.5f, 127.5f};\n        const float scale[3] = {0.007843f, 0.007843f, 0.007843f};\n\n        in.substract_mean_normalize(mean_vals, scale);// 归一化\n\n        ncnn::Extractor ex = ncnn_net.create_extractor();//前向传播\n\n        // 如果不加密是使用ex.input(\"data\", in);\n        // BLOB_data在id.h文件中可见，相当于datainput网络层的id\n        ex.input(MobileNetSSD_deploy_param_id::BLOB_data, in);\n        //ex.set_num_threads(4); 和上面一样一个对象\n\n        ncnn::Mat out;\n        // 如果时不加密是使用ex.extract(\"prob\", out);\n        //BLOB_detection_out.h文件中可见，相当于dataout网络层的id,输出检测的结果数据\n        ex.extract(MobileNetSSD_deploy_param_id::BLOB_detection_out, out);\n\n        int output_wsize = out.w;\n        int output_hsize = out.h;\n\n        //输出整理\n        jfloat *output[output_wsize * output_hsize];   // float类型\n        for(int i = 0; i< out.h; i++) {\n            for (int j = 0; j < out.w; j++) {\n                output[i*output_wsize + j] = &out.row(i)[j];\n            }\n        }\n        //建立float数组 长度为 output_wsize * output_hsize,如果只是ouput_size相当于只有一行的out的数据那就是一个object检测数据\n        jfloatArray jOutputData = env->NewFloatArray(output_wsize * output_hsize);\n        if (jOutputData == nullptr) return nullptr;\n        env->SetFloatArrayRegion(jOutputData, 0,  output_wsize * output_hsize,\n                                 reinterpret_cast<const jfloat *>(*output));\n        return jOutputData;\n    }\n}\n}\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/cpp/include/allocator.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_ALLOCATOR_H\n#define NCNN_ALLOCATOR_H\n\n#ifdef _WIN32\n#define WIN32_LEAN_AND_MEAN\n#include <windows.h>\n#else\n#include <pthread.h>\n#endif\n\n#include <stdlib.h>\n#include <list>\n\nnamespace ncnn {\n\n// the alignment of all the allocated buffers\n#define MALLOC_ALIGN    16\n\n// Aligns a pointer to the specified number of bytes\n// ptr Aligned pointer\n// n Alignment size that must be a power of two\ntemplate<typename _Tp> static inline _Tp* alignPtr(_Tp* ptr, int n=(int)sizeof(_Tp))\n{\n    return (_Tp*)(((size_t)ptr + n-1) & -n);\n}\n\n// Aligns a buffer size to the specified number of bytes\n// The function returns the minimum number that is greater or equal to sz and is divisible by n\n// sz Buffer size to align\n// n Alignment size that must be a power of two\nstatic inline size_t alignSize(size_t sz, int n)\n{\n    return (sz + n-1) & -n;\n}\n\nstatic inline void* fastMalloc(size_t size)\n{\n    unsigned char* udata = (unsigned char*)malloc(size + sizeof(void*) + MALLOC_ALIGN);\n    if (!udata)\n        return 0;\n    unsigned char** adata = alignPtr((unsigned char**)udata + 1, MALLOC_ALIGN);\n    adata[-1] = udata;\n    return adata;\n}\n\nstatic inline void fastFree(void* ptr)\n{\n    if (ptr)\n    {\n        unsigned char* udata = ((unsigned char**)ptr)[-1];\n        free(udata);\n    }\n}\n\n// exchange-add operation for atomic operations on reference counters\n#if defined __INTEL_COMPILER && !(defined WIN32 || defined _WIN32)\n// atomic increment on the linux version of the Intel(tm) compiler\n#  define NCNN_XADD(addr, delta) (int)_InterlockedExchangeAdd(const_cast<void*>(reinterpret_cast<volatile void*>(addr)), delta)\n#elif defined __GNUC__\n#  if defined __clang__ && __clang_major__ >= 3 && !defined __ANDROID__ && !defined __EMSCRIPTEN__ && !defined(__CUDACC__)\n#    ifdef __ATOMIC_ACQ_REL\n#      define NCNN_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), delta, __ATOMIC_ACQ_REL)\n#    else\n#      define NCNN_XADD(addr, delta) __atomic_fetch_add((_Atomic(int)*)(addr), delta, 4)\n#    endif\n#  else\n#    if defined __ATOMIC_ACQ_REL && !defined __clang__\n// version for gcc >= 4.7\n#      define NCNN_XADD(addr, delta) (int)__atomic_fetch_add((unsigned*)(addr), (unsigned)(delta), __ATOMIC_ACQ_REL)\n#    else\n#      define NCNN_XADD(addr, delta) (int)__sync_fetch_and_add((unsigned*)(addr), (unsigned)(delta))\n#    endif\n#  endif\n#elif defined _MSC_VER && !defined RC_INVOKED\n#  include <intrin.h>\n#  define NCNN_XADD(addr, delta) (int)_InterlockedExchangeAdd((long volatile*)addr, delta)\n#else\n// thread-unsafe branch\nstatic inline int NCNN_XADD(int* addr, int delta) { int tmp = *addr; *addr += delta; return tmp; }\n#endif\n\n#ifdef _WIN32\nclass Mutex\n{\npublic:\n    Mutex() { InitializeSRWLock(&srwlock); }\n    ~Mutex() {}\n    void lock() { AcquireSRWLockExclusive(&srwlock); }\n    void unlock() { ReleaseSRWLockExclusive(&srwlock); }\nprivate:\n    // NOTE SRWLock is available from windows vista\n    SRWLOCK srwlock;\n};\n#else // _WIN32\nclass Mutex\n{\npublic:\n    Mutex() { pthread_mutex_init(&mutex, 0); }\n    ~Mutex() { pthread_mutex_destroy(&mutex); }\n    void lock() { pthread_mutex_lock(&mutex); }\n    void unlock() { pthread_mutex_unlock(&mutex); }\nprivate:\n    pthread_mutex_t mutex;\n};\n#endif // _WIN32\n\nclass Allocator\n{\npublic:\n    virtual ~Allocator() = 0;\n    virtual void* fastMalloc(size_t size) = 0;\n    virtual void fastFree(void* ptr) = 0;\n};\n\nclass PoolAllocator : public Allocator\n{\npublic:\n    PoolAllocator();\n    ~PoolAllocator();\n\n    // ratio range 0 ~ 1\n    // default cr = 0.75\n    void set_size_compare_ratio(float scr);\n\n    // release all budgets immediately\n    void clear();\n\n    virtual void* fastMalloc(size_t size);\n    virtual void fastFree(void* ptr);\n\nprivate:\n    Mutex budgets_lock;\n    Mutex payouts_lock;\n    unsigned int size_compare_ratio;// 0~256\n    std::list< std::pair<size_t, void*> > budgets;\n    std::list< std::pair<size_t, void*> > payouts;\n};\n\nclass UnlockedPoolAllocator : public Allocator\n{\npublic:\n    UnlockedPoolAllocator();\n    ~UnlockedPoolAllocator();\n\n    // ratio range 0 ~ 1\n    // default cr = 0.75\n    void set_size_compare_ratio(float scr);\n\n    // release all budgets immediately\n    void clear();\n\n    virtual void* fastMalloc(size_t size);\n    virtual void fastFree(void* ptr);\n\nprivate:\n    unsigned int size_compare_ratio;// 0~256\n    std::list< std::pair<size_t, void*> > budgets;\n    std::list< std::pair<size_t, void*> > payouts;\n};\n\n} // namespace ncnn\n\n#endif // NCNN_ALLOCATOR_H\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/cpp/include/benchmark.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_BENCHMARK_H\n#define NCNN_BENCHMARK_H\n\n#include \"platform.h\"\n#include \"mat.h\"\n#include \"layer.h\"\n\nnamespace ncnn {\n\n// get now timestamp in ms\ndouble get_current_time();\n\n#if NCNN_BENCHMARK\n\nvoid benchmark(const Layer* layer, double start, double end);\nvoid benchmark(const Layer* layer, const Mat& bottom_blob, Mat& top_blob, double start, double end);\n\n#endif // NCNN_BENCHMARK\n\n} // namespace ncnn\n\n#endif // NCNN_BENCHMARK_H\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/cpp/include/blob.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_BLOB_H\n#define NCNN_BLOB_H\n\n#include <string>\n#include <vector>\n#include \"platform.h\"\n\nnamespace ncnn {\n\nclass Blob\n{\npublic:\n    // empty\n    Blob();\n\npublic:\n#if NCNN_STRING\n    // blob name\n    std::string name;\n#endif // NCNN_STRING\n    // layer index which produce this blob as output\n    int producer;\n    // layer index which need this blob as input\n    std::vector<int> consumers;\n};\n\n} // namespace ncnn\n\n#endif // NCNN_BLOB_H\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/cpp/include/cpu.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_CPU_H\n#define NCNN_CPU_H\n\nnamespace ncnn {\n\n// test optional cpu features\n// neon = armv7 neon or aarch64 asimd\nint cpu_support_arm_neon();\n// vfpv4 = armv7 fp16 + fma\nint cpu_support_arm_vfpv4();\n// asimdhp = aarch64 asimd half precision\nint cpu_support_arm_asimdhp();\n\n// cpu info\nint get_cpu_count();\n\n// bind all threads on little clusters if powersave enabled\n// affacts HMP arch cpu like ARM big.LITTLE\n// only implemented on android at the moment\n// switching powersave is expensive and not thread-safe\n// 0 = all cores enabled(default)\n// 1 = only little clusters enabled\n// 2 = only big clusters enabled\n// return 0 if success for setter function\nint get_cpu_powersave();\nint set_cpu_powersave(int powersave);\n\n// misc function wrapper for openmp routines\nint get_omp_num_threads();\nvoid set_omp_num_threads(int num_threads);\n\nint get_omp_dynamic();\nvoid set_omp_dynamic(int dynamic);\n\n} // namespace ncnn\n\n#endif // NCNN_CPU_H\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/cpp/include/layer.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_LAYER_H\n#define NCNN_LAYER_H\n\n#include <stdio.h>\n#include <string>\n#include <vector>\n#include \"mat.h\"\n#include \"modelbin.h\"\n#include \"paramdict.h\"\n#include \"platform.h\"\n\nnamespace ncnn {\n\nclass Allocator;\nclass Option\n{\npublic:\n    // default option\n    Option();\n\npublic:\n    // light mode\n    // intermediate blob will be recycled when enabled\n    // enabled by default\n    bool lightmode;\n\n    // thread count\n    // default value is the one returned by get_cpu_count()\n    int num_threads;\n\n    // blob memory allocator\n    Allocator* blob_allocator;\n\n    // workspace memory allocator\n    Allocator* workspace_allocator;\n};\n\n// the global default option\nconst Option& get_default_option();\nint set_default_option(const Option& opt);\n\nclass Layer\n{\npublic:\n    // empty\n    Layer();\n    // virtual destructor\n    virtual ~Layer();\n\n    // load layer specific parameter from parsed dict\n    // return 0 if success\n    virtual int load_param(const ParamDict& pd);\n\n    // load layer specific weight data from model binary\n    // return 0 if success\n    virtual int load_model(const ModelBin& mb);\n\npublic:\n    // one input and one output blob\n    bool one_blob_only;\n\n    // support inplace inference\n    bool support_inplace;\n\npublic:\n    // implement inference\n    // return 0 if success\n    virtual int forward(const std::vector<Mat>& bottom_blobs, std::vector<Mat>& top_blobs, const Option& opt = get_default_option()) const;\n    virtual int forward(const Mat& bottom_blob, Mat& top_blob, const Option& opt = get_default_option()) const;\n\n    // implement inplace inference\n    // return 0 if success\n    virtual int forward_inplace(std::vector<Mat>& bottom_top_blobs, const Option& opt = get_default_option()) const;\n    virtual int forward_inplace(Mat& bottom_top_blob, const Option& opt = get_default_option()) const;\n\npublic:\n#if NCNN_STRING\n    // layer type name\n    std::string type;\n    // layer name\n    std::string name;\n#endif // NCNN_STRING\n    // blob index which this layer needs as input\n    std::vector<int> bottoms;\n    // blob index which this layer produces as output\n    std::vector<int> tops;\n};\n\n// layer factory function\ntypedef Layer* (*layer_creator_func)();\n\nstruct layer_registry_entry\n{\n#if NCNN_STRING\n    // layer type name\n    const char* name;\n#endif // NCNN_STRING\n    // layer factory entry\n    layer_creator_func creator;\n};\n\n#if NCNN_STRING\n// get layer type from type name\nint layer_to_index(const char* type);\n// create layer from type name\nLayer* create_layer(const char* type);\n#endif // NCNN_STRING\n// create layer from layer type\nLayer* create_layer(int index);\n\n#define DEFINE_LAYER_CREATOR(name) \\\n    ::ncnn::Layer* name##_layer_creator() { return new name; }\n\n} // namespace ncnn\n\n#endif // NCNN_LAYER_H\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/cpp/include/layer_type.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_LAYER_TYPE_H\n#define NCNN_LAYER_TYPE_H\n\nnamespace ncnn {\n\nnamespace LayerType {\nenum\n{\n#include \"layer_type_enum.h\"\n    CustomBit = (1<<8),\n};\n} // namespace LayerType\n\n} // namespace ncnn\n\n#endif // NCNN_LAYER_TYPE_H\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/cpp/include/layer_type_enum.h",
    "content": "// Layer Type Enum header\n//\n// This file is auto-generated by cmake, don't edit it.\n\nAbsVal = 0,\nArgMax = 1,\nBatchNorm = 2,\nBias = 3,\nBNLL = 4,\nConcat = 5,\nConvolution = 6,\nCrop = 7,\nDeconvolution = 8,\nDropout = 9,\nEltwise = 10,\nELU = 11,\nEmbed = 12,\nExp = 13,\nFlatten = 14,\nInnerProduct = 15,\nInput = 16,\nLog = 17,\nLRN = 18,\nMemoryData = 19,\nMVN = 20,\nPooling = 21,\nPower = 22,\nPReLU = 23,\nProposal = 24,\nReduction = 25,\nReLU = 26,\nReshape = 27,\nROIPooling = 28,\nScale = 29,\nSigmoid = 30,\nSlice = 31,\nSoftmax = 32,\nSplit = 33,\nSPP = 34,\nTanH = 35,\nThreshold = 36,\nTile = 37,\nRNN = 38,\nLSTM = 39,\nBinaryOp = 40,\nUnaryOp = 41,\nConvolutionDepthWise = 42,\nPadding = 43,\nSqueeze = 44,\nExpandDims = 45,\nNormalize = 46,\nPermute = 47,\nPriorBox = 48,\nDetectionOutput = 49,\nInterp = 50,\nDeconvolutionDepthWise = 51,\nShuffleChannel = 52,\nInstanceNorm = 53,\nClip = 54,\nReorg = 55,\nYoloDetectionOutput = 56,\nQuantize = 57,\nDequantize = 58,\nYolov3DetectionOutput = 59,\nPSROIPooling = 60,\nROIAlign = 61,\n\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/cpp/include/mat.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_MAT_H\n#define NCNN_MAT_H\n\n#include <stdlib.h>\n#include <string.h>\n#if __ARM_NEON\n#include <arm_neon.h>\n#endif\n#include \"allocator.h\"\n#include \"platform.h\"\n\nnamespace ncnn {\n\n// the three dimension matrix\nclass Mat\n{\npublic:\n    // empty\n    Mat();\n    // vec\n    Mat(int w, size_t elemsize = 4u, Allocator* allocator = 0);\n    // image\n    Mat(int w, int h, size_t elemsize = 4u, Allocator* allocator = 0);\n    // dim\n    Mat(int w, int h, int c, size_t elemsize = 4u, Allocator* allocator = 0);\n    // copy\n    Mat(const Mat& m);\n    // external vec\n    Mat(int w, void* data, size_t elemsize = 4u, Allocator* allocator = 0);\n    // external image\n    Mat(int w, int h, void* data, size_t elemsize = 4u, Allocator* allocator = 0);\n    // external dim\n    Mat(int w, int h, int c, void* data, size_t elemsize = 4u, Allocator* allocator = 0);\n    // release\n    ~Mat();\n    // assign\n    Mat& operator=(const Mat& m);\n    // set all\n    void fill(float v);\n    void fill(int v);\n    template <typename T> void fill(T v);\n    // deep copy\n    Mat clone(Allocator* allocator = 0) const;\n    // reshape vec\n    Mat reshape(int w, Allocator* allocator = 0) const;\n    // reshape image\n    Mat reshape(int w, int h, Allocator* allocator = 0) const;\n    // reshape dim\n    Mat reshape(int w, int h, int c, Allocator* allocator = 0) const;\n    // allocate vec\n    void create(int w, size_t elemsize = 4u, Allocator* allocator = 0);\n    // allocate image\n    void create(int w, int h, size_t elemsize = 4u, Allocator* allocator = 0);\n    // allocate dim\n    void create(int w, int h, int c, size_t elemsize = 4u, Allocator* allocator = 0);\n    // refcount++\n    void addref();\n    // refcount--\n    void release();\n\n    bool empty() const;\n    size_t total() const;\n\n    // data reference\n    Mat channel(int c);\n    const Mat channel(int c) const;\n    float* row(int y);\n    const float* row(int y) const;\n    template<typename T> T* row(int y);\n    template<typename T> const T* row(int y) const;\n\n    // range reference\n    Mat channel_range(int c, int channels);\n    const Mat channel_range(int c, int channels) const;\n    Mat row_range(int y, int rows);\n    const Mat row_range(int y, int rows) const;\n    Mat range(int x, int n);\n    const Mat range(int x, int n) const;\n\n    // access raw data\n    template<typename T> operator T*();\n    template<typename T> operator const T*() const;\n\n    // convenient access float vec element\n    float& operator[](int i);\n    const float& operator[](int i) const;\n\n#if NCNN_PIXEL\n    enum\n    {\n        PIXEL_CONVERT_SHIFT = 16,\n        PIXEL_FORMAT_MASK = 0x0000ffff,\n        PIXEL_CONVERT_MASK = 0xffff0000,\n\n        PIXEL_RGB       = 1,\n        PIXEL_BGR       = (1 << 1),\n        PIXEL_GRAY      = (1 << 2),\n        PIXEL_RGBA      = (1 << 3),\n\n        PIXEL_RGB2BGR   = PIXEL_RGB | (PIXEL_BGR << PIXEL_CONVERT_SHIFT),\n        PIXEL_RGB2GRAY  = PIXEL_RGB | (PIXEL_GRAY << PIXEL_CONVERT_SHIFT),\n\n        PIXEL_BGR2RGB   = PIXEL_BGR | (PIXEL_RGB << PIXEL_CONVERT_SHIFT),\n        PIXEL_BGR2GRAY  = PIXEL_BGR | (PIXEL_GRAY << PIXEL_CONVERT_SHIFT),\n\n        PIXEL_GRAY2RGB  = PIXEL_GRAY | (PIXEL_RGB << PIXEL_CONVERT_SHIFT),\n        PIXEL_GRAY2BGR  = PIXEL_GRAY | (PIXEL_BGR << PIXEL_CONVERT_SHIFT),\n\n        PIXEL_RGBA2RGB  = PIXEL_RGBA | (PIXEL_RGB << PIXEL_CONVERT_SHIFT),\n        PIXEL_RGBA2BGR  = PIXEL_RGBA | (PIXEL_BGR << PIXEL_CONVERT_SHIFT),\n        PIXEL_RGBA2GRAY = PIXEL_RGBA | (PIXEL_GRAY << PIXEL_CONVERT_SHIFT),\n    };\n    // convenient construct from pixel data\n    static Mat from_pixels(const unsigned char* pixels, int type, int w, int h, Allocator* allocator = 0);\n    // convenient construct from pixel data and resize to specific size\n    static Mat from_pixels_resize(const unsigned char* pixels, int type, int w, int h, int target_width, int target_height, Allocator* allocator = 0);\n\n    // convenient export to pixel data\n    void to_pixels(unsigned char* pixels, int type) const;\n    // convenient export to pixel data and resize to specific size\n    void to_pixels_resize(unsigned char* pixels, int type, int target_width, int target_height) const;\n#endif // NCNN_PIXEL\n\n    // substract channel-wise mean values, then multiply by normalize values, pass 0 to skip\n    void substract_mean_normalize(const float* mean_vals, const float* norm_vals);\n\n    // convenient construct from half precisoin floating point data\n    static Mat from_float16(const unsigned short* data, int size);\n\n    // pointer to the data\n    void* data;\n\n    // pointer to the reference counter\n    // when points to user-allocated data, the pointer is NULL\n    int* refcount;\n\n    // element size in bytes\n    // 4 = float32/int32\n    // 2 = float16\n    // 1 = int8/uint8\n    // 0 = empty\n    size_t elemsize;\n\n    // the allocator\n    Allocator* allocator;\n\n    // the dimensionality\n    int dims;\n\n    int w;\n    int h;\n    int c;\n\n    size_t cstep;\n};\n\n// misc function\n#if NCNN_PIXEL\n// convert yuv420sp(nv21) to rgb, the fast approximate version\nvoid yuv420sp2rgb(const unsigned char* yuv420sp, int w, int h, unsigned char* rgb);\n// image pixel bilinear resize\nvoid resize_bilinear_c1(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h);\nvoid resize_bilinear_c2(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h);\nvoid resize_bilinear_c3(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h);\nvoid resize_bilinear_c4(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h);\n// image pixel bilinear resize, convenient wrapper for yuv420sp(nv21)\nvoid resize_bilinear_yuv420sp(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h);\n#endif // NCNN_PIXEL\n\n// mat process\nenum\n{\n    BORDER_CONSTANT = 0,\n    BORDER_REPLICATE = 1,\n};\nvoid copy_make_border(const Mat& src, Mat& dst, int top, int bottom, int left, int right, int type, float v, Allocator* allocator = 0, int num_threads = 1);\nvoid copy_cut_border(const Mat& src, Mat& dst, int top, int bottom, int left, int right, Allocator* allocator = 0, int num_threads = 1);\nvoid resize_bilinear(const Mat& src, Mat& dst, int w, int h, Allocator* allocator = 0, int num_threads = 1);\n\ninline Mat::Mat()\n    : data(0), refcount(0), elemsize(0), allocator(0), dims(0), w(0), h(0), c(0), cstep(0)\n{\n}\n\ninline Mat::Mat(int _w, size_t _elemsize, Allocator* allocator)\n    : data(0), refcount(0), dims(0)\n{\n    create(_w, _elemsize, allocator);\n}\n\ninline Mat::Mat(int _w, int _h, size_t _elemsize, Allocator* allocator)\n    : data(0), refcount(0), dims(0)\n{\n    create(_w, _h, _elemsize, allocator);\n}\n\ninline Mat::Mat(int _w, int _h, int _c, size_t _elemsize, Allocator* allocator)\n    : data(0), refcount(0), dims(0)\n{\n    create(_w, _h, _c, _elemsize, allocator);\n}\n\ninline Mat::Mat(const Mat& m)\n    : data(m.data), refcount(m.refcount), elemsize(m.elemsize), allocator(m.allocator), dims(m.dims)\n{\n    if (refcount)\n        NCNN_XADD(refcount, 1);\n\n    w = m.w;\n    h = m.h;\n    c = m.c;\n\n    cstep = m.cstep;\n}\n\ninline Mat::Mat(int _w, void* _data, size_t _elemsize, Allocator* _allocator)\n    : data(_data), refcount(0), elemsize(_elemsize), allocator(_allocator), dims(1)\n{\n    w = _w;\n    h = 1;\n    c = 1;\n\n    cstep = w;\n}\n\ninline Mat::Mat(int _w, int _h, void* _data, size_t _elemsize, Allocator* _allocator)\n    : data(_data), refcount(0), elemsize(_elemsize), allocator(_allocator), dims(2)\n{\n    w = _w;\n    h = _h;\n    c = 1;\n\n    cstep = w * h;\n}\n\ninline Mat::Mat(int _w, int _h, int _c, void* _data, size_t _elemsize, Allocator* _allocator)\n    : data(_data), refcount(0), elemsize(_elemsize), allocator(_allocator), dims(3)\n{\n    w = _w;\n    h = _h;\n    c = _c;\n\n    cstep = alignSize(w * h * elemsize, 16) / elemsize;\n}\n\ninline Mat::~Mat()\n{\n    release();\n}\n\ninline Mat& Mat::operator=(const Mat& m)\n{\n    if (this == &m)\n        return *this;\n\n    if (m.refcount)\n        NCNN_XADD(m.refcount, 1);\n\n    release();\n\n    data = m.data;\n    refcount = m.refcount;\n    elemsize = m.elemsize;\n    allocator = m.allocator;\n\n    dims = m.dims;\n    w = m.w;\n    h = m.h;\n    c = m.c;\n\n    cstep = m.cstep;\n\n    return *this;\n}\n\ninline void Mat::fill(float _v)\n{\n    int size = total();\n    float* ptr = (float*)data;\n\n#if __ARM_NEON\n    int nn = size >> 2;\n    int remain = size - (nn << 2);\n#else\n    int remain = size;\n#endif // __ARM_NEON\n\n#if __ARM_NEON\n    float32x4_t _c = vdupq_n_f32(_v);\n#if __aarch64__\n    if (nn > 0)\n    {\n    asm volatile (\n        \"0:                             \\n\"\n        \"subs       %w0, %w0, #1        \\n\"\n        \"st1        {%4.4s}, [%1], #16  \\n\"\n        \"bne        0b                  \\n\"\n        : \"=r\"(nn),     // %0\n          \"=r\"(ptr)     // %1\n        : \"0\"(nn),\n          \"1\"(ptr),\n          \"w\"(_c)       // %4\n        : \"cc\", \"memory\"\n    );\n    }\n#else\n    if (nn > 0)\n    {\n    asm volatile(\n        \"0:                             \\n\"\n        \"subs       %0, #1              \\n\"\n        \"vst1.f32   {%e4-%f4}, [%1 :128]!\\n\"\n        \"bne        0b                  \\n\"\n        : \"=r\"(nn),     // %0\n          \"=r\"(ptr)     // %1\n        : \"0\"(nn),\n          \"1\"(ptr),\n          \"w\"(_c)       // %4\n        : \"cc\", \"memory\"\n    );\n    }\n#endif // __aarch64__\n#endif // __ARM_NEON\n    for (; remain>0; remain--)\n    {\n        *ptr++ = _v;\n    }\n}\n\ninline void Mat::fill(int _v)\n{\n    int size = total();\n    int* ptr = (int*)data;\n\n#if __ARM_NEON\n    int nn = size >> 2;\n    int remain = size - (nn << 2);\n#else\n    int remain = size;\n#endif // __ARM_NEON\n\n#if __ARM_NEON\n    int32x4_t _c = vdupq_n_s32(_v);\n#if __aarch64__\n    if (nn > 0)\n    {\n    asm volatile (\n        \"0:                             \\n\"\n        \"subs       %w0, %w0, #1        \\n\"\n        \"st1        {%4.4s}, [%1], #16  \\n\"\n        \"bne        0b                  \\n\"\n        : \"=r\"(nn),     // %0\n          \"=r\"(ptr)     // %1\n        : \"0\"(nn),\n          \"1\"(ptr),\n          \"w\"(_c)       // %4\n        : \"cc\", \"memory\"\n    );\n    }\n#else\n    if (nn > 0)\n    {\n    asm volatile(\n        \"0:                             \\n\"\n        \"subs       %0, #1              \\n\"\n        \"vst1.s32   {%e4-%f4}, [%1 :128]!\\n\"\n        \"bne        0b                  \\n\"\n        : \"=r\"(nn),     // %0\n          \"=r\"(ptr)     // %1\n        : \"0\"(nn),\n          \"1\"(ptr),\n          \"w\"(_c)       // %4\n        : \"cc\", \"memory\"\n    );\n    }\n#endif // __aarch64__\n#endif // __ARM_NEON\n    for (; remain>0; remain--)\n    {\n        *ptr++ = _v;\n    }\n}\n\ntemplate <typename T>\ninline void Mat::fill(T _v)\n{\n    int size = total();\n    T* ptr = (T*)data;\n    for (int i=0; i<size; i++)\n    {\n        ptr[i] = _v;\n    }\n}\n\ninline Mat Mat::clone(Allocator* allocator) const\n{\n    if (empty())\n        return Mat();\n\n    Mat m;\n    if (dims == 1)\n        m.create(w, elemsize, allocator);\n    else if (dims == 2)\n        m.create(w, h, elemsize, allocator);\n    else if (dims == 3)\n        m.create(w, h, c, elemsize, allocator);\n\n    if (total() > 0)\n    {\n        memcpy(m.data, data, total() * elemsize);\n    }\n\n    return m;\n}\n\ninline Mat Mat::reshape(int _w, Allocator* allocator) const\n{\n    if (w * h * c != _w)\n        return Mat();\n\n    if (dims == 3 && cstep != (size_t)w * h)\n    {\n        Mat m;\n        m.create(_w, elemsize, allocator);\n\n        // flatten\n        for (int i=0; i<c; i++)\n        {\n            const void* ptr = (unsigned char*)data + i * cstep * elemsize;\n            void* mptr = (unsigned char*)m.data + i * w * h * elemsize;\n            memcpy(mptr, ptr, w * h * elemsize);\n        }\n\n        return m;\n    }\n\n    Mat m = *this;\n\n    m.dims = 1;\n    m.w = _w;\n    m.h = 1;\n    m.c = 1;\n\n    m.cstep = _w;\n\n    return m;\n}\n\ninline Mat Mat::reshape(int _w, int _h, Allocator* allocator) const\n{\n    if (w * h * c != _w * _h)\n        return Mat();\n\n    if (dims == 3 && cstep != (size_t)w * h)\n    {\n        Mat m;\n        m.create(_w, _h, elemsize, allocator);\n\n        // flatten\n        for (int i=0; i<c; i++)\n        {\n            const void* ptr = (unsigned char*)data + i * cstep * elemsize;\n            void* mptr = (unsigned char*)m.data + i * w * h * elemsize;\n            memcpy(mptr, ptr, w * h * elemsize);\n        }\n\n        return m;\n    }\n\n    Mat m = *this;\n\n    m.dims = 2;\n    m.w = _w;\n    m.h = _h;\n    m.c = 1;\n\n    m.cstep = _w * _h;\n\n    return m;\n}\n\ninline Mat Mat::reshape(int _w, int _h, int _c, Allocator* allocator) const\n{\n    if (w * h * c != _w * _h * _c)\n        return Mat();\n\n    if (dims < 3)\n    {\n        if ((size_t)_w * _h != alignSize(_w * _h * elemsize, 16) / elemsize)\n        {\n            Mat m;\n            m.create(_w, _h, _c, elemsize, allocator);\n\n            // align channel\n            for (int i=0; i<_c; i++)\n            {\n                const void* ptr = (unsigned char*)data + i * _w * _h * elemsize;\n                void* mptr = (unsigned char*)m.data + i * m.cstep * m.elemsize;\n                memcpy(mptr, ptr, _w * _h * elemsize);\n            }\n\n            return m;\n        }\n    }\n    else if (c != _c)\n    {\n        // flatten and then align\n        Mat tmp = reshape(_w * _h * _c, allocator);\n        return tmp.reshape(_w, _h, _c, allocator);\n    }\n\n    Mat m = *this;\n\n    m.dims = 3;\n    m.w = _w;\n    m.h = _h;\n    m.c = _c;\n\n    m.cstep = alignSize(_w * _h * elemsize, 16) / elemsize;\n\n    return m;\n}\n\ninline void Mat::create(int _w, size_t _elemsize, Allocator* _allocator)\n{\n    if (dims == 1 && w == _w && elemsize == _elemsize && allocator == _allocator)\n        return;\n\n    release();\n\n    elemsize = _elemsize;\n    allocator = _allocator;\n\n    dims = 1;\n    w = _w;\n    h = 1;\n    c = 1;\n\n    cstep = w;\n\n    if (total() > 0)\n    {\n        size_t totalsize = alignSize(total() * elemsize, 4);\n        if (allocator)\n            data = allocator->fastMalloc(totalsize + (int)sizeof(*refcount));\n        else\n            data = fastMalloc(totalsize + (int)sizeof(*refcount));\n        refcount = (int*)(((unsigned char*)data) + totalsize);\n        *refcount = 1;\n    }\n}\n\ninline void Mat::create(int _w, int _h, size_t _elemsize, Allocator* _allocator)\n{\n    if (dims == 2 && w == _w && h == _h && elemsize == _elemsize && allocator == _allocator)\n        return;\n\n    release();\n\n    elemsize = _elemsize;\n    allocator = _allocator;\n\n    dims = 2;\n    w = _w;\n    h = _h;\n    c = 1;\n\n    cstep = w * h;\n\n    if (total() > 0)\n    {\n        size_t totalsize = alignSize(total() * elemsize, 4);\n        if (allocator)\n            data = allocator->fastMalloc(totalsize + (int)sizeof(*refcount));\n        else\n            data = fastMalloc(totalsize + (int)sizeof(*refcount));\n        refcount = (int*)(((unsigned char*)data) + totalsize);\n        *refcount = 1;\n    }\n}\n\ninline void Mat::create(int _w, int _h, int _c, size_t _elemsize, Allocator* _allocator)\n{\n    if (dims == 3 && w == _w && h == _h && c == _c && elemsize == _elemsize && allocator == _allocator)\n        return;\n\n    release();\n\n    elemsize = _elemsize;\n    allocator = _allocator;\n\n    dims = 3;\n    w = _w;\n    h = _h;\n    c = _c;\n\n    cstep = alignSize(w * h * elemsize, 16) / elemsize;\n\n    if (total() > 0)\n    {\n        size_t totalsize = alignSize(total() * elemsize, 4);\n        if (allocator)\n            data = allocator->fastMalloc(totalsize + (int)sizeof(*refcount));\n        else\n            data = fastMalloc(totalsize + (int)sizeof(*refcount));\n        refcount = (int*)(((unsigned char*)data) + totalsize);\n        *refcount = 1;\n    }\n}\n\ninline void Mat::addref()\n{\n    if (refcount)\n        NCNN_XADD(refcount, 1);\n}\n\ninline void Mat::release()\n{\n    if (refcount && NCNN_XADD(refcount, -1) == 1)\n    {\n        if (allocator)\n            allocator->fastFree(data);\n        else\n            fastFree(data);\n    }\n\n    data = 0;\n\n    elemsize = 0;\n\n    dims = 0;\n    w = 0;\n    h = 0;\n    c = 0;\n\n    cstep = 0;\n\n    refcount = 0;\n}\n\ninline bool Mat::empty() const\n{\n    return data == 0 || total() == 0;\n}\n\ninline size_t Mat::total() const\n{\n    return cstep * c;\n}\n\ninline Mat Mat::channel(int c)\n{\n    return Mat(w, h, (unsigned char*)data + cstep * c * elemsize, elemsize, allocator);\n}\n\ninline const Mat Mat::channel(int c) const\n{\n    return Mat(w, h, (unsigned char*)data + cstep * c * elemsize, elemsize, allocator);\n}\n\ninline float* Mat::row(int y)\n{\n    return (float*)data + w * y;\n}\n\ninline const float* Mat::row(int y) const\n{\n    return (const float*)data + w * y;\n}\n\ntemplate <typename T>\ninline T* Mat::row(int y)\n{\n    return (T*)data + w * y;\n}\n\ntemplate <typename T>\ninline const T* Mat::row(int y) const\n{\n    return (const T*)data + w * y;\n}\n\ninline Mat Mat::channel_range(int _c, int channels)\n{\n    return Mat(w, h, channels, (unsigned char*)data + cstep * _c * elemsize, elemsize, allocator);\n}\n\ninline const Mat Mat::channel_range(int _c, int channels) const\n{\n    return Mat(w, h, channels, (unsigned char*)data + cstep * _c * elemsize, elemsize, allocator);\n}\n\ninline Mat Mat::row_range(int y, int rows)\n{\n    return Mat(w, rows, (unsigned char*)data + w * y * elemsize, elemsize, allocator);\n}\n\ninline const Mat Mat::row_range(int y, int rows) const\n{\n    return Mat(w, rows, (unsigned char*)data + w * y * elemsize, elemsize, allocator);\n}\n\ninline Mat Mat::range(int x, int n)\n{\n    return Mat(n, (unsigned char*)data + x * elemsize, elemsize, allocator);\n}\n\ninline const Mat Mat::range(int x, int n) const\n{\n    return Mat(n, (unsigned char*)data + x * elemsize, elemsize, allocator);\n}\n\ntemplate <typename T>\ninline Mat::operator T*()\n{\n    return (T*)data;\n}\n\ntemplate <typename T>\ninline Mat::operator const T*() const\n{\n    return (const T*)data;\n}\n\ninline float& Mat::operator[](int i)\n{\n    return ((float*)data)[i];\n}\n\ninline const float& Mat::operator[](int i) const\n{\n    return ((const float*)data)[i];\n}\n\n} // namespace ncnn\n\n#endif // NCNN_MAT_H\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/cpp/include/modelbin.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_MODELBIN_H\n#define NCNN_MODELBIN_H\n\n#include <stdio.h>\n#include \"mat.h\"\n#include \"platform.h\"\n\nnamespace ncnn {\n\nclass Net;\nclass ModelBin\n{\npublic:\n    // element type\n    // 0 = auto\n    // 1 = float32\n    // 2 = float16\n    // 3 = int8\n    // load vec\n    virtual Mat load(int w, int type) const = 0;\n    // load image\n    virtual Mat load(int w, int h, int type) const;\n    // load dim\n    virtual Mat load(int w, int h, int c, int type) const;\n};\n\n#if NCNN_STDIO\nclass ModelBinFromStdio : public ModelBin\n{\npublic:\n    // construct from file\n    ModelBinFromStdio(FILE* binfp);\n\n    virtual Mat load(int w, int type) const;\n\nprotected:\n    FILE* binfp;\n};\n#endif // NCNN_STDIO\n\nclass ModelBinFromMemory : public ModelBin\n{\npublic:\n    // construct from external memory\n    ModelBinFromMemory(const unsigned char*& mem);\n\n    virtual Mat load(int w, int type) const;\n\nprotected:\n    const unsigned char*& mem;\n};\n\nclass ModelBinFromMatArray : public ModelBin\n{\npublic:\n    // construct from weight blob array\n    ModelBinFromMatArray(const Mat* weights);\n\n    virtual Mat load(int w, int type) const;\n\nprotected:\n    mutable const Mat* weights;\n};\n\n} // namespace ncnn\n\n#endif // NCNN_MODELBIN_H\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/cpp/include/net.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_NET_H\n#define NCNN_NET_H\n\n#include <stdio.h>\n#include <vector>\n#include \"blob.h\"\n#include \"layer.h\"\n#include \"mat.h\"\n#include \"platform.h\"\n\nnamespace ncnn {\n\nclass Extractor;\nclass Net\n{\npublic:\n    // empty init\n    Net();\n    // clear and destroy\n    ~Net();\n\n#if NCNN_STRING\n    // register custom layer by layer type name\n    // return 0 if success\n    int register_custom_layer(const char* type, layer_creator_func creator);\n#endif // NCNN_STRING\n    // register custom layer by layer type\n    // return 0 if success\n    int register_custom_layer(int index, layer_creator_func creator);\n\n#if NCNN_STDIO\n#if NCNN_STRING\n    // load network structure from plain param file\n    // return 0 if success\n    int load_param(FILE* fp);\n    int load_param(const char* protopath);\n    int load_param_mem(const char* mem);\n#endif // NCNN_STRING\n    // load network structure from binary param file\n    // return 0 if success\n    int load_param_bin(FILE* fp);\n    int load_param_bin(const char* protopath);\n\n    // load network weight data from model file\n    // return 0 if success\n    int load_model(FILE* fp);\n    int load_model(const char* modelpath);\n#endif // NCNN_STDIO\n\n    // load network structure from external memory\n    // memory pointer must be 32-bit aligned\n    // return bytes consumed\n    int load_param(const unsigned char* mem);\n\n    // reference network weight data from external memory\n    // weight data is not copied but referenced\n    // so external memory should be retained when used\n    // memory pointer must be 32-bit aligned\n    // return bytes consumed\n    int load_model(const unsigned char* mem);\n\n    // unload network structure and weight data\n    void clear();\n\n    // construct an Extractor from network\n    Extractor create_extractor() const;\n\npublic:\n    // enable winograd convolution optimization\n    // improve convolution 3x3 stride1 performace, may consume more memory\n    // changes should be applied before loading network structure and weight\n    // enabled by default\n    int use_winograd_convolution;\n\n    // enable sgemm convolution optimization\n    // improve convolution 1x1 stride1 performace, may consume more memory\n    // changes should be applied before loading network structure and weight\n    // enabled by default\n    int use_sgemm_convolution;\n\n    // enable quantized int8 inference\n    // use low-precision int8 path for quantized model\n    // changes should be applied before loading network structure and weight\n    // enabled by default\n    int use_int8_inference;\n\nprotected:\n    friend class Extractor;\n#if NCNN_STRING\n    int find_blob_index_by_name(const char* name) const;\n    int find_layer_index_by_name(const char* name) const;\n    int custom_layer_to_index(const char* type);\n    Layer* create_custom_layer(const char* type);\n#endif // NCNN_STRING\n    Layer* create_custom_layer(int index);\n    int forward_layer(int layer_index, std::vector<Mat>& blob_mats, Option& opt) const;\n\nprotected:\n    std::vector<Blob> blobs;\n    std::vector<Layer*> layers;\n\n    std::vector<layer_registry_entry> custom_layer_registry;\n};\n\nclass Extractor\n{\npublic:\n    // enable light mode\n    // intermediate blob will be recycled when enabled\n    // enabled by default\n    void set_light_mode(bool enable);\n\n    // set thread count for this extractor\n    // this will overwrite the global setting\n    // default count is system depended\n    void set_num_threads(int num_threads);\n\n    // set blob memory allocator\n    void set_blob_allocator(Allocator* allocator);\n\n    // set workspace memory allocator\n    void set_workspace_allocator(Allocator* allocator);\n\n#if NCNN_STRING\n    // set input by blob name\n    // return 0 if success\n    int input(const char* blob_name, const Mat& in);\n\n    // get result by blob name\n    // return 0 if success\n    int extract(const char* blob_name, Mat& feat);\n#endif // NCNN_STRING\n\n    // set input by blob index\n    // return 0 if success\n    int input(int blob_index, const Mat& in);\n\n    // get result by blob index\n    // return 0 if success\n    int extract(int blob_index, Mat& feat);\n\nprotected:\n    friend Extractor Net::create_extractor() const;\n    Extractor(const Net* net, int blob_count);\n\nprivate:\n    const Net* net;\n    std::vector<Mat> blob_mats;\n    Option opt;\n};\n\n} // namespace ncnn\n\n#endif // NCNN_NET_H\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/cpp/include/opencv.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_OPENCV_H\n#define NCNN_OPENCV_H\n\n#include \"platform.h\"\n\n#if NCNN_OPENCV\n\n#include <algorithm>\n#include <string>\n#include \"mat.h\"\n\n// minimal opencv style data structure implementation\nnamespace cv\n{\n\nstruct Size\n{\n    Size() : width(0), height(0) {}\n    Size(int _w, int _h) : width(_w), height(_h) {}\n\n    int width;\n    int height;\n};\n\ntemplate<typename _Tp>\nstruct Rect_\n{\n    Rect_() : x(0), y(0), width(0), height(0) {}\n    Rect_(_Tp _x, _Tp _y, _Tp _w, _Tp _h) : x(_x), y(_y), width(_w), height(_h) {}\n\n    _Tp x;\n    _Tp y;\n    _Tp width;\n    _Tp height;\n\n    // area\n    _Tp area() const\n    {\n        return width * height;\n    }\n};\n\ntemplate<typename _Tp> static inline Rect_<_Tp>& operator &= ( Rect_<_Tp>& a, const Rect_<_Tp>& b )\n{\n    _Tp x1 = std::max(a.x, b.x), y1 = std::max(a.y, b.y);\n    a.width = std::min(a.x + a.width, b.x + b.width) - x1;\n    a.height = std::min(a.y + a.height, b.y + b.height) - y1;\n    a.x = x1; a.y = y1;\n    if( a.width <= 0 || a.height <= 0 )\n        a = Rect_<_Tp>();\n    return a;\n}\n\ntemplate<typename _Tp> static inline Rect_<_Tp>& operator |= ( Rect_<_Tp>& a, const Rect_<_Tp>& b )\n{\n    _Tp x1 = std::min(a.x, b.x), y1 = std::min(a.y, b.y);\n    a.width = std::max(a.x + a.width, b.x + b.width) - x1;\n    a.height = std::max(a.y + a.height, b.y + b.height) - y1;\n    a.x = x1; a.y = y1;\n    return a;\n}\n\ntemplate<typename _Tp> static inline Rect_<_Tp> operator & (const Rect_<_Tp>& a, const Rect_<_Tp>& b)\n{\n    Rect_<_Tp> c = a;\n    return c &= b;\n}\n\ntemplate<typename _Tp> static inline Rect_<_Tp> operator | (const Rect_<_Tp>& a, const Rect_<_Tp>& b)\n{\n    Rect_<_Tp> c = a;\n    return c |= b;\n}\n\ntypedef Rect_<int> Rect;\ntypedef Rect_<float> Rect2f;\n\ntemplate<typename _Tp>\nstruct Point_\n{\n    Point_() : x(0), y(0) {}\n    Point_(_Tp _x, _Tp _y) : x(_x), y(_y) {}\n\n    _Tp x;\n    _Tp y;\n};\n\ntypedef Point_<int> Point;\ntypedef Point_<float> Point2f;\n\n#define CV_8UC1 1\n#define CV_8UC3 3\n#define CV_8UC4 4\n#define CV_32FC1 4\n\nstruct Mat\n{\n    Mat() : data(0), refcount(0), rows(0), cols(0), c(0) {}\n\n    Mat(int _rows, int _cols, int flags) : data(0), refcount(0)\n    {\n        create(_rows, _cols, flags);\n    }\n\n    // copy\n    Mat(const Mat& m) : data(m.data), refcount(m.refcount)\n    {\n        if (refcount)\n            NCNN_XADD(refcount, 1);\n\n        rows = m.rows;\n        cols = m.cols;\n        c = m.c;\n    }\n\n    Mat(int _rows, int _cols, int flags, void* _data) : data((unsigned char*)_data), refcount(0)\n    {\n        rows = _rows;\n        cols = _cols;\n        c = flags;\n    }\n\n    ~Mat()\n    {\n        release();\n    }\n\n    // assign\n    Mat& operator=(const Mat& m)\n    {\n        if (this == &m)\n            return *this;\n\n        if (m.refcount)\n            NCNN_XADD(m.refcount, 1);\n\n        release();\n\n        data = m.data;\n        refcount = m.refcount;\n\n        rows = m.rows;\n        cols = m.cols;\n        c = m.c;\n\n        return *this;\n    }\n\n    void create(int _rows, int _cols, int flags)\n    {\n        release();\n\n        rows = _rows;\n        cols = _cols;\n        c = flags;\n\n        if (total() > 0)\n        {\n            // refcount address must be aligned, so we expand totalsize here\n            size_t totalsize = (total() + 3) >> 2 << 2;\n            data = (unsigned char*)ncnn::fastMalloc(totalsize + (int)sizeof(*refcount));\n            refcount = (int*)(((unsigned char*)data) + totalsize);\n            *refcount = 1;\n        }\n    }\n\n    void release()\n    {\n        if (refcount && NCNN_XADD(refcount, -1) == 1)\n            ncnn::fastFree(data);\n\n        data = 0;\n\n        rows = 0;\n        cols = 0;\n        c = 0;\n\n        refcount = 0;\n    }\n\n    Mat clone() const\n    {\n        if (empty())\n            return Mat();\n\n        Mat m(rows, cols, c);\n\n        if (total() > 0)\n        {\n            memcpy(m.data, data, total());\n        }\n\n        return m;\n    }\n\n    bool empty() const { return data == 0 || total() == 0; }\n\n    int channels() const { return c; }\n\n    size_t total() const { return cols * rows * c; }\n\n    const unsigned char* ptr(int y) const { return data + y * cols * c; }\n\n    unsigned char* ptr(int y) { return data + y * cols * c; }\n\n    // roi\n    Mat operator()( const Rect& roi ) const\n    {\n        if (empty())\n            return Mat();\n\n        Mat m(roi.height, roi.width, c);\n\n        int sy = roi.y;\n        for (int y = 0; y < roi.height; y++)\n        {\n            const unsigned char* sptr = ptr(sy) + roi.x * c;\n            unsigned char* dptr = m.ptr(y);\n            memcpy(dptr, sptr, roi.width * c);\n            sy++;\n        }\n\n        return m;\n    }\n\n    unsigned char* data;\n\n    // pointer to the reference counter;\n    // when points to user-allocated data, the pointer is NULL\n    int* refcount;\n\n    int rows;\n    int cols;\n\n    int c;\n\n};\n\n#define CV_LOAD_IMAGE_GRAYSCALE 1\n#define CV_LOAD_IMAGE_COLOR 3\nMat imread(const std::string& path, int flags);\nvoid imwrite(const std::string& path, const Mat& m);\n\n#if NCNN_PIXEL\nvoid resize(const Mat& src, Mat& dst, const Size& size, float sw = 0.f, float sh = 0.f, int flags = 0);\n#endif // NCNN_PIXEL\n\n} // namespace cv\n\n#endif // NCNN_OPENCV\n\n#endif // NCNN_OPENCV_H\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/cpp/include/paramdict.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_PARAMDICT_H\n#define NCNN_PARAMDICT_H\n\n#include <stdio.h>\n#include \"mat.h\"\n#include \"platform.h\"\n\n// at most 20 parameters\n#define NCNN_MAX_PARAM_COUNT 20\n\nnamespace ncnn {\n\nclass Net;\nclass ParamDict\n{\npublic:\n    // empty\n    ParamDict();\n\n    // get int\n    int get(int id, int def) const;\n    // get float\n    float get(int id, float def) const;\n    // get array\n    Mat get(int id, const Mat& def) const;\n\n    // set int\n    void set(int id, int i);\n    // set float\n    void set(int id, float f);\n    // set array\n    void set(int id, const Mat& v);\n\npublic:\n    int use_winograd_convolution;\n    int use_sgemm_convolution;\n    int use_int8_inference;\n\nprotected:\n    friend class Net;\n\n    void clear();\n\n#if NCNN_STDIO\n#if NCNN_STRING\n    int load_param(FILE* fp);\n    int load_param_mem(const char*& mem);\n#endif // NCNN_STRING\n    int load_param_bin(FILE* fp);\n#endif // NCNN_STDIO\n    int load_param(const unsigned char*& mem);\n\nprotected:\n    struct\n    {\n        int loaded;\n        union { int i; float f; };\n        Mat v;\n    } params[NCNN_MAX_PARAM_COUNT];\n};\n\n} // namespace ncnn\n\n#endif // NCNN_PARAMDICT_H\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/cpp/include/platform.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_PLATFORM_H\n#define NCNN_PLATFORM_H\n\n#define NCNN_STDIO 1\n#define NCNN_STRING 1\n#define NCNN_OPENCV 0\n#define NCNN_BENCHMARK 0\n#define NCNN_PIXEL 1\n#define NCNN_PIXEL_ROTATE 0\n\n#endif // NCNN_PLATFORM_H\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/java/com/example/che/mobilenetssd_demo/MainActivity.java",
    "content": "package com.example.che.mobilenetssd_demo;\n\nimport android.Manifest;\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.content.pm.PackageManager;\nimport android.content.res.AssetManager;\nimport android.graphics.Bitmap;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.net.Uri;\nimport android.support.annotation.NonNull;\nimport android.support.annotation.Nullable;\nimport android.support.v4.app.ActivityCompat;\nimport android.support.v4.content.ContextCompat;\nimport android.support.v7.app.AppCompatActivity;\nimport android.os.Bundle;\nimport android.text.method.ScrollingMovementMethod;\nimport android.util.Log;\nimport android.view.View;\nimport android.widget.Button;\nimport android.widget.ImageView;\nimport android.widget.TextView;\nimport android.widget.Toast;\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\n\n\nimport com.bumptech.glide.Glide;\nimport com.bumptech.glide.load.engine.DiskCacheStrategy;\nimport com.bumptech.glide.request.RequestOptions;\n\n\npublic class MainActivity extends AppCompatActivity {\n\n    private static final String TAG = MainActivity.class.getName();\n    private static final int USE_PHOTO = 1001;\n    private String camera_image_path;\n    private ImageView show_image;\n    private TextView result_text;\n    private boolean load_result = false;\n    private int[] ddims = {1, 3, 300, 300}; //这里的维度的值要和train model的input 一一对应\n    private int model_index = 1;\n    private List<String> resultLabel = new ArrayList<>();\n    private MobileNetssd mobileNetssd = new MobileNetssd(); //java接口实例化　下面直接利用java函数调用NDK c++函数\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n        try\n        {\n            initMobileNetSSD();\n        } catch (IOException e) {\n            Log.e(\"MainActivity\", \"initMobileNetSSD error\");\n        }\n        init_view();\n        readCacheLabelFromLocalFile();\n}\n\n    /**\n     *\n     * MobileNetssd初始化，也就是把model文件进行加载\n     */\n    private void initMobileNetSSD() throws IOException {\n        byte[] param = null;\n        byte[] bin = null;\n        {\n            //用io流读取二进制文件，最后存入到byte[]数组中\n            InputStream assetsInputStream = getAssets().open(\"MobileNetSSD_deploy.param.bin\");// param：  网络结构文件\n            int available = assetsInputStream.available();\n            param = new byte[available];\n            int byteCode = assetsInputStream.read(param);\n            assetsInputStream.close();\n        }\n        {\n            //用io流读取二进制文件，最后存入到byte上，转换为int型\n            InputStream assetsInputStream = getAssets().open(\"MobileNetSSD_deploy.bin\");//bin：   model文件\n            int available = assetsInputStream.available();\n            bin = new byte[available];\n            int byteCode = assetsInputStream.read(bin);\n            assetsInputStream.close();\n        }\n\n        load_result = mobileNetssd.Init(param, bin);// 再将文件传入java的NDK接口(c++ 代码中的init接口 )\n        Log.d(\"load model\", \"MobileNetSSD_load_model_result:\" + load_result);\n    }\n\n\n    // initialize view\n    private void init_view() {\n        request_permissions();\n        show_image = (ImageView) findViewById(R.id.show_image);\n        result_text = (TextView) findViewById(R.id.result_text);\n        result_text.setMovementMethod(ScrollingMovementMethod.getInstance());\n        Button use_photo = (Button) findViewById(R.id.use_photo);\n        // use photo click\n        use_photo.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View view) {\n                if (!load_result) {\n                    Toast.makeText(MainActivity.this, \"never load model\", Toast.LENGTH_SHORT).show();\n                    return;\n                }\n                PhotoUtil.use_photo(MainActivity.this, USE_PHOTO);\n            }\n        });\n    }\n\n    // load label's name\n    private void readCacheLabelFromLocalFile() {\n        try {\n            AssetManager assetManager = getApplicationContext().getAssets();\n            BufferedReader reader = new BufferedReader(new InputStreamReader(assetManager.open(\"words.txt\")));//这里是label的文件\n            String readLine = null;\n            while ((readLine = reader.readLine()) != null) {\n                resultLabel.add(readLine);\n            }\n            reader.close();\n        } catch (Exception e) {\n            Log.e(\"labelCache\", \"error \" + e);\n        }\n    }\n\n\n    protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n        String image_path;\n        RequestOptions options = new RequestOptions().skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.NONE);\n        if (resultCode == Activity.RESULT_OK) {\n            switch (requestCode) {\n                case USE_PHOTO:\n                    if (data == null) {\n                        Log.w(TAG, \"user photo data is null\");\n                        return;\n                    }\n                    Uri image_uri = data.getData();\n\n                    //Glide.with(MainActivity.this).load(image_uri).apply(options).into(show_image);\n\n                    // get image path from uri\n                    image_path = PhotoUtil.get_path_from_URI(MainActivity.this, image_uri);\n                    // predict image\n                    predict_image(image_path);\n                    break;\n            }\n        }\n    }\n\n    //  predict image\n    private void predict_image(String image_path) {\n        // picture to float array\n        Bitmap bmp = PhotoUtil.getScaleBitmap(image_path);\n        Bitmap rgba = bmp.copy(Bitmap.Config.ARGB_8888, true);\n        // resize\n        Bitmap input_bmp = Bitmap.createScaledBitmap(rgba, ddims[2], ddims[3], false);\n        try {\n            // Data format conversion takes too long\n            // Log.d(\"inputData\", Arrays.toString(inputData));\n            long start = System.currentTimeMillis();\n            // get predict result\n            float[] result = mobileNetssd.Detect(input_bmp);\n            // time end\n            long end = System.currentTimeMillis();\n            Log.d(TAG, \"origin predict result:\" + Arrays.toString(result));\n            long time = end - start;\n            Log.d(\"result length\", \"length of result: \" + String.valueOf(result.length));\n            // show predict result and time\n            // float[] r = get_max_result(result);\n\n            String show_text = \"result：\" + Arrays.toString(result) + \"\\nname：\" + resultLabel.get((int) result[0]) + \"\\nprobability：\" + result[1] + \"\\ntime：\" + time + \"ms\" ;\n            result_text.setText(show_text);\n\n            // 画布配置\n            Canvas canvas = new Canvas(rgba);\n            //图像上画矩形\n            Paint paint = new Paint();\n            paint.setColor(Color.RED);\n            paint.setStyle(Paint.Style.STROKE);//不填充\n            paint.setStrokeWidth(5); //线的宽度\n\n\n            float get_finalresult[][] = TwoArry(result);\n            Log.d(\"zhuanhuan\",get_finalresult+\"\");\n            int object_num = 0;\n            int num = result.length/6;// number of object\n            //continue to draw rect\n            for(object_num = 0; object_num < num; object_num++){\n                Log.d(TAG, \"haha :\" + Arrays.toString(get_finalresult));\n                // 画框\n                paint.setColor(Color.RED);\n                paint.setStyle(Paint.Style.STROKE);//不填充\n                paint.setStrokeWidth(5); //线的宽度\n                canvas.drawRect(get_finalresult[object_num][2] * rgba.getWidth(), get_finalresult[object_num][3] * rgba.getHeight(),\n                        get_finalresult[object_num][4] * rgba.getWidth(), get_finalresult[object_num][5] * rgba.getHeight(), paint);\n\n                paint.setColor(Color.YELLOW);\n                paint.setStyle(Paint.Style.FILL);//不填充\n                paint.setStrokeWidth(1); //线的宽度\n                canvas.drawText(resultLabel.get((int) get_finalresult[object_num][0]) + \"\\n\" + get_finalresult[object_num][1],\n                        get_finalresult[object_num][2]*rgba.getWidth(),get_finalresult[object_num][3]*rgba.getHeight(),paint);\n            }\n\n            show_image.setImageBitmap(rgba);\n\n\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n    }\n\n    //一维数组转化为二维数组\n    public static float[][] TwoArry(float[] inputfloat){\n        int n = inputfloat.length;\n        int num = inputfloat.length/6;\n        float[][] outputfloat = new float[num][6];\n        int k = 0;\n        for(int i = 0; i < num ; i++)\n        {\n            int j = 0;\n\n            while(j<6)\n            {\n                outputfloat[i][j] =  inputfloat[k];\n                k++;\n                j++;\n            }\n\n        }\n\n        return outputfloat;\n    }\n\n    /*\n    // get max probability label\n    private float[] get_max_result(float[] result) {\n        int num_rs = result.length / 6;\n        float maxProp = result[1];\n        int maxI = 0;\n        for(int i = 1; i<num_rs;i++){\n            if(maxProp<result[i*6+1]){\n                maxProp = result[i*6+1];\n                maxI = i;\n            }\n        }\n        float[] ret = {0,0,0,0,0,0};\n        for(int j=0;j<6;j++){\n            ret[j] = result[maxI*6 + j];\n        }\n        return ret;\n    }\n    */\n    // request permissions(add)\n    private void request_permissions() {\n        List<String> permissionList = new ArrayList<>();\n        if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {\n            permissionList.add(Manifest.permission.CAMERA);\n        }\n        if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n            permissionList.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);\n        }\n        if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n            permissionList.add(Manifest.permission.READ_EXTERNAL_STORAGE);\n        }\n        // if list is not empty will request permissions\n        if (!permissionList.isEmpty()) {\n            ActivityCompat.requestPermissions(this, permissionList.toArray(new String[permissionList.size()]), 1);\n        }\n    }\n\n    @Override\n    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {\n        super.onRequestPermissionsResult(requestCode, permissions, grantResults);\n        switch (requestCode) {\n            case 1:\n                if (grantResults.length > 0) {\n                    for (int i = 0; i < grantResults.length; i++) {\n                        int grantResult = grantResults[i];\n                        if (grantResult == PackageManager.PERMISSION_DENIED) {\n                            String s = permissions[i];\n                            Toast.makeText(this, s + \"permission was denied\", Toast.LENGTH_SHORT).show();\n                        }\n                    }\n                }\n                break;\n        }\n    }\n\n\n\n}\n\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/java/com/example/che/mobilenetssd_demo/MobileNetssd.java",
    "content": "package com.example.che.mobilenetssd_demo;\n\nimport android.graphics.Bitmap;\n\n/**\n *  MobileNetssd的java接口，与本地c++代码相呼应 native为本地 此文件与 MobileNetssd.cpp相呼应\n */\npublic class MobileNetssd {\n\n    public native boolean Init(byte[] param, byte[] bin); // 初始化函数\n    public native float[] Detect(Bitmap bitmap); // 检测函数\n    // Used to load the 'native-lib' library on application startup.\n    static {\n        System.loadLibrary(\"MobileNetssd\");\n    }\n}\n\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/java/com/example/che/mobilenetssd_demo/PhotoUtil.java",
    "content": "package com.example.che.mobilenetssd_demo;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.database.Cursor;\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapFactory;\nimport android.net.Uri;\nimport android.provider.MediaStore;\n\npublic class PhotoUtil {\n    // get picture in photo\n    public static void use_photo(Activity activity, int requestCode) {\n        Intent intent = new Intent(Intent.ACTION_PICK);\n        intent.setType(\"image/*\");\n        activity.startActivityForResult(intent, requestCode);\n    }\n\n    // get photo from Uri\n    public static String get_path_from_URI(Context context, Uri uri) {\n        String result;\n        Cursor cursor = context.getContentResolver().query(uri, null, null, null, null);\n        if (cursor == null) {\n            result = uri.getPath();\n        } else {\n            cursor.moveToFirst();\n            int idx = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA);\n            result = cursor.getString(idx);\n            cursor.close();\n        }\n        return result;\n    }\n\n    // compress picture\n    public static Bitmap getScaleBitmap(String filePath) {\n        BitmapFactory.Options opt = new BitmapFactory.Options();\n        opt.inJustDecodeBounds = true;\n        BitmapFactory.decodeFile(filePath, opt);\n\n        int bmpWidth = opt.outWidth;\n        int bmpHeight = opt.outHeight;\n\n        int maxSize = 500;\n\n        // compress picture with inSampleSize\n        opt.inSampleSize = 1;\n        while (true) {\n            if (bmpWidth / opt.inSampleSize < maxSize || bmpHeight / opt.inSampleSize < maxSize) {\n                break;\n            }\n            opt.inSampleSize *= 2;\n        }\n        opt.inJustDecodeBounds = false;\n        return BitmapFactory.decodeFile(filePath, opt);\n    }\n}\n\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/res/drawable/ic_launcher_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportWidth=\"108\"\n    android:viewportHeight=\"108\">\n    <path\n        android:fillColor=\"#008577\"\n        android:pathData=\"M0,0h108v108h-108z\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M9,0L9,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,0L19,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M29,0L29,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M39,0L39,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M49,0L49,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M59,0L59,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M69,0L69,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M79,0L79,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M89,0L89,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M99,0L99,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,9L108,9\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,19L108,19\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,29L108,29\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,39L108,39\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,49L108,49\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,59L108,59\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,69L108,69\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,79L108,79\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,89L108,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,99L108,99\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,29L89,29\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,39L89,39\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,49L89,49\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,59L89,59\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,69L89,69\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,79L89,79\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M29,19L29,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M39,19L39,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M49,19L49,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M59,19L59,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M69,19L69,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M79,19L79,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n</vector>\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/res/drawable-v24/ic_launcher_foreground.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:aapt=\"http://schemas.android.com/aapt\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportWidth=\"108\"\n    android:viewportHeight=\"108\">\n    <path\n        android:fillType=\"evenOdd\"\n        android:pathData=\"M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z\"\n        android:strokeWidth=\"1\"\n        android:strokeColor=\"#00000000\">\n        <aapt:attr name=\"android:fillColor\">\n            <gradient\n                android:endX=\"78.5885\"\n                android:endY=\"90.9159\"\n                android:startX=\"48.7653\"\n                android:startY=\"61.0927\"\n                android:type=\"linear\">\n                <item\n                    android:color=\"#44000000\"\n                    android:offset=\"0.0\" />\n                <item\n                    android:color=\"#00000000\"\n                    android:offset=\"1.0\" />\n            </gradient>\n        </aapt:attr>\n    </path>\n    <path\n        android:fillColor=\"#FFFFFF\"\n        android:fillType=\"nonZero\"\n        android:pathData=\"M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z\"\n        android:strokeWidth=\"1\"\n        android:strokeColor=\"#00000000\" />\n</vector>\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:context=\".MainActivity\">\n    <LinearLayout\n        android:id=\"@+id/btn_ll\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:orientation=\"horizontal\">\n        <Button\n            android:id=\"@+id/use_photo\"\n            android:layout_weight=\"1\"\n            android:layout_width=\"0dp\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"相册\"/>\n    </LinearLayout>\n    <TextView\n        android:layout_above=\"@id/btn_ll\"\n        android:id=\"@+id/result_text\"\n        android:textSize=\"16sp\"\n        android:layout_width=\"match_parent\"\n        android:hint=\"预测结果会在这里显示\"\n        android:layout_height=\"100dp\"/>\n    <ImageView\n        android:layout_alignParentTop=\"true\"\n        android:layout_above=\"@id/result_text\"\n        android:id=\"@+id/show_image\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"/>\n</RelativeLayout>\n\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\" />\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\" />\n</adaptive-icon>"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\" />\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\" />\n</adaptive-icon>"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#008577</color>\n    <color name=\"colorPrimaryDark\">#00574B</color>\n    <color name=\"colorAccent\">#D81B60</color>\n</resources>\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">MobileNetSSD_demo</string>\n</resources>\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n        <!-- Customize your theme here. -->\n        <item name=\"colorPrimary\">@color/colorPrimary</item>\n        <item name=\"colorPrimaryDark\">@color/colorPrimaryDark</item>\n        <item name=\"colorAccent\">@color/colorAccent</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "MobileNetSSD_demo/app/src/test/java/com/example/che/mobilenetssd_demo/ExampleUnitTest.java",
    "content": "package com.example.che.mobilenetssd_demo;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local unit test, which will execute on the development machine (host).\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\npublic class ExampleUnitTest {\n    @Test\n    public void addition_isCorrect() {\n        assertEquals(4, 2 + 2);\n    }\n}"
  },
  {
    "path": "MobileNetSSD_demo/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    \n    repositories {\n        google()\n        jcenter()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:3.2.1'\n        \n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        google()\n        jcenter()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "MobileNetSSD_demo/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-4.6-all.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "MobileNetSSD_demo/gradle.properties",
    "content": "# Project-wide Gradle settings.\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\norg.gradle.jvmargs=-Xmx1536m\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n\n\n"
  },
  {
    "path": "MobileNetSSD_demo/gradlew",
    "content": "#!/usr/bin/env sh\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn () {\n    echo \"$*\"\n}\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" -a \"$nonstop\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Escape application args\nsave () {\n    for i do printf %s\\\\n \"$i\" | sed \"s/'/'\\\\\\\\''/g;1s/^/'/;\\$s/\\$/' \\\\\\\\/\" ; done\n    echo \" \"\n}\nAPP_ARGS=$(save \"$@\")\n\n# Collect all arguments for the java command, following the shell quoting and substitution rules\neval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS \"\\\"-Dorg.gradle.appname=$APP_BASE_NAME\\\"\" -classpath \"\\\"$CLASSPATH\\\"\" org.gradle.wrapper.GradleWrapperMain \"$APP_ARGS\"\n\n# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong\nif [ \"$(uname)\" = \"Darwin\" ] && [ \"$HOME\" = \"$PWD\" ]; then\n  cd \"$(dirname \"$0\")\"\nfi\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "MobileNetSSD_demo/gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windows variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "MobileNetSSD_demo/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "MobileNetSSD_demo_single/.gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/caches/build_file_checksums.ser\n/.idea/libraries\n/.idea/modules.xml\n/.idea/workspace.xml\n.DS_Store\n/build\n/captures\n.externalNativeBuild\n"
  },
  {
    "path": "MobileNetSSD_demo_single/.idea/codeStyles/Project.xml",
    "content": "<component name=\"ProjectCodeStyleConfiguration\">\n  <code_scheme name=\"Project\" version=\"173\">\n    <Objective-C-extensions>\n      <file>\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Import\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Macro\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Typedef\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Enum\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Constant\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Global\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Struct\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"FunctionPredecl\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Function\" />\n      </file>\n      <class>\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Property\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"Synthesize\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"InitMethod\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"StaticMethod\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"InstanceMethod\" />\n        <option name=\"com.jetbrains.cidr.lang.util.OCDeclarationKind\" value=\"DeallocMethod\" />\n      </class>\n      <extensions>\n        <pair source=\"cpp\" header=\"h\" fileNamingConvention=\"NONE\" />\n        <pair source=\"c\" header=\"h\" fileNamingConvention=\"NONE\" />\n      </extensions>\n    </Objective-C-extensions>\n  </code_scheme>\n</component>"
  },
  {
    "path": "MobileNetSSD_demo_single/.idea/gradle.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"GradleSettings\">\n    <option name=\"linkedExternalProjectsSettings\">\n      <GradleProjectSettings>\n        <option name=\"distributionType\" value=\"DEFAULT_WRAPPED\" />\n        <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n        <option name=\"modules\">\n          <set>\n            <option value=\"$PROJECT_DIR$\" />\n            <option value=\"$PROJECT_DIR$/app\" />\n          </set>\n        </option>\n        <option name=\"resolveModulePerSourceSet\" value=\"false\" />\n      </GradleProjectSettings>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": "MobileNetSSD_demo_single/.idea/misc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"NullableNotNullManager\">\n    <option name=\"myDefaultNullable\" value=\"android.support.annotation.Nullable\" />\n    <option name=\"myDefaultNotNull\" value=\"android.support.annotation.NonNull\" />\n    <option name=\"myNullables\">\n      <value>\n        <list size=\"7\">\n          <item index=\"0\" class=\"java.lang.String\" itemvalue=\"org.jetbrains.annotations.Nullable\" />\n          <item index=\"1\" class=\"java.lang.String\" itemvalue=\"javax.annotation.Nullable\" />\n          <item index=\"2\" class=\"java.lang.String\" itemvalue=\"javax.annotation.CheckForNull\" />\n          <item index=\"3\" class=\"java.lang.String\" itemvalue=\"edu.umd.cs.findbugs.annotations.Nullable\" />\n          <item index=\"4\" class=\"java.lang.String\" itemvalue=\"android.support.annotation.Nullable\" />\n          <item index=\"5\" class=\"java.lang.String\" itemvalue=\"androidx.annotation.Nullable\" />\n          <item index=\"6\" class=\"java.lang.String\" itemvalue=\"androidx.annotation.RecentlyNullable\" />\n        </list>\n      </value>\n    </option>\n    <option name=\"myNotNulls\">\n      <value>\n        <list size=\"6\">\n          <item index=\"0\" class=\"java.lang.String\" itemvalue=\"org.jetbrains.annotations.NotNull\" />\n          <item index=\"1\" class=\"java.lang.String\" itemvalue=\"javax.annotation.Nonnull\" />\n          <item index=\"2\" class=\"java.lang.String\" itemvalue=\"edu.umd.cs.findbugs.annotations.NonNull\" />\n          <item index=\"3\" class=\"java.lang.String\" itemvalue=\"android.support.annotation.NonNull\" />\n          <item index=\"4\" class=\"java.lang.String\" itemvalue=\"androidx.annotation.NonNull\" />\n          <item index=\"5\" class=\"java.lang.String\" itemvalue=\"androidx.annotation.RecentlyNonNull\" />\n        </list>\n      </value>\n    </option>\n  </component>\n  <component name=\"ProjectRootManager\" version=\"2\" languageLevel=\"JDK_1_7\" project-jdk-name=\"1.8\" project-jdk-type=\"JavaSDK\">\n    <output url=\"file://$PROJECT_DIR$/build/classes\" />\n  </component>\n  <component name=\"ProjectType\">\n    <option name=\"id\" value=\"Android\" />\n  </component>\n</project>"
  },
  {
    "path": "MobileNetSSD_demo_single/app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/CMakeLists.txt",
    "content": "# For more information about using CMake with Android Studio, read the\n# documentation: https://d.android.com/studio/projects/add-native-code.html\n\n# Sets the minimum version of CMake required to build the native library.\n\ncmake_minimum_required(VERSION 3.4.1)\n\n# Creates and names a library, sets it as either STATIC\n# or SHARED, and provides the relative paths to its source code.\n# You can define multiple libraries, and CMake builds them for you.\n# Gradle automatically packages shared libraries with your APK.\n\n##需要添加\nset(ncnn_lib ${CMAKE_SOURCE_DIR}/src/main/jniLibs/armeabi-v7a/libncnn.a)\nadd_library (ncnn_lib STATIC IMPORTED)\nset_target_properties(ncnn_lib PROPERTIES IMPORTED_LOCATION ${ncnn_lib})\n\nadd_library( # Sets the name of the library.\n        MobileNetssd ## 为生成.so的文字最好直接和.c名字一样,需要更改\n\n        # Sets the library as a shared library.\n        SHARED\n\n        # Provides a relative path to your source file(s).\n        src/main/cpp/MobileNetssd.cpp)##cpp文件的name\n\n# Searches for a specified prebuilt library and stores the path as a\n# variable. Because CMake includes system libraries in the search path by\n# default, you only need to specify the name of the public NDK library\n# you want to add. CMake verifies that the library exists before\n# completing its build.\n\nfind_library( # Sets the name of the path variable.\n        log-lib\n\n        # Specifies the name of the NDK library that\n        # you want CMake to locate.\n        log)\n\n# Specifies libraries CMake should link to your target library. You\n# can link multiple libraries, such as libraries you define in this\n# build script, prebuilt third-party libraries, or system libraries.\n\ntarget_link_libraries( # Specifies the target library.\n        ##以下三个都要添加\n        MobileNetssd   #和上面一样\n        ncnn_lib       #这个ncnn的lib的add\n        jnigraphics    #这个jni也需要add\n\n        # Links the target library to the log library\n        # included in the NDK.\n        ${log-lib})"
  },
  {
    "path": "MobileNetSSD_demo_single/app/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 28\n    defaultConfig {\n        applicationId \"com.example.che.mobilenetssd_demo\"\n        minSdkVersion 15\n        targetSdkVersion 28\n        versionCode 1\n        versionName \"1.0\"\n        testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\n        externalNativeBuild {\n            cmake {\n                cppFlags \"-std=c++11 -fopenmp\"//c++,多线程 需要添加need to add\n                abiFilters \"armeabi-v7a\" // 手机的硬件架构，基本所有的硬件都适配\n            }\n        }\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n    externalNativeBuild {\n        cmake {\n            path \"CMakeLists.txt\"\n        }\n    }\n\n    // 需要添加 把 .a文件导入, .a为 ncnn make intall生成的里面的.a文件\n    sourceSets {\n        main {\n            jniLibs.srcDirs = [\"src/main/jniLibs\"]\n            jni.srcDirs = ['src/cpp']\n        }\n    }\n}\n\ndependencies {\n    implementation fileTree(dir: 'libs', include: ['*.jar'])\n    implementation 'com.android.support:appcompat-v7:28.0.0'\n    implementation 'com.android.support.constraint:constraint-layout:1.1.3'\n    testImplementation 'junit:junit:4.12'\n    implementation 'com.github.bumptech.glide:glide:4.3.1'   // need to add增加图片类 bumptech，build自动红线消失\n    androidTestImplementation 'com.android.support.test:runner:1.0.2'\n    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'\n}\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguardFiles setting in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n\n# Uncomment this to preserve the line number information for\n# debugging stack traces.\n#-keepattributes SourceFile,LineNumberTable\n\n# If you keep the line number information, uncomment this to\n# hide the original source file name.\n#-renamesourcefileattribute SourceFile\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/androidTest/java/com/example/che/mobilenetssd_demo/ExampleInstrumentedTest.java",
    "content": "package com.example.che.mobilenetssd_demo;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\nimport android.support.test.runner.AndroidJUnit4;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport static org.junit.Assert.*;\n\n/**\n * Instrumented test, which will execute on an Android device.\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\n@RunWith(AndroidJUnit4.class)\npublic class ExampleInstrumentedTest {\n    @Test\n    public void useAppContext() {\n        // Context of the app under test.\n        Context appContext = InstrumentationRegistry.getTargetContext();\n\n        assertEquals(\"com.example.che.mobilenetssd_demo\", appContext.getPackageName());\n    }\n}\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.example.che.mobilenetssd_demo\">\n\n    <uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n    <uses-permission android:name=\"android.permission.CAMERA\"/>\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:roundIcon=\"@mipmap/ic_launcher_round\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme\">\n        <activity android:name=\".MainActivity\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/assets/words.txt",
    "content": "background\naeroplane\nbicycle\nbird\nboat\nbottle\nbus\ncar\ncat\nchair\ncow\ndiningtable\ndog\nhorse\nmotorbike\nperson\npottedplant\nsheep\nsofa\ntrain\ntvmonitor"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/cpp/MobileNetSSD_deploy.id.h",
    "content": "#ifndef NCNN_INCLUDE_GUARD_MobileNetSSD_deploy_id_h\n#define NCNN_INCLUDE_GUARD_MobileNetSSD_deploy_id_h\nnamespace MobileNetSSD_deploy_param_id {\nconst int LAYER_input = 0;\nconst int BLOB_data = 0;\nconst int LAYER_splitncnn_0 = 1;\nconst int BLOB_data_splitncnn_0 = 1;\nconst int BLOB_data_splitncnn_1 = 2;\nconst int BLOB_data_splitncnn_2 = 3;\nconst int BLOB_data_splitncnn_3 = 4;\nconst int BLOB_data_splitncnn_4 = 5;\nconst int BLOB_data_splitncnn_5 = 6;\nconst int BLOB_data_splitncnn_6 = 7;\nconst int LAYER_conv0 = 2;\nconst int BLOB_conv0 = 8;\nconst int LAYER_conv0_relu = 3;\nconst int BLOB_conv0_conv0_relu = 9;\nconst int LAYER_conv1_dw = 4;\nconst int BLOB_conv1_dw = 10;\nconst int LAYER_conv1_dw_relu = 5;\nconst int BLOB_conv1_dw_conv1_dw_relu = 11;\nconst int LAYER_conv1 = 6;\nconst int BLOB_conv1 = 12;\nconst int LAYER_conv1_relu = 7;\nconst int BLOB_conv1_conv1_relu = 13;\nconst int LAYER_conv2_dw = 8;\nconst int BLOB_conv2_dw = 14;\nconst int LAYER_conv2_dw_relu = 9;\nconst int BLOB_conv2_dw_conv2_dw_relu = 15;\nconst int LAYER_conv2 = 10;\nconst int BLOB_conv2 = 16;\nconst int LAYER_conv2_relu = 11;\nconst int BLOB_conv2_conv2_relu = 17;\nconst int LAYER_conv3_dw = 12;\nconst int BLOB_conv3_dw = 18;\nconst int LAYER_conv3_dw_relu = 13;\nconst int BLOB_conv3_dw_conv3_dw_relu = 19;\nconst int LAYER_conv3 = 14;\nconst int BLOB_conv3 = 20;\nconst int LAYER_conv3_relu = 15;\nconst int BLOB_conv3_conv3_relu = 21;\nconst int LAYER_conv4_dw = 16;\nconst int BLOB_conv4_dw = 22;\nconst int LAYER_conv4_dw_relu = 17;\nconst int BLOB_conv4_dw_conv4_dw_relu = 23;\nconst int LAYER_conv4 = 18;\nconst int BLOB_conv4 = 24;\nconst int LAYER_conv4_relu = 19;\nconst int BLOB_conv4_conv4_relu = 25;\nconst int LAYER_conv5_dw = 20;\nconst int BLOB_conv5_dw = 26;\nconst int LAYER_conv5_dw_relu = 21;\nconst int BLOB_conv5_dw_conv5_dw_relu = 27;\nconst int LAYER_conv5 = 22;\nconst int BLOB_conv5 = 28;\nconst int LAYER_conv5_relu = 23;\nconst int BLOB_conv5_conv5_relu = 29;\nconst int LAYER_conv6_dw = 24;\nconst int BLOB_conv6_dw = 30;\nconst int LAYER_conv6_dw_relu = 25;\nconst int BLOB_conv6_dw_conv6_dw_relu = 31;\nconst int LAYER_conv6 = 26;\nconst int BLOB_conv6 = 32;\nconst int LAYER_conv6_relu = 27;\nconst int BLOB_conv6_conv6_relu = 33;\nconst int LAYER_conv7_dw = 28;\nconst int BLOB_conv7_dw = 34;\nconst int LAYER_conv7_dw_relu = 29;\nconst int BLOB_conv7_dw_conv7_dw_relu = 35;\nconst int LAYER_conv7 = 30;\nconst int BLOB_conv7 = 36;\nconst int LAYER_conv7_relu = 31;\nconst int BLOB_conv7_conv7_relu = 37;\nconst int LAYER_conv8_dw = 32;\nconst int BLOB_conv8_dw = 38;\nconst int LAYER_conv8_dw_relu = 33;\nconst int BLOB_conv8_dw_conv8_dw_relu = 39;\nconst int LAYER_conv8 = 34;\nconst int BLOB_conv8 = 40;\nconst int LAYER_conv8_relu = 35;\nconst int BLOB_conv8_conv8_relu = 41;\nconst int LAYER_conv9_dw = 36;\nconst int BLOB_conv9_dw = 42;\nconst int LAYER_conv9_dw_relu = 37;\nconst int BLOB_conv9_dw_conv9_dw_relu = 43;\nconst int LAYER_conv9 = 38;\nconst int BLOB_conv9 = 44;\nconst int LAYER_conv9_relu = 39;\nconst int BLOB_conv9_conv9_relu = 45;\nconst int LAYER_conv10_dw = 40;\nconst int BLOB_conv10_dw = 46;\nconst int LAYER_conv10_dw_relu = 41;\nconst int BLOB_conv10_dw_conv10_dw_relu = 47;\nconst int LAYER_conv10 = 42;\nconst int BLOB_conv10 = 48;\nconst int LAYER_conv10_relu = 43;\nconst int BLOB_conv10_conv10_relu = 49;\nconst int LAYER_conv11_dw = 44;\nconst int BLOB_conv11_dw = 50;\nconst int LAYER_conv11_dw_relu = 45;\nconst int BLOB_conv11_dw_conv11_dw_relu = 51;\nconst int LAYER_conv11 = 46;\nconst int BLOB_conv11 = 52;\nconst int LAYER_conv11_relu = 47;\nconst int BLOB_conv11_conv11_relu = 53;\nconst int LAYER_splitncnn_1 = 48;\nconst int BLOB_conv11_conv11_relu_splitncnn_0 = 54;\nconst int BLOB_conv11_conv11_relu_splitncnn_1 = 55;\nconst int BLOB_conv11_conv11_relu_splitncnn_2 = 56;\nconst int BLOB_conv11_conv11_relu_splitncnn_3 = 57;\nconst int LAYER_conv12_dw = 49;\nconst int BLOB_conv12_dw = 58;\nconst int LAYER_conv12_dw_relu = 50;\nconst int BLOB_conv12_dw_conv12_dw_relu = 59;\nconst int LAYER_conv12 = 51;\nconst int BLOB_conv12 = 60;\nconst int LAYER_conv12_relu = 52;\nconst int BLOB_conv12_conv12_relu = 61;\nconst int LAYER_conv13_dw = 53;\nconst int BLOB_conv13_dw = 62;\nconst int LAYER_conv13_dw_relu = 54;\nconst int BLOB_conv13_dw_conv13_dw_relu = 63;\nconst int LAYER_conv13 = 55;\nconst int BLOB_conv13 = 64;\nconst int LAYER_conv13_relu = 56;\nconst int BLOB_conv13_conv13_relu = 65;\nconst int LAYER_splitncnn_2 = 57;\nconst int BLOB_conv13_conv13_relu_splitncnn_0 = 66;\nconst int BLOB_conv13_conv13_relu_splitncnn_1 = 67;\nconst int BLOB_conv13_conv13_relu_splitncnn_2 = 68;\nconst int BLOB_conv13_conv13_relu_splitncnn_3 = 69;\nconst int LAYER_conv14_1 = 58;\nconst int BLOB_conv14_1 = 70;\nconst int LAYER_conv14_1_relu = 59;\nconst int BLOB_conv14_1_conv14_1_relu = 71;\nconst int LAYER_conv14_2 = 60;\nconst int BLOB_conv14_2 = 72;\nconst int LAYER_conv14_2_relu = 61;\nconst int BLOB_conv14_2_conv14_2_relu = 73;\nconst int LAYER_splitncnn_3 = 62;\nconst int BLOB_conv14_2_conv14_2_relu_splitncnn_0 = 74;\nconst int BLOB_conv14_2_conv14_2_relu_splitncnn_1 = 75;\nconst int BLOB_conv14_2_conv14_2_relu_splitncnn_2 = 76;\nconst int BLOB_conv14_2_conv14_2_relu_splitncnn_3 = 77;\nconst int LAYER_conv15_1 = 63;\nconst int BLOB_conv15_1 = 78;\nconst int LAYER_conv15_1_relu = 64;\nconst int BLOB_conv15_1_conv15_1_relu = 79;\nconst int LAYER_conv15_2 = 65;\nconst int BLOB_conv15_2 = 80;\nconst int LAYER_conv15_2_relu = 66;\nconst int BLOB_conv15_2_conv15_2_relu = 81;\nconst int LAYER_splitncnn_4 = 67;\nconst int BLOB_conv15_2_conv15_2_relu_splitncnn_0 = 82;\nconst int BLOB_conv15_2_conv15_2_relu_splitncnn_1 = 83;\nconst int BLOB_conv15_2_conv15_2_relu_splitncnn_2 = 84;\nconst int BLOB_conv15_2_conv15_2_relu_splitncnn_3 = 85;\nconst int LAYER_conv16_1 = 68;\nconst int BLOB_conv16_1 = 86;\nconst int LAYER_conv16_1_relu = 69;\nconst int BLOB_conv16_1_conv16_1_relu = 87;\nconst int LAYER_conv16_2 = 70;\nconst int BLOB_conv16_2 = 88;\nconst int LAYER_conv16_2_relu = 71;\nconst int BLOB_conv16_2_conv16_2_relu = 89;\nconst int LAYER_splitncnn_5 = 72;\nconst int BLOB_conv16_2_conv16_2_relu_splitncnn_0 = 90;\nconst int BLOB_conv16_2_conv16_2_relu_splitncnn_1 = 91;\nconst int BLOB_conv16_2_conv16_2_relu_splitncnn_2 = 92;\nconst int BLOB_conv16_2_conv16_2_relu_splitncnn_3 = 93;\nconst int LAYER_conv17_1 = 73;\nconst int BLOB_conv17_1 = 94;\nconst int LAYER_conv17_1_relu = 74;\nconst int BLOB_conv17_1_conv17_1_relu = 95;\nconst int LAYER_conv17_2 = 75;\nconst int BLOB_conv17_2 = 96;\nconst int LAYER_conv17_2_relu = 76;\nconst int BLOB_conv17_2_conv17_2_relu = 97;\nconst int LAYER_splitncnn_6 = 77;\nconst int BLOB_conv17_2_conv17_2_relu_splitncnn_0 = 98;\nconst int BLOB_conv17_2_conv17_2_relu_splitncnn_1 = 99;\nconst int BLOB_conv17_2_conv17_2_relu_splitncnn_2 = 100;\nconst int LAYER_conv11_mbox_loc = 78;\nconst int BLOB_conv11_mbox_loc = 101;\nconst int LAYER_conv11_mbox_loc_perm = 79;\nconst int BLOB_conv11_mbox_loc_perm = 102;\nconst int LAYER_conv11_mbox_loc_flat = 80;\nconst int BLOB_conv11_mbox_loc_flat = 103;\nconst int LAYER_conv11_mbox_conf = 81;\nconst int BLOB_conv11_mbox_conf = 104;\nconst int LAYER_conv11_mbox_conf_perm = 82;\nconst int BLOB_conv11_mbox_conf_perm = 105;\nconst int LAYER_conv11_mbox_conf_flat = 83;\nconst int BLOB_conv11_mbox_conf_flat = 106;\nconst int LAYER_conv11_mbox_priorbox = 84;\nconst int BLOB_conv11_mbox_priorbox = 107;\nconst int LAYER_conv13_mbox_loc = 85;\nconst int BLOB_conv13_mbox_loc = 108;\nconst int LAYER_conv13_mbox_loc_perm = 86;\nconst int BLOB_conv13_mbox_loc_perm = 109;\nconst int LAYER_conv13_mbox_loc_flat = 87;\nconst int BLOB_conv13_mbox_loc_flat = 110;\nconst int LAYER_conv13_mbox_conf = 88;\nconst int BLOB_conv13_mbox_conf = 111;\nconst int LAYER_conv13_mbox_conf_perm = 89;\nconst int BLOB_conv13_mbox_conf_perm = 112;\nconst int LAYER_conv13_mbox_conf_flat = 90;\nconst int BLOB_conv13_mbox_conf_flat = 113;\nconst int LAYER_conv13_mbox_priorbox = 91;\nconst int BLOB_conv13_mbox_priorbox = 114;\nconst int LAYER_conv14_2_mbox_loc = 92;\nconst int BLOB_conv14_2_mbox_loc = 115;\nconst int LAYER_conv14_2_mbox_loc_perm = 93;\nconst int BLOB_conv14_2_mbox_loc_perm = 116;\nconst int LAYER_conv14_2_mbox_loc_flat = 94;\nconst int BLOB_conv14_2_mbox_loc_flat = 117;\nconst int LAYER_conv14_2_mbox_conf = 95;\nconst int BLOB_conv14_2_mbox_conf = 118;\nconst int LAYER_conv14_2_mbox_conf_perm = 96;\nconst int BLOB_conv14_2_mbox_conf_perm = 119;\nconst int LAYER_conv14_2_mbox_conf_flat = 97;\nconst int BLOB_conv14_2_mbox_conf_flat = 120;\nconst int LAYER_conv14_2_mbox_priorbox = 98;\nconst int BLOB_conv14_2_mbox_priorbox = 121;\nconst int LAYER_conv15_2_mbox_loc = 99;\nconst int BLOB_conv15_2_mbox_loc = 122;\nconst int LAYER_conv15_2_mbox_loc_perm = 100;\nconst int BLOB_conv15_2_mbox_loc_perm = 123;\nconst int LAYER_conv15_2_mbox_loc_flat = 101;\nconst int BLOB_conv15_2_mbox_loc_flat = 124;\nconst int LAYER_conv15_2_mbox_conf = 102;\nconst int BLOB_conv15_2_mbox_conf = 125;\nconst int LAYER_conv15_2_mbox_conf_perm = 103;\nconst int BLOB_conv15_2_mbox_conf_perm = 126;\nconst int LAYER_conv15_2_mbox_conf_flat = 104;\nconst int BLOB_conv15_2_mbox_conf_flat = 127;\nconst int LAYER_conv15_2_mbox_priorbox = 105;\nconst int BLOB_conv15_2_mbox_priorbox = 128;\nconst int LAYER_conv16_2_mbox_loc = 106;\nconst int BLOB_conv16_2_mbox_loc = 129;\nconst int LAYER_conv16_2_mbox_loc_perm = 107;\nconst int BLOB_conv16_2_mbox_loc_perm = 130;\nconst int LAYER_conv16_2_mbox_loc_flat = 108;\nconst int BLOB_conv16_2_mbox_loc_flat = 131;\nconst int LAYER_conv16_2_mbox_conf = 109;\nconst int BLOB_conv16_2_mbox_conf = 132;\nconst int LAYER_conv16_2_mbox_conf_perm = 110;\nconst int BLOB_conv16_2_mbox_conf_perm = 133;\nconst int LAYER_conv16_2_mbox_conf_flat = 111;\nconst int BLOB_conv16_2_mbox_conf_flat = 134;\nconst int LAYER_conv16_2_mbox_priorbox = 112;\nconst int BLOB_conv16_2_mbox_priorbox = 135;\nconst int LAYER_conv17_2_mbox_loc = 113;\nconst int BLOB_conv17_2_mbox_loc = 136;\nconst int LAYER_conv17_2_mbox_loc_perm = 114;\nconst int BLOB_conv17_2_mbox_loc_perm = 137;\nconst int LAYER_conv17_2_mbox_loc_flat = 115;\nconst int BLOB_conv17_2_mbox_loc_flat = 138;\nconst int LAYER_conv17_2_mbox_conf = 116;\nconst int BLOB_conv17_2_mbox_conf = 139;\nconst int LAYER_conv17_2_mbox_conf_perm = 117;\nconst int BLOB_conv17_2_mbox_conf_perm = 140;\nconst int LAYER_conv17_2_mbox_conf_flat = 118;\nconst int BLOB_conv17_2_mbox_conf_flat = 141;\nconst int LAYER_conv17_2_mbox_priorbox = 119;\nconst int BLOB_conv17_2_mbox_priorbox = 142;\nconst int LAYER_mbox_loc = 120;\nconst int BLOB_mbox_loc = 143;\nconst int LAYER_mbox_conf = 121;\nconst int BLOB_mbox_conf = 144;\nconst int LAYER_mbox_priorbox = 122;\nconst int BLOB_mbox_priorbox = 145;\nconst int LAYER_mbox_conf_reshape = 123;\nconst int BLOB_mbox_conf_reshape = 146;\nconst int LAYER_mbox_conf_softmax = 124;\nconst int BLOB_mbox_conf_softmax = 147;\nconst int LAYER_mbox_conf_flatten = 125;\nconst int BLOB_mbox_conf_flatten = 148;\nconst int LAYER_detection_out = 126;\nconst int BLOB_detection_out = 149;\n} // namespace MobileNetSSD_deploy_param_id\n#endif // NCNN_INCLUDE_GUARD_MobileNetSSD_deploy_id_h\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/cpp/MobileNetssd.cpp",
    "content": "#include <android/bitmap.h>\n#include <android/log.h>\n#include <jni.h>\n#include <string>\n#include <vector>\n\n// ncnn\n#include \"include/opencv.h\"\n#include \"MobileNetSSD_deploy.id.h\"   //这里看成自己的id.h\n#include <sys/time.h>\n#include <unistd.h>\n#include \"include/net.h\"\n\nstatic ncnn::UnlockedPoolAllocator g_blob_pool_allocator;\nstatic ncnn::PoolAllocator g_workspace_pool_allocator;\n\nstatic ncnn::Mat ncnn_param;\nstatic ncnn::Mat ncnn_bin;\nstatic ncnn::Net ncnn_net;\n\nextern \"C\" {\n\n\n// public native boolean Init(byte[] words,byte[] param, byte[] bin);　　原函数形式（c++） 以下形式为ndk的c++形式\nJNIEXPORT jboolean JNICALL\nJava_com_example_che_mobilenetssd_1demo_MobileNetssd_Init(JNIEnv *env, jobject obj, jbyteArray param, jbyteArray bin) {\n    __android_log_print(ANDROID_LOG_DEBUG, \"MobileNetssd\", \"enter the jni func\");\n    // init param\n    {\n        int len = env->GetArrayLength(param);\n        ncnn_param.create(len, (size_t) 1u);\n        env->GetByteArrayRegion(param, 0, len, (jbyte *) ncnn_param);\n        int ret = ncnn_net.load_param((const unsigned char *) ncnn_param);\n        __android_log_print(ANDROID_LOG_DEBUG, \"MobileNetssd\", \"load_param %d %d\", ret, len);\n    }\n\n    // init bin\n    {\n        int len = env->GetArrayLength(bin);\n        ncnn_bin.create(len, (size_t) 1u);\n        env->GetByteArrayRegion(bin, 0, len, (jbyte *) ncnn_bin);\n        int ret = ncnn_net.load_model((const unsigned char *) ncnn_bin);\n        __android_log_print(ANDROID_LOG_DEBUG, \"MobileNetssd\", \"load_model %d %d\", ret, len);\n    }\n\n    ncnn::Option opt;\n    opt.lightmode = true;\n    opt.num_threads = 4;   //线程 这里可以修改\n    opt.blob_allocator = &g_blob_pool_allocator;\n    opt.workspace_allocator = &g_workspace_pool_allocator;\n\n    ncnn::set_default_option(opt);\n\n    return JNI_TRUE;\n}\n\n// public native String Detect(Bitmap bitmap);\nJNIEXPORT jfloatArray JNICALL Java_com_example_che_mobilenetssd_1demo_MobileNetssd_Detect(JNIEnv* env, jobject thiz, jobject bitmap)\n{\n    // ncnn from bitmap\n    ncnn::Mat in;\n    {\n        AndroidBitmapInfo info;\n        AndroidBitmap_getInfo(env, bitmap, &info);\n//        int origin_w = info.width;\n//        int origin_h = info.height;\n//        int width = 300;\n//        int height = 300;\n        int width = info.width;\n        int height = info.height;\n        if (info.format != ANDROID_BITMAP_FORMAT_RGBA_8888)\n            return NULL;\n\n        void* indata;\n        AndroidBitmap_lockPixels(env, bitmap, &indata);\n        // 把像素转换成data，并指定通道顺序\n        // 因为图像预处理每个网络层输入的数据格式不一样一般为300*300 128*128等等所以这类需要一个resize的操作可以在cpp中写，也可以是java读入图片时有个resize操作\n//      in = ncnn::Mat::from_pixels_resize((const unsigned char*)indata, ncnn::Mat::PIXEL_RGBA2RGB, origin_w, origin_h, width, height);\n\n        in = ncnn::Mat::from_pixels((const unsigned char*)indata, ncnn::Mat::PIXEL_RGBA2RGB, width, height);\n\n        // 下面一行为debug代码\n        //__android_log_print(ANDROID_LOG_DEBUG, \"MobilenetssdJniIn\", \"Mobilenetssd_predict_has_input1, in.w: %d; in.h: %d\", in.w, in.h);\n        AndroidBitmap_unlockPixels(env, bitmap);\n    }\n\n    // ncnn_net\n    std::vector<float> cls_scores;\n    {\n        // 减去均值和乘上比例（这个数据和前面的归一化图片预处理形式一一对应）\n        const float mean_vals[3] = {127.5f, 127.5f, 127.5f};\n        const float scale[3] = {0.007843f, 0.007843f, 0.007843f};\n\n        in.substract_mean_normalize(mean_vals, scale);// 归一化\n\n        ncnn::Extractor ex = ncnn_net.create_extractor();//前向传播\n\n        // 如果不加密是使用ex.input(\"data\", in);\n        // BLOB_data在id.h文件中可见，相当于datainput网络层的id\n        ex.input(MobileNetSSD_deploy_param_id::BLOB_data, in);\n        //ex.set_num_threads(4); 和上面一样一个对象\n\n        ncnn::Mat out;\n        // 如果时不加密是使用ex.extract(\"prob\", out);\n        //BLOB_detection_out.h文件中可见，相当于dataout网络层的id,输出检测的结果数据\n        ex.extract(MobileNetSSD_deploy_param_id::BLOB_detection_out, out);\n\n        int output_wsize = out.w;\n        int output_hsize = out.h;\n\n        //输出整理\n        jfloat *output[output_wsize * output_hsize];\n        for(int i = 0; i< out.h; i++) {\n            for (int j = 0; j < out.w; j++) {\n                output[i*output_wsize + j] = &out.row(i)[j];\n            }\n        }\n        jfloatArray jOutputData = env->NewFloatArray(output_wsize);\n        if (jOutputData == nullptr) return nullptr;\n        env->SetFloatArrayRegion(jOutputData, 0,  output_wsize * output_hsize,\n                                 reinterpret_cast<const jfloat *>(*output));\n\n        return jOutputData;\n    }\n}\n}\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/cpp/include/allocator.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_ALLOCATOR_H\n#define NCNN_ALLOCATOR_H\n\n#ifdef _WIN32\n#define WIN32_LEAN_AND_MEAN\n#include <windows.h>\n#else\n#include <pthread.h>\n#endif\n\n#include <stdlib.h>\n#include <list>\n\nnamespace ncnn {\n\n// the alignment of all the allocated buffers\n#define MALLOC_ALIGN    16\n\n// Aligns a pointer to the specified number of bytes\n// ptr Aligned pointer\n// n Alignment size that must be a power of two\ntemplate<typename _Tp> static inline _Tp* alignPtr(_Tp* ptr, int n=(int)sizeof(_Tp))\n{\n    return (_Tp*)(((size_t)ptr + n-1) & -n);\n}\n\n// Aligns a buffer size to the specified number of bytes\n// The function returns the minimum number that is greater or equal to sz and is divisible by n\n// sz Buffer size to align\n// n Alignment size that must be a power of two\nstatic inline size_t alignSize(size_t sz, int n)\n{\n    return (sz + n-1) & -n;\n}\n\nstatic inline void* fastMalloc(size_t size)\n{\n    unsigned char* udata = (unsigned char*)malloc(size + sizeof(void*) + MALLOC_ALIGN);\n    if (!udata)\n        return 0;\n    unsigned char** adata = alignPtr((unsigned char**)udata + 1, MALLOC_ALIGN);\n    adata[-1] = udata;\n    return adata;\n}\n\nstatic inline void fastFree(void* ptr)\n{\n    if (ptr)\n    {\n        unsigned char* udata = ((unsigned char**)ptr)[-1];\n        free(udata);\n    }\n}\n\n// exchange-add operation for atomic operations on reference counters\n#if defined __INTEL_COMPILER && !(defined WIN32 || defined _WIN32)\n// atomic increment on the linux version of the Intel(tm) compiler\n#  define NCNN_XADD(addr, delta) (int)_InterlockedExchangeAdd(const_cast<void*>(reinterpret_cast<volatile void*>(addr)), delta)\n#elif defined __GNUC__\n#  if defined __clang__ && __clang_major__ >= 3 && !defined __ANDROID__ && !defined __EMSCRIPTEN__ && !defined(__CUDACC__)\n#    ifdef __ATOMIC_ACQ_REL\n#      define NCNN_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), delta, __ATOMIC_ACQ_REL)\n#    else\n#      define NCNN_XADD(addr, delta) __atomic_fetch_add((_Atomic(int)*)(addr), delta, 4)\n#    endif\n#  else\n#    if defined __ATOMIC_ACQ_REL && !defined __clang__\n// version for gcc >= 4.7\n#      define NCNN_XADD(addr, delta) (int)__atomic_fetch_add((unsigned*)(addr), (unsigned)(delta), __ATOMIC_ACQ_REL)\n#    else\n#      define NCNN_XADD(addr, delta) (int)__sync_fetch_and_add((unsigned*)(addr), (unsigned)(delta))\n#    endif\n#  endif\n#elif defined _MSC_VER && !defined RC_INVOKED\n#  include <intrin.h>\n#  define NCNN_XADD(addr, delta) (int)_InterlockedExchangeAdd((long volatile*)addr, delta)\n#else\n// thread-unsafe branch\nstatic inline int NCNN_XADD(int* addr, int delta) { int tmp = *addr; *addr += delta; return tmp; }\n#endif\n\n#ifdef _WIN32\nclass Mutex\n{\npublic:\n    Mutex() { InitializeSRWLock(&srwlock); }\n    ~Mutex() {}\n    void lock() { AcquireSRWLockExclusive(&srwlock); }\n    void unlock() { ReleaseSRWLockExclusive(&srwlock); }\nprivate:\n    // NOTE SRWLock is available from windows vista\n    SRWLOCK srwlock;\n};\n#else // _WIN32\nclass Mutex\n{\npublic:\n    Mutex() { pthread_mutex_init(&mutex, 0); }\n    ~Mutex() { pthread_mutex_destroy(&mutex); }\n    void lock() { pthread_mutex_lock(&mutex); }\n    void unlock() { pthread_mutex_unlock(&mutex); }\nprivate:\n    pthread_mutex_t mutex;\n};\n#endif // _WIN32\n\nclass Allocator\n{\npublic:\n    virtual ~Allocator() = 0;\n    virtual void* fastMalloc(size_t size) = 0;\n    virtual void fastFree(void* ptr) = 0;\n};\n\nclass PoolAllocator : public Allocator\n{\npublic:\n    PoolAllocator();\n    ~PoolAllocator();\n\n    // ratio range 0 ~ 1\n    // default cr = 0.75\n    void set_size_compare_ratio(float scr);\n\n    // release all budgets immediately\n    void clear();\n\n    virtual void* fastMalloc(size_t size);\n    virtual void fastFree(void* ptr);\n\nprivate:\n    Mutex budgets_lock;\n    Mutex payouts_lock;\n    unsigned int size_compare_ratio;// 0~256\n    std::list< std::pair<size_t, void*> > budgets;\n    std::list< std::pair<size_t, void*> > payouts;\n};\n\nclass UnlockedPoolAllocator : public Allocator\n{\npublic:\n    UnlockedPoolAllocator();\n    ~UnlockedPoolAllocator();\n\n    // ratio range 0 ~ 1\n    // default cr = 0.75\n    void set_size_compare_ratio(float scr);\n\n    // release all budgets immediately\n    void clear();\n\n    virtual void* fastMalloc(size_t size);\n    virtual void fastFree(void* ptr);\n\nprivate:\n    unsigned int size_compare_ratio;// 0~256\n    std::list< std::pair<size_t, void*> > budgets;\n    std::list< std::pair<size_t, void*> > payouts;\n};\n\n} // namespace ncnn\n\n#endif // NCNN_ALLOCATOR_H\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/cpp/include/benchmark.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_BENCHMARK_H\n#define NCNN_BENCHMARK_H\n\n#include \"platform.h\"\n#include \"mat.h\"\n#include \"layer.h\"\n\nnamespace ncnn {\n\n// get now timestamp in ms\ndouble get_current_time();\n\n#if NCNN_BENCHMARK\n\nvoid benchmark(const Layer* layer, double start, double end);\nvoid benchmark(const Layer* layer, const Mat& bottom_blob, Mat& top_blob, double start, double end);\n\n#endif // NCNN_BENCHMARK\n\n} // namespace ncnn\n\n#endif // NCNN_BENCHMARK_H\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/cpp/include/blob.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_BLOB_H\n#define NCNN_BLOB_H\n\n#include <string>\n#include <vector>\n#include \"platform.h\"\n\nnamespace ncnn {\n\nclass Blob\n{\npublic:\n    // empty\n    Blob();\n\npublic:\n#if NCNN_STRING\n    // blob name\n    std::string name;\n#endif // NCNN_STRING\n    // layer index which produce this blob as output\n    int producer;\n    // layer index which need this blob as input\n    std::vector<int> consumers;\n};\n\n} // namespace ncnn\n\n#endif // NCNN_BLOB_H\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/cpp/include/cpu.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_CPU_H\n#define NCNN_CPU_H\n\nnamespace ncnn {\n\n// test optional cpu features\n// neon = armv7 neon or aarch64 asimd\nint cpu_support_arm_neon();\n// vfpv4 = armv7 fp16 + fma\nint cpu_support_arm_vfpv4();\n// asimdhp = aarch64 asimd half precision\nint cpu_support_arm_asimdhp();\n\n// cpu info\nint get_cpu_count();\n\n// bind all threads on little clusters if powersave enabled\n// affacts HMP arch cpu like ARM big.LITTLE\n// only implemented on android at the moment\n// switching powersave is expensive and not thread-safe\n// 0 = all cores enabled(default)\n// 1 = only little clusters enabled\n// 2 = only big clusters enabled\n// return 0 if success for setter function\nint get_cpu_powersave();\nint set_cpu_powersave(int powersave);\n\n// misc function wrapper for openmp routines\nint get_omp_num_threads();\nvoid set_omp_num_threads(int num_threads);\n\nint get_omp_dynamic();\nvoid set_omp_dynamic(int dynamic);\n\n} // namespace ncnn\n\n#endif // NCNN_CPU_H\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/cpp/include/layer.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_LAYER_H\n#define NCNN_LAYER_H\n\n#include <stdio.h>\n#include <string>\n#include <vector>\n#include \"mat.h\"\n#include \"modelbin.h\"\n#include \"paramdict.h\"\n#include \"platform.h\"\n\nnamespace ncnn {\n\nclass Allocator;\nclass Option\n{\npublic:\n    // default option\n    Option();\n\npublic:\n    // light mode\n    // intermediate blob will be recycled when enabled\n    // enabled by default\n    bool lightmode;\n\n    // thread count\n    // default value is the one returned by get_cpu_count()\n    int num_threads;\n\n    // blob memory allocator\n    Allocator* blob_allocator;\n\n    // workspace memory allocator\n    Allocator* workspace_allocator;\n};\n\n// the global default option\nconst Option& get_default_option();\nint set_default_option(const Option& opt);\n\nclass Layer\n{\npublic:\n    // empty\n    Layer();\n    // virtual destructor\n    virtual ~Layer();\n\n    // load layer specific parameter from parsed dict\n    // return 0 if success\n    virtual int load_param(const ParamDict& pd);\n\n    // load layer specific weight data from model binary\n    // return 0 if success\n    virtual int load_model(const ModelBin& mb);\n\npublic:\n    // one input and one output blob\n    bool one_blob_only;\n\n    // support inplace inference\n    bool support_inplace;\n\npublic:\n    // implement inference\n    // return 0 if success\n    virtual int forward(const std::vector<Mat>& bottom_blobs, std::vector<Mat>& top_blobs, const Option& opt = get_default_option()) const;\n    virtual int forward(const Mat& bottom_blob, Mat& top_blob, const Option& opt = get_default_option()) const;\n\n    // implement inplace inference\n    // return 0 if success\n    virtual int forward_inplace(std::vector<Mat>& bottom_top_blobs, const Option& opt = get_default_option()) const;\n    virtual int forward_inplace(Mat& bottom_top_blob, const Option& opt = get_default_option()) const;\n\npublic:\n#if NCNN_STRING\n    // layer type name\n    std::string type;\n    // layer name\n    std::string name;\n#endif // NCNN_STRING\n    // blob index which this layer needs as input\n    std::vector<int> bottoms;\n    // blob index which this layer produces as output\n    std::vector<int> tops;\n};\n\n// layer factory function\ntypedef Layer* (*layer_creator_func)();\n\nstruct layer_registry_entry\n{\n#if NCNN_STRING\n    // layer type name\n    const char* name;\n#endif // NCNN_STRING\n    // layer factory entry\n    layer_creator_func creator;\n};\n\n#if NCNN_STRING\n// get layer type from type name\nint layer_to_index(const char* type);\n// create layer from type name\nLayer* create_layer(const char* type);\n#endif // NCNN_STRING\n// create layer from layer type\nLayer* create_layer(int index);\n\n#define DEFINE_LAYER_CREATOR(name) \\\n    ::ncnn::Layer* name##_layer_creator() { return new name; }\n\n} // namespace ncnn\n\n#endif // NCNN_LAYER_H\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/cpp/include/layer_type.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_LAYER_TYPE_H\n#define NCNN_LAYER_TYPE_H\n\nnamespace ncnn {\n\nnamespace LayerType {\nenum\n{\n#include \"layer_type_enum.h\"\n    CustomBit = (1<<8),\n};\n} // namespace LayerType\n\n} // namespace ncnn\n\n#endif // NCNN_LAYER_TYPE_H\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/cpp/include/layer_type_enum.h",
    "content": "// Layer Type Enum header\n//\n// This file is auto-generated by cmake, don't edit it.\n\nAbsVal = 0,\nArgMax = 1,\nBatchNorm = 2,\nBias = 3,\nBNLL = 4,\nConcat = 5,\nConvolution = 6,\nCrop = 7,\nDeconvolution = 8,\nDropout = 9,\nEltwise = 10,\nELU = 11,\nEmbed = 12,\nExp = 13,\nFlatten = 14,\nInnerProduct = 15,\nInput = 16,\nLog = 17,\nLRN = 18,\nMemoryData = 19,\nMVN = 20,\nPooling = 21,\nPower = 22,\nPReLU = 23,\nProposal = 24,\nReduction = 25,\nReLU = 26,\nReshape = 27,\nROIPooling = 28,\nScale = 29,\nSigmoid = 30,\nSlice = 31,\nSoftmax = 32,\nSplit = 33,\nSPP = 34,\nTanH = 35,\nThreshold = 36,\nTile = 37,\nRNN = 38,\nLSTM = 39,\nBinaryOp = 40,\nUnaryOp = 41,\nConvolutionDepthWise = 42,\nPadding = 43,\nSqueeze = 44,\nExpandDims = 45,\nNormalize = 46,\nPermute = 47,\nPriorBox = 48,\nDetectionOutput = 49,\nInterp = 50,\nDeconvolutionDepthWise = 51,\nShuffleChannel = 52,\nInstanceNorm = 53,\nClip = 54,\nReorg = 55,\nYoloDetectionOutput = 56,\nQuantize = 57,\nDequantize = 58,\nYolov3DetectionOutput = 59,\nPSROIPooling = 60,\nROIAlign = 61,\n\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/cpp/include/mat.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_MAT_H\n#define NCNN_MAT_H\n\n#include <stdlib.h>\n#include <string.h>\n#if __ARM_NEON\n#include <arm_neon.h>\n#endif\n#include \"allocator.h\"\n#include \"platform.h\"\n\nnamespace ncnn {\n\n// the three dimension matrix\nclass Mat\n{\npublic:\n    // empty\n    Mat();\n    // vec\n    Mat(int w, size_t elemsize = 4u, Allocator* allocator = 0);\n    // image\n    Mat(int w, int h, size_t elemsize = 4u, Allocator* allocator = 0);\n    // dim\n    Mat(int w, int h, int c, size_t elemsize = 4u, Allocator* allocator = 0);\n    // copy\n    Mat(const Mat& m);\n    // external vec\n    Mat(int w, void* data, size_t elemsize = 4u, Allocator* allocator = 0);\n    // external image\n    Mat(int w, int h, void* data, size_t elemsize = 4u, Allocator* allocator = 0);\n    // external dim\n    Mat(int w, int h, int c, void* data, size_t elemsize = 4u, Allocator* allocator = 0);\n    // release\n    ~Mat();\n    // assign\n    Mat& operator=(const Mat& m);\n    // set all\n    void fill(float v);\n    void fill(int v);\n    template <typename T> void fill(T v);\n    // deep copy\n    Mat clone(Allocator* allocator = 0) const;\n    // reshape vec\n    Mat reshape(int w, Allocator* allocator = 0) const;\n    // reshape image\n    Mat reshape(int w, int h, Allocator* allocator = 0) const;\n    // reshape dim\n    Mat reshape(int w, int h, int c, Allocator* allocator = 0) const;\n    // allocate vec\n    void create(int w, size_t elemsize = 4u, Allocator* allocator = 0);\n    // allocate image\n    void create(int w, int h, size_t elemsize = 4u, Allocator* allocator = 0);\n    // allocate dim\n    void create(int w, int h, int c, size_t elemsize = 4u, Allocator* allocator = 0);\n    // refcount++\n    void addref();\n    // refcount--\n    void release();\n\n    bool empty() const;\n    size_t total() const;\n\n    // data reference\n    Mat channel(int c);\n    const Mat channel(int c) const;\n    float* row(int y);\n    const float* row(int y) const;\n    template<typename T> T* row(int y);\n    template<typename T> const T* row(int y) const;\n\n    // range reference\n    Mat channel_range(int c, int channels);\n    const Mat channel_range(int c, int channels) const;\n    Mat row_range(int y, int rows);\n    const Mat row_range(int y, int rows) const;\n    Mat range(int x, int n);\n    const Mat range(int x, int n) const;\n\n    // access raw data\n    template<typename T> operator T*();\n    template<typename T> operator const T*() const;\n\n    // convenient access float vec element\n    float& operator[](int i);\n    const float& operator[](int i) const;\n\n#if NCNN_PIXEL\n    enum\n    {\n        PIXEL_CONVERT_SHIFT = 16,\n        PIXEL_FORMAT_MASK = 0x0000ffff,\n        PIXEL_CONVERT_MASK = 0xffff0000,\n\n        PIXEL_RGB       = 1,\n        PIXEL_BGR       = (1 << 1),\n        PIXEL_GRAY      = (1 << 2),\n        PIXEL_RGBA      = (1 << 3),\n\n        PIXEL_RGB2BGR   = PIXEL_RGB | (PIXEL_BGR << PIXEL_CONVERT_SHIFT),\n        PIXEL_RGB2GRAY  = PIXEL_RGB | (PIXEL_GRAY << PIXEL_CONVERT_SHIFT),\n\n        PIXEL_BGR2RGB   = PIXEL_BGR | (PIXEL_RGB << PIXEL_CONVERT_SHIFT),\n        PIXEL_BGR2GRAY  = PIXEL_BGR | (PIXEL_GRAY << PIXEL_CONVERT_SHIFT),\n\n        PIXEL_GRAY2RGB  = PIXEL_GRAY | (PIXEL_RGB << PIXEL_CONVERT_SHIFT),\n        PIXEL_GRAY2BGR  = PIXEL_GRAY | (PIXEL_BGR << PIXEL_CONVERT_SHIFT),\n\n        PIXEL_RGBA2RGB  = PIXEL_RGBA | (PIXEL_RGB << PIXEL_CONVERT_SHIFT),\n        PIXEL_RGBA2BGR  = PIXEL_RGBA | (PIXEL_BGR << PIXEL_CONVERT_SHIFT),\n        PIXEL_RGBA2GRAY = PIXEL_RGBA | (PIXEL_GRAY << PIXEL_CONVERT_SHIFT),\n    };\n    // convenient construct from pixel data\n    static Mat from_pixels(const unsigned char* pixels, int type, int w, int h, Allocator* allocator = 0);\n    // convenient construct from pixel data and resize to specific size\n    static Mat from_pixels_resize(const unsigned char* pixels, int type, int w, int h, int target_width, int target_height, Allocator* allocator = 0);\n\n    // convenient export to pixel data\n    void to_pixels(unsigned char* pixels, int type) const;\n    // convenient export to pixel data and resize to specific size\n    void to_pixels_resize(unsigned char* pixels, int type, int target_width, int target_height) const;\n#endif // NCNN_PIXEL\n\n    // substract channel-wise mean values, then multiply by normalize values, pass 0 to skip\n    void substract_mean_normalize(const float* mean_vals, const float* norm_vals);\n\n    // convenient construct from half precisoin floating point data\n    static Mat from_float16(const unsigned short* data, int size);\n\n    // pointer to the data\n    void* data;\n\n    // pointer to the reference counter\n    // when points to user-allocated data, the pointer is NULL\n    int* refcount;\n\n    // element size in bytes\n    // 4 = float32/int32\n    // 2 = float16\n    // 1 = int8/uint8\n    // 0 = empty\n    size_t elemsize;\n\n    // the allocator\n    Allocator* allocator;\n\n    // the dimensionality\n    int dims;\n\n    int w;\n    int h;\n    int c;\n\n    size_t cstep;\n};\n\n// misc function\n#if NCNN_PIXEL\n// convert yuv420sp(nv21) to rgb, the fast approximate version\nvoid yuv420sp2rgb(const unsigned char* yuv420sp, int w, int h, unsigned char* rgb);\n// image pixel bilinear resize\nvoid resize_bilinear_c1(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h);\nvoid resize_bilinear_c2(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h);\nvoid resize_bilinear_c3(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h);\nvoid resize_bilinear_c4(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h);\n// image pixel bilinear resize, convenient wrapper for yuv420sp(nv21)\nvoid resize_bilinear_yuv420sp(const unsigned char* src, int srcw, int srch, unsigned char* dst, int w, int h);\n#endif // NCNN_PIXEL\n\n// mat process\nenum\n{\n    BORDER_CONSTANT = 0,\n    BORDER_REPLICATE = 1,\n};\nvoid copy_make_border(const Mat& src, Mat& dst, int top, int bottom, int left, int right, int type, float v, Allocator* allocator = 0, int num_threads = 1);\nvoid copy_cut_border(const Mat& src, Mat& dst, int top, int bottom, int left, int right, Allocator* allocator = 0, int num_threads = 1);\nvoid resize_bilinear(const Mat& src, Mat& dst, int w, int h, Allocator* allocator = 0, int num_threads = 1);\n\ninline Mat::Mat()\n    : data(0), refcount(0), elemsize(0), allocator(0), dims(0), w(0), h(0), c(0), cstep(0)\n{\n}\n\ninline Mat::Mat(int _w, size_t _elemsize, Allocator* allocator)\n    : data(0), refcount(0), dims(0)\n{\n    create(_w, _elemsize, allocator);\n}\n\ninline Mat::Mat(int _w, int _h, size_t _elemsize, Allocator* allocator)\n    : data(0), refcount(0), dims(0)\n{\n    create(_w, _h, _elemsize, allocator);\n}\n\ninline Mat::Mat(int _w, int _h, int _c, size_t _elemsize, Allocator* allocator)\n    : data(0), refcount(0), dims(0)\n{\n    create(_w, _h, _c, _elemsize, allocator);\n}\n\ninline Mat::Mat(const Mat& m)\n    : data(m.data), refcount(m.refcount), elemsize(m.elemsize), allocator(m.allocator), dims(m.dims)\n{\n    if (refcount)\n        NCNN_XADD(refcount, 1);\n\n    w = m.w;\n    h = m.h;\n    c = m.c;\n\n    cstep = m.cstep;\n}\n\ninline Mat::Mat(int _w, void* _data, size_t _elemsize, Allocator* _allocator)\n    : data(_data), refcount(0), elemsize(_elemsize), allocator(_allocator), dims(1)\n{\n    w = _w;\n    h = 1;\n    c = 1;\n\n    cstep = w;\n}\n\ninline Mat::Mat(int _w, int _h, void* _data, size_t _elemsize, Allocator* _allocator)\n    : data(_data), refcount(0), elemsize(_elemsize), allocator(_allocator), dims(2)\n{\n    w = _w;\n    h = _h;\n    c = 1;\n\n    cstep = w * h;\n}\n\ninline Mat::Mat(int _w, int _h, int _c, void* _data, size_t _elemsize, Allocator* _allocator)\n    : data(_data), refcount(0), elemsize(_elemsize), allocator(_allocator), dims(3)\n{\n    w = _w;\n    h = _h;\n    c = _c;\n\n    cstep = alignSize(w * h * elemsize, 16) / elemsize;\n}\n\ninline Mat::~Mat()\n{\n    release();\n}\n\ninline Mat& Mat::operator=(const Mat& m)\n{\n    if (this == &m)\n        return *this;\n\n    if (m.refcount)\n        NCNN_XADD(m.refcount, 1);\n\n    release();\n\n    data = m.data;\n    refcount = m.refcount;\n    elemsize = m.elemsize;\n    allocator = m.allocator;\n\n    dims = m.dims;\n    w = m.w;\n    h = m.h;\n    c = m.c;\n\n    cstep = m.cstep;\n\n    return *this;\n}\n\ninline void Mat::fill(float _v)\n{\n    int size = total();\n    float* ptr = (float*)data;\n\n#if __ARM_NEON\n    int nn = size >> 2;\n    int remain = size - (nn << 2);\n#else\n    int remain = size;\n#endif // __ARM_NEON\n\n#if __ARM_NEON\n    float32x4_t _c = vdupq_n_f32(_v);\n#if __aarch64__\n    if (nn > 0)\n    {\n    asm volatile (\n        \"0:                             \\n\"\n        \"subs       %w0, %w0, #1        \\n\"\n        \"st1        {%4.4s}, [%1], #16  \\n\"\n        \"bne        0b                  \\n\"\n        : \"=r\"(nn),     // %0\n          \"=r\"(ptr)     // %1\n        : \"0\"(nn),\n          \"1\"(ptr),\n          \"w\"(_c)       // %4\n        : \"cc\", \"memory\"\n    );\n    }\n#else\n    if (nn > 0)\n    {\n    asm volatile(\n        \"0:                             \\n\"\n        \"subs       %0, #1              \\n\"\n        \"vst1.f32   {%e4-%f4}, [%1 :128]!\\n\"\n        \"bne        0b                  \\n\"\n        : \"=r\"(nn),     // %0\n          \"=r\"(ptr)     // %1\n        : \"0\"(nn),\n          \"1\"(ptr),\n          \"w\"(_c)       // %4\n        : \"cc\", \"memory\"\n    );\n    }\n#endif // __aarch64__\n#endif // __ARM_NEON\n    for (; remain>0; remain--)\n    {\n        *ptr++ = _v;\n    }\n}\n\ninline void Mat::fill(int _v)\n{\n    int size = total();\n    int* ptr = (int*)data;\n\n#if __ARM_NEON\n    int nn = size >> 2;\n    int remain = size - (nn << 2);\n#else\n    int remain = size;\n#endif // __ARM_NEON\n\n#if __ARM_NEON\n    int32x4_t _c = vdupq_n_s32(_v);\n#if __aarch64__\n    if (nn > 0)\n    {\n    asm volatile (\n        \"0:                             \\n\"\n        \"subs       %w0, %w0, #1        \\n\"\n        \"st1        {%4.4s}, [%1], #16  \\n\"\n        \"bne        0b                  \\n\"\n        : \"=r\"(nn),     // %0\n          \"=r\"(ptr)     // %1\n        : \"0\"(nn),\n          \"1\"(ptr),\n          \"w\"(_c)       // %4\n        : \"cc\", \"memory\"\n    );\n    }\n#else\n    if (nn > 0)\n    {\n    asm volatile(\n        \"0:                             \\n\"\n        \"subs       %0, #1              \\n\"\n        \"vst1.s32   {%e4-%f4}, [%1 :128]!\\n\"\n        \"bne        0b                  \\n\"\n        : \"=r\"(nn),     // %0\n          \"=r\"(ptr)     // %1\n        : \"0\"(nn),\n          \"1\"(ptr),\n          \"w\"(_c)       // %4\n        : \"cc\", \"memory\"\n    );\n    }\n#endif // __aarch64__\n#endif // __ARM_NEON\n    for (; remain>0; remain--)\n    {\n        *ptr++ = _v;\n    }\n}\n\ntemplate <typename T>\ninline void Mat::fill(T _v)\n{\n    int size = total();\n    T* ptr = (T*)data;\n    for (int i=0; i<size; i++)\n    {\n        ptr[i] = _v;\n    }\n}\n\ninline Mat Mat::clone(Allocator* allocator) const\n{\n    if (empty())\n        return Mat();\n\n    Mat m;\n    if (dims == 1)\n        m.create(w, elemsize, allocator);\n    else if (dims == 2)\n        m.create(w, h, elemsize, allocator);\n    else if (dims == 3)\n        m.create(w, h, c, elemsize, allocator);\n\n    if (total() > 0)\n    {\n        memcpy(m.data, data, total() * elemsize);\n    }\n\n    return m;\n}\n\ninline Mat Mat::reshape(int _w, Allocator* allocator) const\n{\n    if (w * h * c != _w)\n        return Mat();\n\n    if (dims == 3 && cstep != (size_t)w * h)\n    {\n        Mat m;\n        m.create(_w, elemsize, allocator);\n\n        // flatten\n        for (int i=0; i<c; i++)\n        {\n            const void* ptr = (unsigned char*)data + i * cstep * elemsize;\n            void* mptr = (unsigned char*)m.data + i * w * h * elemsize;\n            memcpy(mptr, ptr, w * h * elemsize);\n        }\n\n        return m;\n    }\n\n    Mat m = *this;\n\n    m.dims = 1;\n    m.w = _w;\n    m.h = 1;\n    m.c = 1;\n\n    m.cstep = _w;\n\n    return m;\n}\n\ninline Mat Mat::reshape(int _w, int _h, Allocator* allocator) const\n{\n    if (w * h * c != _w * _h)\n        return Mat();\n\n    if (dims == 3 && cstep != (size_t)w * h)\n    {\n        Mat m;\n        m.create(_w, _h, elemsize, allocator);\n\n        // flatten\n        for (int i=0; i<c; i++)\n        {\n            const void* ptr = (unsigned char*)data + i * cstep * elemsize;\n            void* mptr = (unsigned char*)m.data + i * w * h * elemsize;\n            memcpy(mptr, ptr, w * h * elemsize);\n        }\n\n        return m;\n    }\n\n    Mat m = *this;\n\n    m.dims = 2;\n    m.w = _w;\n    m.h = _h;\n    m.c = 1;\n\n    m.cstep = _w * _h;\n\n    return m;\n}\n\ninline Mat Mat::reshape(int _w, int _h, int _c, Allocator* allocator) const\n{\n    if (w * h * c != _w * _h * _c)\n        return Mat();\n\n    if (dims < 3)\n    {\n        if ((size_t)_w * _h != alignSize(_w * _h * elemsize, 16) / elemsize)\n        {\n            Mat m;\n            m.create(_w, _h, _c, elemsize, allocator);\n\n            // align channel\n            for (int i=0; i<_c; i++)\n            {\n                const void* ptr = (unsigned char*)data + i * _w * _h * elemsize;\n                void* mptr = (unsigned char*)m.data + i * m.cstep * m.elemsize;\n                memcpy(mptr, ptr, _w * _h * elemsize);\n            }\n\n            return m;\n        }\n    }\n    else if (c != _c)\n    {\n        // flatten and then align\n        Mat tmp = reshape(_w * _h * _c, allocator);\n        return tmp.reshape(_w, _h, _c, allocator);\n    }\n\n    Mat m = *this;\n\n    m.dims = 3;\n    m.w = _w;\n    m.h = _h;\n    m.c = _c;\n\n    m.cstep = alignSize(_w * _h * elemsize, 16) / elemsize;\n\n    return m;\n}\n\ninline void Mat::create(int _w, size_t _elemsize, Allocator* _allocator)\n{\n    if (dims == 1 && w == _w && elemsize == _elemsize && allocator == _allocator)\n        return;\n\n    release();\n\n    elemsize = _elemsize;\n    allocator = _allocator;\n\n    dims = 1;\n    w = _w;\n    h = 1;\n    c = 1;\n\n    cstep = w;\n\n    if (total() > 0)\n    {\n        size_t totalsize = alignSize(total() * elemsize, 4);\n        if (allocator)\n            data = allocator->fastMalloc(totalsize + (int)sizeof(*refcount));\n        else\n            data = fastMalloc(totalsize + (int)sizeof(*refcount));\n        refcount = (int*)(((unsigned char*)data) + totalsize);\n        *refcount = 1;\n    }\n}\n\ninline void Mat::create(int _w, int _h, size_t _elemsize, Allocator* _allocator)\n{\n    if (dims == 2 && w == _w && h == _h && elemsize == _elemsize && allocator == _allocator)\n        return;\n\n    release();\n\n    elemsize = _elemsize;\n    allocator = _allocator;\n\n    dims = 2;\n    w = _w;\n    h = _h;\n    c = 1;\n\n    cstep = w * h;\n\n    if (total() > 0)\n    {\n        size_t totalsize = alignSize(total() * elemsize, 4);\n        if (allocator)\n            data = allocator->fastMalloc(totalsize + (int)sizeof(*refcount));\n        else\n            data = fastMalloc(totalsize + (int)sizeof(*refcount));\n        refcount = (int*)(((unsigned char*)data) + totalsize);\n        *refcount = 1;\n    }\n}\n\ninline void Mat::create(int _w, int _h, int _c, size_t _elemsize, Allocator* _allocator)\n{\n    if (dims == 3 && w == _w && h == _h && c == _c && elemsize == _elemsize && allocator == _allocator)\n        return;\n\n    release();\n\n    elemsize = _elemsize;\n    allocator = _allocator;\n\n    dims = 3;\n    w = _w;\n    h = _h;\n    c = _c;\n\n    cstep = alignSize(w * h * elemsize, 16) / elemsize;\n\n    if (total() > 0)\n    {\n        size_t totalsize = alignSize(total() * elemsize, 4);\n        if (allocator)\n            data = allocator->fastMalloc(totalsize + (int)sizeof(*refcount));\n        else\n            data = fastMalloc(totalsize + (int)sizeof(*refcount));\n        refcount = (int*)(((unsigned char*)data) + totalsize);\n        *refcount = 1;\n    }\n}\n\ninline void Mat::addref()\n{\n    if (refcount)\n        NCNN_XADD(refcount, 1);\n}\n\ninline void Mat::release()\n{\n    if (refcount && NCNN_XADD(refcount, -1) == 1)\n    {\n        if (allocator)\n            allocator->fastFree(data);\n        else\n            fastFree(data);\n    }\n\n    data = 0;\n\n    elemsize = 0;\n\n    dims = 0;\n    w = 0;\n    h = 0;\n    c = 0;\n\n    cstep = 0;\n\n    refcount = 0;\n}\n\ninline bool Mat::empty() const\n{\n    return data == 0 || total() == 0;\n}\n\ninline size_t Mat::total() const\n{\n    return cstep * c;\n}\n\ninline Mat Mat::channel(int c)\n{\n    return Mat(w, h, (unsigned char*)data + cstep * c * elemsize, elemsize, allocator);\n}\n\ninline const Mat Mat::channel(int c) const\n{\n    return Mat(w, h, (unsigned char*)data + cstep * c * elemsize, elemsize, allocator);\n}\n\ninline float* Mat::row(int y)\n{\n    return (float*)data + w * y;\n}\n\ninline const float* Mat::row(int y) const\n{\n    return (const float*)data + w * y;\n}\n\ntemplate <typename T>\ninline T* Mat::row(int y)\n{\n    return (T*)data + w * y;\n}\n\ntemplate <typename T>\ninline const T* Mat::row(int y) const\n{\n    return (const T*)data + w * y;\n}\n\ninline Mat Mat::channel_range(int _c, int channels)\n{\n    return Mat(w, h, channels, (unsigned char*)data + cstep * _c * elemsize, elemsize, allocator);\n}\n\ninline const Mat Mat::channel_range(int _c, int channels) const\n{\n    return Mat(w, h, channels, (unsigned char*)data + cstep * _c * elemsize, elemsize, allocator);\n}\n\ninline Mat Mat::row_range(int y, int rows)\n{\n    return Mat(w, rows, (unsigned char*)data + w * y * elemsize, elemsize, allocator);\n}\n\ninline const Mat Mat::row_range(int y, int rows) const\n{\n    return Mat(w, rows, (unsigned char*)data + w * y * elemsize, elemsize, allocator);\n}\n\ninline Mat Mat::range(int x, int n)\n{\n    return Mat(n, (unsigned char*)data + x * elemsize, elemsize, allocator);\n}\n\ninline const Mat Mat::range(int x, int n) const\n{\n    return Mat(n, (unsigned char*)data + x * elemsize, elemsize, allocator);\n}\n\ntemplate <typename T>\ninline Mat::operator T*()\n{\n    return (T*)data;\n}\n\ntemplate <typename T>\ninline Mat::operator const T*() const\n{\n    return (const T*)data;\n}\n\ninline float& Mat::operator[](int i)\n{\n    return ((float*)data)[i];\n}\n\ninline const float& Mat::operator[](int i) const\n{\n    return ((const float*)data)[i];\n}\n\n} // namespace ncnn\n\n#endif // NCNN_MAT_H\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/cpp/include/modelbin.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_MODELBIN_H\n#define NCNN_MODELBIN_H\n\n#include <stdio.h>\n#include \"mat.h\"\n#include \"platform.h\"\n\nnamespace ncnn {\n\nclass Net;\nclass ModelBin\n{\npublic:\n    // element type\n    // 0 = auto\n    // 1 = float32\n    // 2 = float16\n    // 3 = int8\n    // load vec\n    virtual Mat load(int w, int type) const = 0;\n    // load image\n    virtual Mat load(int w, int h, int type) const;\n    // load dim\n    virtual Mat load(int w, int h, int c, int type) const;\n};\n\n#if NCNN_STDIO\nclass ModelBinFromStdio : public ModelBin\n{\npublic:\n    // construct from file\n    ModelBinFromStdio(FILE* binfp);\n\n    virtual Mat load(int w, int type) const;\n\nprotected:\n    FILE* binfp;\n};\n#endif // NCNN_STDIO\n\nclass ModelBinFromMemory : public ModelBin\n{\npublic:\n    // construct from external memory\n    ModelBinFromMemory(const unsigned char*& mem);\n\n    virtual Mat load(int w, int type) const;\n\nprotected:\n    const unsigned char*& mem;\n};\n\nclass ModelBinFromMatArray : public ModelBin\n{\npublic:\n    // construct from weight blob array\n    ModelBinFromMatArray(const Mat* weights);\n\n    virtual Mat load(int w, int type) const;\n\nprotected:\n    mutable const Mat* weights;\n};\n\n} // namespace ncnn\n\n#endif // NCNN_MODELBIN_H\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/cpp/include/net.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_NET_H\n#define NCNN_NET_H\n\n#include <stdio.h>\n#include <vector>\n#include \"blob.h\"\n#include \"layer.h\"\n#include \"mat.h\"\n#include \"platform.h\"\n\nnamespace ncnn {\n\nclass Extractor;\nclass Net\n{\npublic:\n    // empty init\n    Net();\n    // clear and destroy\n    ~Net();\n\n#if NCNN_STRING\n    // register custom layer by layer type name\n    // return 0 if success\n    int register_custom_layer(const char* type, layer_creator_func creator);\n#endif // NCNN_STRING\n    // register custom layer by layer type\n    // return 0 if success\n    int register_custom_layer(int index, layer_creator_func creator);\n\n#if NCNN_STDIO\n#if NCNN_STRING\n    // load network structure from plain param file\n    // return 0 if success\n    int load_param(FILE* fp);\n    int load_param(const char* protopath);\n    int load_param_mem(const char* mem);\n#endif // NCNN_STRING\n    // load network structure from binary param file\n    // return 0 if success\n    int load_param_bin(FILE* fp);\n    int load_param_bin(const char* protopath);\n\n    // load network weight data from model file\n    // return 0 if success\n    int load_model(FILE* fp);\n    int load_model(const char* modelpath);\n#endif // NCNN_STDIO\n\n    // load network structure from external memory\n    // memory pointer must be 32-bit aligned\n    // return bytes consumed\n    int load_param(const unsigned char* mem);\n\n    // reference network weight data from external memory\n    // weight data is not copied but referenced\n    // so external memory should be retained when used\n    // memory pointer must be 32-bit aligned\n    // return bytes consumed\n    int load_model(const unsigned char* mem);\n\n    // unload network structure and weight data\n    void clear();\n\n    // construct an Extractor from network\n    Extractor create_extractor() const;\n\npublic:\n    // enable winograd convolution optimization\n    // improve convolution 3x3 stride1 performace, may consume more memory\n    // changes should be applied before loading network structure and weight\n    // enabled by default\n    int use_winograd_convolution;\n\n    // enable sgemm convolution optimization\n    // improve convolution 1x1 stride1 performace, may consume more memory\n    // changes should be applied before loading network structure and weight\n    // enabled by default\n    int use_sgemm_convolution;\n\n    // enable quantized int8 inference\n    // use low-precision int8 path for quantized model\n    // changes should be applied before loading network structure and weight\n    // enabled by default\n    int use_int8_inference;\n\nprotected:\n    friend class Extractor;\n#if NCNN_STRING\n    int find_blob_index_by_name(const char* name) const;\n    int find_layer_index_by_name(const char* name) const;\n    int custom_layer_to_index(const char* type);\n    Layer* create_custom_layer(const char* type);\n#endif // NCNN_STRING\n    Layer* create_custom_layer(int index);\n    int forward_layer(int layer_index, std::vector<Mat>& blob_mats, Option& opt) const;\n\nprotected:\n    std::vector<Blob> blobs;\n    std::vector<Layer*> layers;\n\n    std::vector<layer_registry_entry> custom_layer_registry;\n};\n\nclass Extractor\n{\npublic:\n    // enable light mode\n    // intermediate blob will be recycled when enabled\n    // enabled by default\n    void set_light_mode(bool enable);\n\n    // set thread count for this extractor\n    // this will overwrite the global setting\n    // default count is system depended\n    void set_num_threads(int num_threads);\n\n    // set blob memory allocator\n    void set_blob_allocator(Allocator* allocator);\n\n    // set workspace memory allocator\n    void set_workspace_allocator(Allocator* allocator);\n\n#if NCNN_STRING\n    // set input by blob name\n    // return 0 if success\n    int input(const char* blob_name, const Mat& in);\n\n    // get result by blob name\n    // return 0 if success\n    int extract(const char* blob_name, Mat& feat);\n#endif // NCNN_STRING\n\n    // set input by blob index\n    // return 0 if success\n    int input(int blob_index, const Mat& in);\n\n    // get result by blob index\n    // return 0 if success\n    int extract(int blob_index, Mat& feat);\n\nprotected:\n    friend Extractor Net::create_extractor() const;\n    Extractor(const Net* net, int blob_count);\n\nprivate:\n    const Net* net;\n    std::vector<Mat> blob_mats;\n    Option opt;\n};\n\n} // namespace ncnn\n\n#endif // NCNN_NET_H\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/cpp/include/opencv.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_OPENCV_H\n#define NCNN_OPENCV_H\n\n#include \"platform.h\"\n\n#if NCNN_OPENCV\n\n#include <algorithm>\n#include <string>\n#include \"mat.h\"\n\n// minimal opencv style data structure implementation\nnamespace cv\n{\n\nstruct Size\n{\n    Size() : width(0), height(0) {}\n    Size(int _w, int _h) : width(_w), height(_h) {}\n\n    int width;\n    int height;\n};\n\ntemplate<typename _Tp>\nstruct Rect_\n{\n    Rect_() : x(0), y(0), width(0), height(0) {}\n    Rect_(_Tp _x, _Tp _y, _Tp _w, _Tp _h) : x(_x), y(_y), width(_w), height(_h) {}\n\n    _Tp x;\n    _Tp y;\n    _Tp width;\n    _Tp height;\n\n    // area\n    _Tp area() const\n    {\n        return width * height;\n    }\n};\n\ntemplate<typename _Tp> static inline Rect_<_Tp>& operator &= ( Rect_<_Tp>& a, const Rect_<_Tp>& b )\n{\n    _Tp x1 = std::max(a.x, b.x), y1 = std::max(a.y, b.y);\n    a.width = std::min(a.x + a.width, b.x + b.width) - x1;\n    a.height = std::min(a.y + a.height, b.y + b.height) - y1;\n    a.x = x1; a.y = y1;\n    if( a.width <= 0 || a.height <= 0 )\n        a = Rect_<_Tp>();\n    return a;\n}\n\ntemplate<typename _Tp> static inline Rect_<_Tp>& operator |= ( Rect_<_Tp>& a, const Rect_<_Tp>& b )\n{\n    _Tp x1 = std::min(a.x, b.x), y1 = std::min(a.y, b.y);\n    a.width = std::max(a.x + a.width, b.x + b.width) - x1;\n    a.height = std::max(a.y + a.height, b.y + b.height) - y1;\n    a.x = x1; a.y = y1;\n    return a;\n}\n\ntemplate<typename _Tp> static inline Rect_<_Tp> operator & (const Rect_<_Tp>& a, const Rect_<_Tp>& b)\n{\n    Rect_<_Tp> c = a;\n    return c &= b;\n}\n\ntemplate<typename _Tp> static inline Rect_<_Tp> operator | (const Rect_<_Tp>& a, const Rect_<_Tp>& b)\n{\n    Rect_<_Tp> c = a;\n    return c |= b;\n}\n\ntypedef Rect_<int> Rect;\ntypedef Rect_<float> Rect2f;\n\ntemplate<typename _Tp>\nstruct Point_\n{\n    Point_() : x(0), y(0) {}\n    Point_(_Tp _x, _Tp _y) : x(_x), y(_y) {}\n\n    _Tp x;\n    _Tp y;\n};\n\ntypedef Point_<int> Point;\ntypedef Point_<float> Point2f;\n\n#define CV_8UC1 1\n#define CV_8UC3 3\n#define CV_8UC4 4\n#define CV_32FC1 4\n\nstruct Mat\n{\n    Mat() : data(0), refcount(0), rows(0), cols(0), c(0) {}\n\n    Mat(int _rows, int _cols, int flags) : data(0), refcount(0)\n    {\n        create(_rows, _cols, flags);\n    }\n\n    // copy\n    Mat(const Mat& m) : data(m.data), refcount(m.refcount)\n    {\n        if (refcount)\n            NCNN_XADD(refcount, 1);\n\n        rows = m.rows;\n        cols = m.cols;\n        c = m.c;\n    }\n\n    Mat(int _rows, int _cols, int flags, void* _data) : data((unsigned char*)_data), refcount(0)\n    {\n        rows = _rows;\n        cols = _cols;\n        c = flags;\n    }\n\n    ~Mat()\n    {\n        release();\n    }\n\n    // assign\n    Mat& operator=(const Mat& m)\n    {\n        if (this == &m)\n            return *this;\n\n        if (m.refcount)\n            NCNN_XADD(m.refcount, 1);\n\n        release();\n\n        data = m.data;\n        refcount = m.refcount;\n\n        rows = m.rows;\n        cols = m.cols;\n        c = m.c;\n\n        return *this;\n    }\n\n    void create(int _rows, int _cols, int flags)\n    {\n        release();\n\n        rows = _rows;\n        cols = _cols;\n        c = flags;\n\n        if (total() > 0)\n        {\n            // refcount address must be aligned, so we expand totalsize here\n            size_t totalsize = (total() + 3) >> 2 << 2;\n            data = (unsigned char*)ncnn::fastMalloc(totalsize + (int)sizeof(*refcount));\n            refcount = (int*)(((unsigned char*)data) + totalsize);\n            *refcount = 1;\n        }\n    }\n\n    void release()\n    {\n        if (refcount && NCNN_XADD(refcount, -1) == 1)\n            ncnn::fastFree(data);\n\n        data = 0;\n\n        rows = 0;\n        cols = 0;\n        c = 0;\n\n        refcount = 0;\n    }\n\n    Mat clone() const\n    {\n        if (empty())\n            return Mat();\n\n        Mat m(rows, cols, c);\n\n        if (total() > 0)\n        {\n            memcpy(m.data, data, total());\n        }\n\n        return m;\n    }\n\n    bool empty() const { return data == 0 || total() == 0; }\n\n    int channels() const { return c; }\n\n    size_t total() const { return cols * rows * c; }\n\n    const unsigned char* ptr(int y) const { return data + y * cols * c; }\n\n    unsigned char* ptr(int y) { return data + y * cols * c; }\n\n    // roi\n    Mat operator()( const Rect& roi ) const\n    {\n        if (empty())\n            return Mat();\n\n        Mat m(roi.height, roi.width, c);\n\n        int sy = roi.y;\n        for (int y = 0; y < roi.height; y++)\n        {\n            const unsigned char* sptr = ptr(sy) + roi.x * c;\n            unsigned char* dptr = m.ptr(y);\n            memcpy(dptr, sptr, roi.width * c);\n            sy++;\n        }\n\n        return m;\n    }\n\n    unsigned char* data;\n\n    // pointer to the reference counter;\n    // when points to user-allocated data, the pointer is NULL\n    int* refcount;\n\n    int rows;\n    int cols;\n\n    int c;\n\n};\n\n#define CV_LOAD_IMAGE_GRAYSCALE 1\n#define CV_LOAD_IMAGE_COLOR 3\nMat imread(const std::string& path, int flags);\nvoid imwrite(const std::string& path, const Mat& m);\n\n#if NCNN_PIXEL\nvoid resize(const Mat& src, Mat& dst, const Size& size, float sw = 0.f, float sh = 0.f, int flags = 0);\n#endif // NCNN_PIXEL\n\n} // namespace cv\n\n#endif // NCNN_OPENCV\n\n#endif // NCNN_OPENCV_H\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/cpp/include/paramdict.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_PARAMDICT_H\n#define NCNN_PARAMDICT_H\n\n#include <stdio.h>\n#include \"mat.h\"\n#include \"platform.h\"\n\n// at most 20 parameters\n#define NCNN_MAX_PARAM_COUNT 20\n\nnamespace ncnn {\n\nclass Net;\nclass ParamDict\n{\npublic:\n    // empty\n    ParamDict();\n\n    // get int\n    int get(int id, int def) const;\n    // get float\n    float get(int id, float def) const;\n    // get array\n    Mat get(int id, const Mat& def) const;\n\n    // set int\n    void set(int id, int i);\n    // set float\n    void set(int id, float f);\n    // set array\n    void set(int id, const Mat& v);\n\npublic:\n    int use_winograd_convolution;\n    int use_sgemm_convolution;\n    int use_int8_inference;\n\nprotected:\n    friend class Net;\n\n    void clear();\n\n#if NCNN_STDIO\n#if NCNN_STRING\n    int load_param(FILE* fp);\n    int load_param_mem(const char*& mem);\n#endif // NCNN_STRING\n    int load_param_bin(FILE* fp);\n#endif // NCNN_STDIO\n    int load_param(const unsigned char*& mem);\n\nprotected:\n    struct\n    {\n        int loaded;\n        union { int i; float f; };\n        Mat v;\n    } params[NCNN_MAX_PARAM_COUNT];\n};\n\n} // namespace ncnn\n\n#endif // NCNN_PARAMDICT_H\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/cpp/include/platform.h",
    "content": "// Tencent is pleased to support the open source community by making ncnn available.\n//\n// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.\n//\n// Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n// in compliance with the License. You may obtain a copy of the License at\n//\n// https://opensource.org/licenses/BSD-3-Clause\n//\n// Unless required by applicable law or agreed to in writing, software distributed\n// under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations under the License.\n\n#ifndef NCNN_PLATFORM_H\n#define NCNN_PLATFORM_H\n\n#define NCNN_STDIO 1\n#define NCNN_STRING 1\n#define NCNN_OPENCV 0\n#define NCNN_BENCHMARK 0\n#define NCNN_PIXEL 1\n#define NCNN_PIXEL_ROTATE 0\n\n#endif // NCNN_PLATFORM_H\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/java/com/example/che/mobilenetssd_demo/MainActivity.java",
    "content": "package com.example.che.mobilenetssd_demo;\n\nimport android.Manifest;\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.content.pm.PackageManager;\nimport android.content.res.AssetManager;\nimport android.graphics.Bitmap;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.net.Uri;\nimport android.support.annotation.NonNull;\nimport android.support.annotation.Nullable;\nimport android.support.v4.app.ActivityCompat;\nimport android.support.v4.content.ContextCompat;\nimport android.support.v7.app.AppCompatActivity;\nimport android.os.Bundle;\nimport android.text.method.ScrollingMovementMethod;\nimport android.util.Log;\nimport android.view.View;\nimport android.widget.Button;\nimport android.widget.ImageView;\nimport android.widget.TextView;\nimport android.widget.Toast;\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\n\n\nimport com.bumptech.glide.Glide;\nimport com.bumptech.glide.load.engine.DiskCacheStrategy;\nimport com.bumptech.glide.request.RequestOptions;\n\n\npublic class MainActivity extends AppCompatActivity {\n\n    private static final String TAG = MainActivity.class.getName();\n    private static final int USE_PHOTO = 1001;\n    private String camera_image_path;\n    private ImageView show_image;\n    private TextView result_text;\n    private boolean load_result = false;\n    private int[] ddims = {1, 3, 300, 300}; //这里的维度的值要和train model的input 一一对应\n    private int model_index = 1;\n    private List<String> resultLabel = new ArrayList<>();\n    private MobileNetssd mobileNetssd = new MobileNetssd(); //java接口实例化　下面直接利用java函数调用NDK c++函数\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n        try\n        {\n            initMobileNetSSD();\n        } catch (IOException e) {\n            Log.e(\"MainActivity\", \"initMobileNetSSD error\");\n        }\n        init_view();\n        readCacheLabelFromLocalFile();\n}\n\n    /**\n     *\n     * MobileNetssd初始化，也就是把model文件进行加载\n     */\n    private void initMobileNetSSD() throws IOException {\n        byte[] param = null;\n        byte[] bin = null;\n        {\n            //用io流读取二进制文件，最后存入到byte[]数组中\n            InputStream assetsInputStream = getAssets().open(\"MobileNetSSD_deploy.param.bin\");// param：  网络结构文件\n            int available = assetsInputStream.available();\n            param = new byte[available];\n            int byteCode = assetsInputStream.read(param);\n            assetsInputStream.close();\n        }\n        {\n            //用io流读取二进制文件，最后存入到byte上，转换为int型\n            InputStream assetsInputStream = getAssets().open(\"MobileNetSSD_deploy.bin\");//bin：   model文件\n            int available = assetsInputStream.available();\n            bin = new byte[available];\n            int byteCode = assetsInputStream.read(bin);\n            assetsInputStream.close();\n        }\n\n        load_result = mobileNetssd.Init(param, bin);// 再将文件传入java的NDK接口(c++ 代码中的init接口 )\n        Log.d(\"load model\", \"MobileNetSSD_load_model_result:\" + load_result);\n    }\n\n\n    // initialize view\n    private void init_view() {\n        request_permissions();\n        show_image = (ImageView) findViewById(R.id.show_image);\n        result_text = (TextView) findViewById(R.id.result_text);\n        result_text.setMovementMethod(ScrollingMovementMethod.getInstance());\n        Button use_photo = (Button) findViewById(R.id.use_photo);\n        // use photo click\n        use_photo.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View view) {\n                if (!load_result) {\n                    Toast.makeText(MainActivity.this, \"never load model\", Toast.LENGTH_SHORT).show();\n                    return;\n                }\n                PhotoUtil.use_photo(MainActivity.this, USE_PHOTO);\n            }\n        });\n    }\n\n    // load label's name\n    private void readCacheLabelFromLocalFile() {\n        try {\n            AssetManager assetManager = getApplicationContext().getAssets();\n            BufferedReader reader = new BufferedReader(new InputStreamReader(assetManager.open(\"words.txt\")));//这里是label的文件\n            String readLine = null;\n            while ((readLine = reader.readLine()) != null) {\n                resultLabel.add(readLine);\n            }\n            reader.close();\n        } catch (Exception e) {\n            Log.e(\"labelCache\", \"error \" + e);\n        }\n    }\n\n\n    protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n        String image_path;\n        RequestOptions options = new RequestOptions().skipMemoryCache(true).diskCacheStrategy(DiskCacheStrategy.NONE);\n        if (resultCode == Activity.RESULT_OK) {\n            switch (requestCode) {\n                case USE_PHOTO:\n                    if (data == null) {\n                        Log.w(TAG, \"user photo data is null\");\n                        return;\n                    }\n                    Uri image_uri = data.getData();\n\n                    //Glide.with(MainActivity.this).load(image_uri).apply(options).into(show_image);\n\n                    // get image path from uri\n                    image_path = PhotoUtil.get_path_from_URI(MainActivity.this, image_uri);\n                    // predict image\n                    predict_image(image_path);\n                    break;\n            }\n        }\n    }\n\n    //  predict image\n    private void predict_image(String image_path) {\n        // picture to float array\n        Bitmap bmp = PhotoUtil.getScaleBitmap(image_path);\n        Bitmap rgba = bmp.copy(Bitmap.Config.ARGB_8888, true);\n        // resize to 300*300\n        Bitmap input_bmp = Bitmap.createScaledBitmap(rgba, ddims[2], ddims[3], false);\n        try {\n            // Data format conversion takes too long\n            // Log.d(\"inputData\", Arrays.toString(inputData));\n            long start = System.currentTimeMillis();\n            // get predict result\n            float[] result = mobileNetssd.Detect(input_bmp);\n            // time end\n            long end = System.currentTimeMillis();\n            Log.d(TAG, \"origin predict result:\" + Arrays.toString(result));\n            long time = end - start;\n            Log.d(\"result length\", \"length of result: \" + String.valueOf(result.length));\n            // show predict result and time\n            float[] r = get_max_result(result);\n\n            String show_text = \"result：\" + Arrays.toString(r) + \"\\nname：\" + resultLabel.get((int) r[0]) + \"\\nprobability：\" + r[1] + \"\\ntime：\" + time + \"ms\" ;\n            result_text.setText(show_text);\n            Canvas canvas = new Canvas(rgba);\n            //图像上画矩形\n            Paint paint = new Paint();\n            paint.setColor(Color.RED);\n            paint.setStyle(Paint.Style.STROKE);//不填充\n            paint.setStrokeWidth(10); //线的宽度\n            canvas.drawRect(r[2]*rgba.getWidth(), r[3]*rgba.getHeight(), r[4]*rgba.getWidth(), r[5]*rgba.getHeight(), paint);\n            show_image.setImageBitmap(rgba);\n\n\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n    }\n\n    // get max probability label\n    private float[] get_max_result(float[] result) {\n        int num_rs = result.length / 6;\n        float maxProp = result[1];\n        int maxI = 0;\n        for(int i = 1; i<num_rs;i++){\n            if(maxProp<result[i*6+1]){\n                maxProp = result[i*6+1];\n                maxI = i;\n            }\n        }\n        float[] ret = {0,0,0,0,0,0};\n        for(int j=0;j<6;j++){\n            ret[j] = result[maxI*6 + j];\n        }\n        return ret;\n    }\n\n    // request permissions(add)\n    private void request_permissions() {\n        List<String> permissionList = new ArrayList<>();\n        if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {\n            permissionList.add(Manifest.permission.CAMERA);\n        }\n        if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n            permissionList.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);\n        }\n        if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n            permissionList.add(Manifest.permission.READ_EXTERNAL_STORAGE);\n        }\n        // if list is not empty will request permissions\n        if (!permissionList.isEmpty()) {\n            ActivityCompat.requestPermissions(this, permissionList.toArray(new String[permissionList.size()]), 1);\n        }\n    }\n\n    @Override\n    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {\n        super.onRequestPermissionsResult(requestCode, permissions, grantResults);\n        switch (requestCode) {\n            case 1:\n                if (grantResults.length > 0) {\n                    for (int i = 0; i < grantResults.length; i++) {\n                        int grantResult = grantResults[i];\n                        if (grantResult == PackageManager.PERMISSION_DENIED) {\n                            String s = permissions[i];\n                            Toast.makeText(this, s + \"permission was denied\", Toast.LENGTH_SHORT).show();\n                        }\n                    }\n                }\n                break;\n        }\n    }\n\n\n\n}\n\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/java/com/example/che/mobilenetssd_demo/MobileNetssd.java",
    "content": "package com.example.che.mobilenetssd_demo;\n\nimport android.graphics.Bitmap;\n\n/**\n *  MobileNetssd的java接口，与本地c++代码相呼应 native为本地 此文件与 MobileNetssd.cpp相呼应\n */\npublic class MobileNetssd {\n\n    public native boolean Init(byte[] param, byte[] bin); // 初始化函数\n    public native float[] Detect(Bitmap bitmap); // 检测函数\n    // Used to load the 'native-lib' library on application startup.\n    static {\n        System.loadLibrary(\"MobileNetssd\");\n    }\n}\n\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/java/com/example/che/mobilenetssd_demo/PhotoUtil.java",
    "content": "package com.example.che.mobilenetssd_demo;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.database.Cursor;\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapFactory;\nimport android.net.Uri;\nimport android.provider.MediaStore;\n\npublic class PhotoUtil {\n    // get picture in photo\n    public static void use_photo(Activity activity, int requestCode) {\n        Intent intent = new Intent(Intent.ACTION_PICK);\n        intent.setType(\"image/*\");\n        activity.startActivityForResult(intent, requestCode);\n    }\n\n    // get photo from Uri\n    public static String get_path_from_URI(Context context, Uri uri) {\n        String result;\n        Cursor cursor = context.getContentResolver().query(uri, null, null, null, null);\n        if (cursor == null) {\n            result = uri.getPath();\n        } else {\n            cursor.moveToFirst();\n            int idx = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA);\n            result = cursor.getString(idx);\n            cursor.close();\n        }\n        return result;\n    }\n\n    // compress picture\n    public static Bitmap getScaleBitmap(String filePath) {\n        BitmapFactory.Options opt = new BitmapFactory.Options();\n        opt.inJustDecodeBounds = true;\n        BitmapFactory.decodeFile(filePath, opt);\n\n        int bmpWidth = opt.outWidth;\n        int bmpHeight = opt.outHeight;\n\n        int maxSize = 500;\n\n        // compress picture with inSampleSize\n        opt.inSampleSize = 1;\n        while (true) {\n            if (bmpWidth / opt.inSampleSize < maxSize || bmpHeight / opt.inSampleSize < maxSize) {\n                break;\n            }\n            opt.inSampleSize *= 2;\n        }\n        opt.inJustDecodeBounds = false;\n        return BitmapFactory.decodeFile(filePath, opt);\n    }\n}\n\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/res/drawable/ic_launcher_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportWidth=\"108\"\n    android:viewportHeight=\"108\">\n    <path\n        android:fillColor=\"#008577\"\n        android:pathData=\"M0,0h108v108h-108z\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M9,0L9,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,0L19,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M29,0L29,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M39,0L39,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M49,0L49,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M59,0L59,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M69,0L69,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M79,0L79,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M89,0L89,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M99,0L99,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,9L108,9\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,19L108,19\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,29L108,29\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,39L108,39\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,49L108,49\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,59L108,59\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,69L108,69\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,79L108,79\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,89L108,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,99L108,99\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,29L89,29\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,39L89,39\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,49L89,49\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,59L89,59\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,69L89,69\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,79L89,79\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M29,19L29,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M39,19L39,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M49,19L49,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M59,19L59,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M69,19L69,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M79,19L79,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n</vector>\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/res/drawable-v24/ic_launcher_foreground.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:aapt=\"http://schemas.android.com/aapt\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportWidth=\"108\"\n    android:viewportHeight=\"108\">\n    <path\n        android:fillType=\"evenOdd\"\n        android:pathData=\"M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z\"\n        android:strokeWidth=\"1\"\n        android:strokeColor=\"#00000000\">\n        <aapt:attr name=\"android:fillColor\">\n            <gradient\n                android:endX=\"78.5885\"\n                android:endY=\"90.9159\"\n                android:startX=\"48.7653\"\n                android:startY=\"61.0927\"\n                android:type=\"linear\">\n                <item\n                    android:color=\"#44000000\"\n                    android:offset=\"0.0\" />\n                <item\n                    android:color=\"#00000000\"\n                    android:offset=\"1.0\" />\n            </gradient>\n        </aapt:attr>\n    </path>\n    <path\n        android:fillColor=\"#FFFFFF\"\n        android:fillType=\"nonZero\"\n        android:pathData=\"M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z\"\n        android:strokeWidth=\"1\"\n        android:strokeColor=\"#00000000\" />\n</vector>\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:context=\".MainActivity\">\n    <LinearLayout\n        android:id=\"@+id/btn_ll\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:orientation=\"horizontal\">\n        <Button\n            android:id=\"@+id/use_photo\"\n            android:layout_weight=\"1\"\n            android:layout_width=\"0dp\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"相册\"/>\n    </LinearLayout>\n    <TextView\n        android:layout_above=\"@id/btn_ll\"\n        android:id=\"@+id/result_text\"\n        android:textSize=\"16sp\"\n        android:layout_width=\"match_parent\"\n        android:hint=\"预测结果会在这里显示\"\n        android:layout_height=\"100dp\"/>\n    <ImageView\n        android:layout_alignParentTop=\"true\"\n        android:layout_above=\"@id/result_text\"\n        android:id=\"@+id/show_image\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"/>\n</RelativeLayout>\n\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\" />\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\" />\n</adaptive-icon>"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\" />\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\" />\n</adaptive-icon>"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#008577</color>\n    <color name=\"colorPrimaryDark\">#00574B</color>\n    <color name=\"colorAccent\">#D81B60</color>\n</resources>\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">MobileNetSSD_demo</string>\n</resources>\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n        <!-- Customize your theme here. -->\n        <item name=\"colorPrimary\">@color/colorPrimary</item>\n        <item name=\"colorPrimaryDark\">@color/colorPrimaryDark</item>\n        <item name=\"colorAccent\">@color/colorAccent</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "MobileNetSSD_demo_single/app/src/test/java/com/example/che/mobilenetssd_demo/ExampleUnitTest.java",
    "content": "package com.example.che.mobilenetssd_demo;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local unit test, which will execute on the development machine (host).\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\npublic class ExampleUnitTest {\n    @Test\n    public void addition_isCorrect() {\n        assertEquals(4, 2 + 2);\n    }\n}"
  },
  {
    "path": "MobileNetSSD_demo_single/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    \n    repositories {\n        google()\n        jcenter()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:3.2.1'\n        \n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        google()\n        jcenter()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "MobileNetSSD_demo_single/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-4.6-all.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "MobileNetSSD_demo_single/gradle.properties",
    "content": "# Project-wide Gradle settings.\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\norg.gradle.jvmargs=-Xmx1536m\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n\n\n"
  },
  {
    "path": "MobileNetSSD_demo_single/gradlew",
    "content": "#!/usr/bin/env sh\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn () {\n    echo \"$*\"\n}\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" -a \"$nonstop\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Escape application args\nsave () {\n    for i do printf %s\\\\n \"$i\" | sed \"s/'/'\\\\\\\\''/g;1s/^/'/;\\$s/\\$/' \\\\\\\\/\" ; done\n    echo \" \"\n}\nAPP_ARGS=$(save \"$@\")\n\n# Collect all arguments for the java command, following the shell quoting and substitution rules\neval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS \"\\\"-Dorg.gradle.appname=$APP_BASE_NAME\\\"\" -classpath \"\\\"$CLASSPATH\\\"\" org.gradle.wrapper.GradleWrapperMain \"$APP_ARGS\"\n\n# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong\nif [ \"$(uname)\" = \"Darwin\" ] && [ \"$HOME\" = \"$PWD\" ]; then\n  cd \"$(dirname \"$0\")\"\nfi\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "MobileNetSSD_demo_single/gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windows variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "MobileNetSSD_demo_single/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "README.md",
    "content": "# ncnnforandroid_objectiondetection_Mobilenetssd\n利用Mobilenetssd目标检测框架,ncnn前向推理,android项目\n请看我的个人blog配套教程\n - [MobileNetSSD通过Ncnn前向推理框架在PC端的使用(目标检测 objection detection)](https://blog.csdn.net/qq_33431368/article/details/84990390)\n - [MobileNetSSD通过Ncnn前向推理框架在Android端的使用--Cmake编译(目标检测 objection detection)](https://blog.csdn.net/qq_33431368/article/details/85009758)\n - [MobileNetSSD通过Ncnn前向推理框架在Android端的使用--Cmake编译(目标检测 objection detection)补充篇章(多目标也可以显示)](https://blog.csdn.net/qq_33431368/article/details/85019234)\n"
  }
]