├── .github
└── workflows
│ └── release-apk.yml
├── README.md
├── app
├── build.gradle
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ ├── candy.bin
│ ├── mosaic.bin
│ ├── pointilism.bin
│ ├── rain_princess.bin
│ └── udnie.bin
│ ├── java
│ └── com
│ │ └── tencent
│ │ └── styletransferncnn
│ │ ├── MainActivity.java
│ │ └── StyleTransferNcnn.java
│ ├── jni
│ ├── CMakeLists.txt
│ ├── styletransfer.id.h
│ ├── styletransfer.param.bin.h
│ └── styletransferncnn_jni.cpp
│ └── res
│ ├── layout
│ └── main.xml
│ └── values
│ └── strings.xml
├── build.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── screenshot.png
└── settings.gradle
/.github/workflows/release-apk.yml:
--------------------------------------------------------------------------------
1 | name: release-apk
2 | on: workflow_dispatch
3 |
4 | env:
5 | NCNN_VERSION: 20250428
6 | BUILD_TOOLS_VERSION: 36.0.0
7 |
8 | jobs:
9 | release-apk:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: actions/checkout@v4
13 | - uses: actions/setup-java@v4
14 | with:
15 | distribution: 'temurin'
16 | java-version: '21'
17 |
18 | - name: ncnn
19 | run: |
20 | wget -q https://github.com/Tencent/ncnn/releases/download/${NCNN_VERSION}/ncnn-${NCNN_VERSION}-android-vulkan.zip
21 | unzip -q ncnn-${NCNN_VERSION}-android-vulkan.zip -d app/src/main/jni
22 |
23 | - name: modify-jni-cmakelists
24 | run: |
25 | sed -i "s@ncnn-[^-]*-android-vulkan@ncnn-${NCNN_VERSION}-android-vulkan@g" app/src/main/jni/CMakeLists.txt
26 |
27 | - name: build-apk
28 | run: |
29 | bash ./gradlew assembleRelease --stacktrace
30 |
31 | - name: sign-apk
32 | id: signapk
33 | run: |
34 | DATE=`date +'%Y%m%d'`
35 | SHA_SHORT=`git rev-parse --short HEAD`
36 | UNSIGNED_APK=`find app/build/outputs/apk/release -type f -name "*-release-unsigned.apk" | head -n 1`
37 | ALIGNED_APK=${UNSIGNED_APK//-release-unsigned.apk/-release-unsigned-aligned.apk}
38 | SIGNED_APK=${{ github.event.repository.name }}-${DATE}.${SHA_SHORT}.apk
39 | keytool -genkey -noprompt -alias ncnn \
40 | -dname "CN=mqttserver.ibm.com, OU=ID, O=IBM, L=Hursley, S=Hants, C=GB"\
41 | -keystore ncnn.keystore -storepass 7767517 -keypass 7767517 \
42 | -keyalg RSA -keysize 2048 -validity 10000
43 | ${ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION}/zipalign -f -v 4 ${UNSIGNED_APK} ${SIGNED_APK}
44 | ${ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION}/apksigner sign --ks ncnn.keystore --ks-key-alias ncnn \
45 | --ks-pass pass:7767517 --key-pass pass:7767517 --out ${SIGNED_APK} ${SIGNED_APK}
46 | ${ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION}/apksigner verify ${SIGNED_APK}
47 | echo "SIGNED_APK=${SIGNED_APK}" >> $GITHUB_OUTPUT
48 | echo "APK_VERSION=${DATE}.${SHA_SHORT}" >> $GITHUB_OUTPUT
49 |
50 | - name: create-release
51 | uses: softprops/action-gh-release@v1
52 | with:
53 | token: ${{ secrets.GITHUB_TOKEN }}
54 | tag_name: ${{ steps.signapk.outputs.APK_VERSION }}
55 | name: Release ${{ steps.signapk.outputs.APK_VERSION }}
56 | files: ${{ steps.signapk.outputs.SIGNED_APK }}
57 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ncnn-android-styletransfer
2 |
3 | The style transfer android example
4 |
5 | this is a sample ncnn android project, it depends on ncnn library only
6 |
7 | https://github.com/Tencent/ncnn
8 |
9 | ## how to build and run
10 | ### step1
11 | https://github.com/Tencent/ncnn/releases
12 |
13 | download ncnn-android-vulkan.zip or build ncnn for android yourself
14 |
15 | ### step2
16 | extract ncnn-android-vulkan.zip into app/src/main/jni or change the ncnn_DIR path to yours in app/src/main/jni/CMakeLists.txt
17 |
18 | ### step3
19 | open this project with Android Studio, build it and enjoy!
20 |
21 | ## screenshot
22 | 
23 |
24 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | }
4 |
5 | android {
6 | namespace 'com.tencent.styletransferncnn'
7 | compileSdk 33
8 |
9 | defaultConfig {
10 | applicationId "com.tencent.styletransferncnn"
11 | archivesBaseName = "$applicationId"
12 |
13 | minSdk 21
14 |
15 | externalNativeBuild {
16 | cmake {
17 | arguments "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
18 | }
19 | }
20 | }
21 |
22 | externalNativeBuild {
23 | cmake {
24 | version "3.31.5"
25 | path file('src/main/jni/CMakeLists.txt')
26 | }
27 | }
28 |
29 | packaging {
30 | jniLibs {
31 | useLegacyPackaging true
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/assets/candy.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nihui/ncnn-android-styletransfer/ac4dfdbb412367fabe081408f83ac1021fe142ca/app/src/main/assets/candy.bin
--------------------------------------------------------------------------------
/app/src/main/assets/mosaic.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nihui/ncnn-android-styletransfer/ac4dfdbb412367fabe081408f83ac1021fe142ca/app/src/main/assets/mosaic.bin
--------------------------------------------------------------------------------
/app/src/main/assets/pointilism.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nihui/ncnn-android-styletransfer/ac4dfdbb412367fabe081408f83ac1021fe142ca/app/src/main/assets/pointilism.bin
--------------------------------------------------------------------------------
/app/src/main/assets/rain_princess.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nihui/ncnn-android-styletransfer/ac4dfdbb412367fabe081408f83ac1021fe142ca/app/src/main/assets/rain_princess.bin
--------------------------------------------------------------------------------
/app/src/main/assets/udnie.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nihui/ncnn-android-styletransfer/ac4dfdbb412367fabe081408f83ac1021fe142ca/app/src/main/assets/udnie.bin
--------------------------------------------------------------------------------
/app/src/main/java/com/tencent/styletransferncnn/MainActivity.java:
--------------------------------------------------------------------------------
1 | // Tencent is pleased to support the open source community by making ncnn available.
2 | //
3 | // Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
4 | //
5 | // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
6 | // in compliance with the License. You may obtain a copy of the License at
7 | //
8 | // https://opensource.org/licenses/BSD-3-Clause
9 | //
10 | // Unless required by applicable law or agreed to in writing, software distributed
11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 | // specific language governing permissions and limitations under the License.
14 |
15 | package com.tencent.styletransferncnn;
16 |
17 | import android.app.Activity;
18 | import android.content.Intent;
19 | import android.graphics.Bitmap;
20 | import android.graphics.BitmapFactory;
21 | import android.net.Uri;
22 | import android.os.Bundle;
23 | import android.util.Log;
24 | import android.view.View;
25 | import android.view.WindowManager;
26 | import android.widget.AdapterView;
27 | import android.widget.Button;
28 | import android.widget.ImageView;
29 | import android.widget.Spinner;
30 | import android.media.ExifInterface;
31 | import android.graphics.Matrix;
32 |
33 | import java.io.FileNotFoundException;
34 | import java.io.InputStream;
35 | import java.io.IOException;
36 |
37 | public class MainActivity extends Activity
38 | {
39 | private static final int SELECT_IMAGE = 1;
40 |
41 | private int style_type = 0;
42 | private ImageView imageView;
43 | private Bitmap yourSelectedImage = null;
44 |
45 | private StyleTransferNcnn styletransferncnn = new StyleTransferNcnn();
46 |
47 | /** Called when the activity is first created. */
48 | @Override
49 | public void onCreate(Bundle savedInstanceState)
50 | {
51 | super.onCreate(savedInstanceState);
52 | setContentView(R.layout.main);
53 |
54 | boolean ret_init = styletransferncnn.Init(getAssets());
55 | if (!ret_init)
56 | {
57 | Log.e("MainActivity", "styletransferncnn Init failed");
58 | }
59 |
60 | imageView = (ImageView) findViewById(R.id.imageView);
61 |
62 | Button buttonImage = (Button) findViewById(R.id.buttonImage);
63 | buttonImage.setOnClickListener(new View.OnClickListener() {
64 | @Override
65 | public void onClick(View arg0) {
66 | Intent i = new Intent(Intent.ACTION_PICK);
67 | i.setType("image/*");
68 | startActivityForResult(i, SELECT_IMAGE);
69 | }
70 | });
71 |
72 | Button buttonDetect = (Button) findViewById(R.id.buttonDetect);
73 | buttonDetect.setOnClickListener(new View.OnClickListener() {
74 | @Override
75 | public void onClick(View arg0) {
76 | if (yourSelectedImage == null)
77 | return;
78 |
79 | getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
80 | new Thread(new Runnable() {
81 | public void run() {
82 | final Bitmap styledImage = runStyleTransfer(false);
83 | imageView.post(new Runnable() {
84 | public void run() {
85 | imageView.setImageBitmap(styledImage);
86 | getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
87 | }
88 | });
89 | }
90 | }).start();
91 | }
92 | });
93 |
94 | Button buttonDetectGPU = (Button) findViewById(R.id.buttonDetectGPU);
95 | buttonDetectGPU.setOnClickListener(new View.OnClickListener() {
96 | @Override
97 | public void onClick(View arg0) {
98 | if (yourSelectedImage == null)
99 | return;
100 |
101 | getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
102 | new Thread(new Runnable() {
103 | public void run() {
104 | final Bitmap styledImage = runStyleTransfer(true);
105 | imageView.post(new Runnable() {
106 | public void run() {
107 | imageView.setImageBitmap(styledImage);
108 | getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
109 | }
110 | });
111 | }
112 | }).start();
113 | }
114 | });
115 |
116 | Spinner spinnerStyle = (Spinner) findViewById(R.id.spinnerStyle);
117 | spinnerStyle.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
118 | @Override
119 | public void onItemSelected(AdapterView> parent, View view, int pos, long id) {
120 | style_type = pos;
121 | }
122 | @Override
123 | public void onNothingSelected(AdapterView> parent) {
124 | }
125 | });
126 | }
127 |
128 | @Override
129 | protected void onActivityResult(int requestCode, int resultCode, Intent data)
130 | {
131 | super.onActivityResult(requestCode, resultCode, data);
132 |
133 | if (resultCode == RESULT_OK && null != data) {
134 | Uri selectedImage = data.getData();
135 |
136 | try
137 | {
138 | if (requestCode == SELECT_IMAGE) {
139 | yourSelectedImage = decodeUri(selectedImage);
140 |
141 | imageView.setImageBitmap(yourSelectedImage);
142 | }
143 | }
144 | catch (FileNotFoundException e)
145 | {
146 | Log.e("MainActivity", "FileNotFoundException");
147 | return;
148 | }
149 | }
150 | }
151 |
152 | private Bitmap runStyleTransfer(boolean use_gpu)
153 | {
154 | Bitmap styledImage = yourSelectedImage.copy(Bitmap.Config.ARGB_8888, true);
155 | styletransferncnn.StyleTransfer(styledImage, style_type, use_gpu);
156 | return styledImage;
157 | }
158 |
159 | private Bitmap decodeUri(Uri selectedImage) throws FileNotFoundException
160 | {
161 | // Decode image size
162 | BitmapFactory.Options o = new BitmapFactory.Options();
163 | o.inJustDecodeBounds = true;
164 | BitmapFactory.decodeStream(getContentResolver().openInputStream(selectedImage), null, o);
165 |
166 | // The new size we want to scale to
167 | final int REQUIRED_SIZE = 400;
168 |
169 | // Find the correct scale value. It should be the power of 2.
170 | int width_tmp = o.outWidth, height_tmp = o.outHeight;
171 | int scale = 1;
172 | while (true) {
173 | if (width_tmp / 2 < REQUIRED_SIZE
174 | || height_tmp / 2 < REQUIRED_SIZE) {
175 | break;
176 | }
177 | width_tmp /= 2;
178 | height_tmp /= 2;
179 | scale *= 2;
180 | }
181 |
182 | // Decode with inSampleSize
183 | BitmapFactory.Options o2 = new BitmapFactory.Options();
184 | o2.inSampleSize = scale;
185 | Bitmap bitmap = BitmapFactory.decodeStream(getContentResolver().openInputStream(selectedImage), null, o2);
186 |
187 | // Rotate according to EXIF
188 | int rotate = 0;
189 | try
190 | {
191 | ExifInterface exif = new ExifInterface(getContentResolver().openInputStream(selectedImage));
192 | int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
193 | switch (orientation) {
194 | case ExifInterface.ORIENTATION_ROTATE_270:
195 | rotate = 270;
196 | break;
197 | case ExifInterface.ORIENTATION_ROTATE_180:
198 | rotate = 180;
199 | break;
200 | case ExifInterface.ORIENTATION_ROTATE_90:
201 | rotate = 90;
202 | break;
203 | }
204 | }
205 | catch (IOException e)
206 | {
207 | Log.e("MainActivity", "ExifInterface IOException");
208 | }
209 |
210 | Matrix matrix = new Matrix();
211 | matrix.postRotate(rotate);
212 | return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
213 | }
214 |
215 | }
216 |
--------------------------------------------------------------------------------
/app/src/main/java/com/tencent/styletransferncnn/StyleTransferNcnn.java:
--------------------------------------------------------------------------------
1 | // Tencent is pleased to support the open source community by making ncnn available.
2 | //
3 | // Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
4 | //
5 | // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
6 | // in compliance with the License. You may obtain a copy of the License at
7 | //
8 | // https://opensource.org/licenses/BSD-3-Clause
9 | //
10 | // Unless required by applicable law or agreed to in writing, software distributed
11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 | // specific language governing permissions and limitations under the License.
14 |
15 | package com.tencent.styletransferncnn;
16 |
17 | import android.content.res.AssetManager;
18 | import android.graphics.Bitmap;
19 |
20 | public class StyleTransferNcnn
21 | {
22 | public native boolean Init(AssetManager mgr);
23 |
24 | public native boolean StyleTransfer(Bitmap bitmap, int style_type, boolean use_gpu);
25 |
26 | static {
27 | System.loadLibrary("styletransferncnn");
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/jni/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | project(styletransferncnn)
2 |
3 | cmake_minimum_required(VERSION 3.10)
4 |
5 | set(ncnn_DIR ${CMAKE_SOURCE_DIR}/ncnn-20250428-android-vulkan/${ANDROID_ABI}/lib/cmake/ncnn)
6 | find_package(ncnn REQUIRED)
7 |
8 | add_library(styletransferncnn SHARED styletransferncnn_jni.cpp)
9 |
10 | target_link_libraries(styletransferncnn ncnn)
11 |
--------------------------------------------------------------------------------
/app/src/main/jni/styletransfer.id.h:
--------------------------------------------------------------------------------
1 | #ifndef NCNN_INCLUDE_GUARD_styletransfer_id_h
2 | #define NCNN_INCLUDE_GUARD_styletransfer_id_h
3 | namespace styletransfer_param_id {
4 | const int LAYER_input1 = 0;
5 | const int BLOB_input1 = 0;
6 | const int LAYER_63 = 1;
7 | const int BLOB_63 = 1;
8 | const int LAYER_64 = 2;
9 | const int BLOB_64 = 2;
10 | const int LAYER_65 = 3;
11 | const int BLOB_65 = 3;
12 | const int LAYER_66 = 4;
13 | const int BLOB_66 = 4;
14 | const int LAYER_67 = 5;
15 | const int BLOB_67 = 5;
16 | const int LAYER_68 = 6;
17 | const int BLOB_68 = 6;
18 | const int LAYER_69 = 7;
19 | const int BLOB_69 = 7;
20 | const int LAYER_70 = 8;
21 | const int BLOB_70 = 8;
22 | const int LAYER_71 = 9;
23 | const int BLOB_71 = 9;
24 | const int LAYER_72 = 10;
25 | const int BLOB_72 = 10;
26 | const int LAYER_73 = 11;
27 | const int BLOB_73 = 11;
28 | const int LAYER_74 = 12;
29 | const int BLOB_74 = 12;
30 | const int LAYER_splitncnn_0 = 13;
31 | const int BLOB_74_splitncnn_0 = 13;
32 | const int BLOB_74_splitncnn_1 = 14;
33 | const int LAYER_75 = 14;
34 | const int BLOB_75 = 15;
35 | const int LAYER_76 = 15;
36 | const int BLOB_76 = 16;
37 | const int LAYER_77 = 16;
38 | const int BLOB_77 = 17;
39 | const int LAYER_78 = 17;
40 | const int BLOB_78 = 18;
41 | const int LAYER_79 = 18;
42 | const int BLOB_79 = 19;
43 | const int LAYER_80 = 19;
44 | const int BLOB_80 = 20;
45 | const int LAYER_81 = 20;
46 | const int BLOB_81 = 21;
47 | const int LAYER_82 = 21;
48 | const int BLOB_82 = 22;
49 | const int LAYER_splitncnn_1 = 22;
50 | const int BLOB_82_splitncnn_0 = 23;
51 | const int BLOB_82_splitncnn_1 = 24;
52 | const int LAYER_83 = 23;
53 | const int BLOB_83 = 25;
54 | const int LAYER_84 = 24;
55 | const int BLOB_84 = 26;
56 | const int LAYER_85 = 25;
57 | const int BLOB_85 = 27;
58 | const int LAYER_86 = 26;
59 | const int BLOB_86 = 28;
60 | const int LAYER_87 = 27;
61 | const int BLOB_87 = 29;
62 | const int LAYER_88 = 28;
63 | const int BLOB_88 = 30;
64 | const int LAYER_89 = 29;
65 | const int BLOB_89 = 31;
66 | const int LAYER_90 = 30;
67 | const int BLOB_90 = 32;
68 | const int LAYER_splitncnn_2 = 31;
69 | const int BLOB_90_splitncnn_0 = 33;
70 | const int BLOB_90_splitncnn_1 = 34;
71 | const int LAYER_91 = 32;
72 | const int BLOB_91 = 35;
73 | const int LAYER_92 = 33;
74 | const int BLOB_92 = 36;
75 | const int LAYER_93 = 34;
76 | const int BLOB_93 = 37;
77 | const int LAYER_94 = 35;
78 | const int BLOB_94 = 38;
79 | const int LAYER_95 = 36;
80 | const int BLOB_95 = 39;
81 | const int LAYER_96 = 37;
82 | const int BLOB_96 = 40;
83 | const int LAYER_97 = 38;
84 | const int BLOB_97 = 41;
85 | const int LAYER_98 = 39;
86 | const int BLOB_98 = 42;
87 | const int LAYER_splitncnn_3 = 40;
88 | const int BLOB_98_splitncnn_0 = 43;
89 | const int BLOB_98_splitncnn_1 = 44;
90 | const int LAYER_99 = 41;
91 | const int BLOB_99 = 45;
92 | const int LAYER_100 = 42;
93 | const int BLOB_100 = 46;
94 | const int LAYER_101 = 43;
95 | const int BLOB_101 = 47;
96 | const int LAYER_102 = 44;
97 | const int BLOB_102 = 48;
98 | const int LAYER_103 = 45;
99 | const int BLOB_103 = 49;
100 | const int LAYER_104 = 46;
101 | const int BLOB_104 = 50;
102 | const int LAYER_105 = 47;
103 | const int BLOB_105 = 51;
104 | const int LAYER_106 = 48;
105 | const int BLOB_106 = 52;
106 | const int LAYER_splitncnn_4 = 49;
107 | const int BLOB_106_splitncnn_0 = 53;
108 | const int BLOB_106_splitncnn_1 = 54;
109 | const int LAYER_107 = 50;
110 | const int BLOB_107 = 55;
111 | const int LAYER_108 = 51;
112 | const int BLOB_108 = 56;
113 | const int LAYER_109 = 52;
114 | const int BLOB_109 = 57;
115 | const int LAYER_110 = 53;
116 | const int BLOB_110 = 58;
117 | const int LAYER_111 = 54;
118 | const int BLOB_111 = 59;
119 | const int LAYER_112 = 55;
120 | const int BLOB_112 = 60;
121 | const int LAYER_113 = 56;
122 | const int BLOB_113 = 61;
123 | const int LAYER_114 = 57;
124 | const int BLOB_114 = 62;
125 | const int LAYER_139 = 58;
126 | const int BLOB_139 = 63;
127 | const int LAYER_140 = 59;
128 | const int BLOB_140 = 64;
129 | const int LAYER_141 = 60;
130 | const int BLOB_141 = 65;
131 | const int LAYER_142 = 61;
132 | const int BLOB_142 = 66;
133 | const int LAYER_143 = 62;
134 | const int BLOB_143 = 67;
135 | const int LAYER_168 = 63;
136 | const int BLOB_168 = 68;
137 | const int LAYER_169 = 64;
138 | const int BLOB_169 = 69;
139 | const int LAYER_170 = 65;
140 | const int BLOB_170 = 70;
141 | const int LAYER_171 = 66;
142 | const int BLOB_171 = 71;
143 | const int LAYER_172 = 67;
144 | const int BLOB_172 = 72;
145 | const int LAYER_173 = 68;
146 | const int BLOB_173 = 73;
147 | const int LAYER_output1 = 69;
148 | const int BLOB_output1 = 74;
149 | } // namespace styletransfer_param_id
150 | #endif // NCNN_INCLUDE_GUARD_styletransfer_id_h
151 |
--------------------------------------------------------------------------------
/app/src/main/jni/styletransfer.param.bin.h:
--------------------------------------------------------------------------------
1 | #ifndef NCNN_INCLUDE_GUARD_styletransfer_param_bin_h
2 | #define NCNN_INCLUDE_GUARD_styletransfer_param_bin_h
3 |
4 | #ifdef _MSC_VER
5 | __declspec(align(4))
6 | #else
7 | __attribute__((aligned(4)))
8 | #endif
9 | static const unsigned char styletransfer_param_bin[] = {
10 | 0xdd,0x85,0x76,0x00,0x46,0x00,0x00,0x00,0x4b,0x00,0x00,0x00,0x10,0x00,0x00,0x00,
11 | 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x17,0xff,0xff,0xff,
12 | 0x2b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
13 | 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
14 | 0x04,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
15 | 0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x17,0xff,0xff,0xff,
16 | 0x06,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
17 | 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
18 | 0x09,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,
19 | 0x60,0x1e,0x00,0x00,0x17,0xff,0xff,0xff,0x35,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
20 | 0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
21 | 0x20,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xac,0xc5,0x27,0x37,0x17,0xff,0xff,0xff,
22 | 0x1a,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
23 | 0x04,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x2b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
24 | 0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
25 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
26 | 0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
27 | 0x02,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x06,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
28 | 0x01,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
29 | 0x40,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
30 | 0x02,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,
31 | 0x00,0x48,0x00,0x00,0x17,0xff,0xff,0xff,0x35,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
32 | 0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
33 | 0x40,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xac,0xc5,0x27,0x37,0x17,0xff,0xff,0xff,
34 | 0x1a,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x07,0x00,0x00,0x00,
35 | 0x08,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x2b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
36 | 0x01,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
37 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
38 | 0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
39 | 0x02,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x06,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
40 | 0x01,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
41 | 0x80,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
42 | 0x02,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,
43 | 0x00,0x20,0x01,0x00,0x17,0xff,0xff,0xff,0x35,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
44 | 0x01,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
45 | 0x80,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xac,0xc5,0x27,0x37,0x17,0xff,0xff,0xff,
46 | 0x1a,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,
47 | 0x0c,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x21,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
48 | 0x02,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,
49 | 0x17,0xff,0xff,0xff,0x2b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
50 | 0x0e,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
51 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
52 | 0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
53 | 0x17,0xff,0xff,0xff,0x06,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
54 | 0x0f,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
55 | 0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
56 | 0x06,0x00,0x00,0x00,0x00,0x40,0x02,0x00,0x17,0xff,0xff,0xff,0x35,0x00,0x00,0x00,
57 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x11,0x00,0x00,0x00,
58 | 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xac,0xc5,0x27,0x37,
59 | 0x17,0xff,0xff,0xff,0x1a,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
60 | 0x11,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x2b,0x00,0x00,0x00,
61 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x13,0x00,0x00,0x00,
62 | 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
63 | 0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
64 | 0x04,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x06,0x00,0x00,0x00,
65 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x13,0x00,0x00,0x00,0x14,0x00,0x00,0x00,
66 | 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
67 | 0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x40,0x02,0x00,
68 | 0x17,0xff,0xff,0xff,0x35,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
69 | 0x14,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
70 | 0x01,0x00,0x00,0x00,0xac,0xc5,0x27,0x37,0x17,0xff,0xff,0xff,0x28,0x00,0x00,0x00,
71 | 0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,
72 | 0x16,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x21,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
73 | 0x02,0x00,0x00,0x00,0x16,0x00,0x00,0x00,0x17,0x00,0x00,0x00,0x18,0x00,0x00,0x00,
74 | 0x17,0xff,0xff,0xff,0x2b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
75 | 0x18,0x00,0x00,0x00,0x19,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
76 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
77 | 0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
78 | 0x17,0xff,0xff,0xff,0x06,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
79 | 0x19,0x00,0x00,0x00,0x1a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
80 | 0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
81 | 0x06,0x00,0x00,0x00,0x00,0x40,0x02,0x00,0x17,0xff,0xff,0xff,0x35,0x00,0x00,0x00,
82 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x1a,0x00,0x00,0x00,0x1b,0x00,0x00,0x00,
83 | 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xac,0xc5,0x27,0x37,
84 | 0x17,0xff,0xff,0xff,0x1a,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
85 | 0x1b,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x2b,0x00,0x00,0x00,
86 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x1d,0x00,0x00,0x00,
87 | 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
88 | 0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
89 | 0x04,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x06,0x00,0x00,0x00,
90 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x1d,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,
91 | 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
92 | 0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x40,0x02,0x00,
93 | 0x17,0xff,0xff,0xff,0x35,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
94 | 0x1e,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
95 | 0x01,0x00,0x00,0x00,0xac,0xc5,0x27,0x37,0x17,0xff,0xff,0xff,0x28,0x00,0x00,0x00,
96 | 0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x17,0x00,0x00,0x00,
97 | 0x20,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x21,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
98 | 0x02,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x22,0x00,0x00,0x00,
99 | 0x17,0xff,0xff,0xff,0x2b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
100 | 0x22,0x00,0x00,0x00,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
101 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
102 | 0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
103 | 0x17,0xff,0xff,0xff,0x06,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
104 | 0x23,0x00,0x00,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
105 | 0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
106 | 0x06,0x00,0x00,0x00,0x00,0x40,0x02,0x00,0x17,0xff,0xff,0xff,0x35,0x00,0x00,0x00,
107 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x24,0x00,0x00,0x00,0x25,0x00,0x00,0x00,
108 | 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xac,0xc5,0x27,0x37,
109 | 0x17,0xff,0xff,0xff,0x1a,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
110 | 0x25,0x00,0x00,0x00,0x26,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x2b,0x00,0x00,0x00,
111 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x26,0x00,0x00,0x00,0x27,0x00,0x00,0x00,
112 | 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
113 | 0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
114 | 0x04,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x06,0x00,0x00,0x00,
115 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x27,0x00,0x00,0x00,0x28,0x00,0x00,0x00,
116 | 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
117 | 0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x40,0x02,0x00,
118 | 0x17,0xff,0xff,0xff,0x35,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
119 | 0x28,0x00,0x00,0x00,0x29,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
120 | 0x01,0x00,0x00,0x00,0xac,0xc5,0x27,0x37,0x17,0xff,0xff,0xff,0x28,0x00,0x00,0x00,
121 | 0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x29,0x00,0x00,0x00,0x21,0x00,0x00,0x00,
122 | 0x2a,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x21,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
123 | 0x02,0x00,0x00,0x00,0x2a,0x00,0x00,0x00,0x2b,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,
124 | 0x17,0xff,0xff,0xff,0x2b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
125 | 0x2c,0x00,0x00,0x00,0x2d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
126 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
127 | 0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
128 | 0x17,0xff,0xff,0xff,0x06,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
129 | 0x2d,0x00,0x00,0x00,0x2e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
130 | 0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
131 | 0x06,0x00,0x00,0x00,0x00,0x40,0x02,0x00,0x17,0xff,0xff,0xff,0x35,0x00,0x00,0x00,
132 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x2e,0x00,0x00,0x00,0x2f,0x00,0x00,0x00,
133 | 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xac,0xc5,0x27,0x37,
134 | 0x17,0xff,0xff,0xff,0x1a,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
135 | 0x2f,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x2b,0x00,0x00,0x00,
136 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x31,0x00,0x00,0x00,
137 | 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
138 | 0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
139 | 0x04,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x06,0x00,0x00,0x00,
140 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x31,0x00,0x00,0x00,0x32,0x00,0x00,0x00,
141 | 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
142 | 0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x40,0x02,0x00,
143 | 0x17,0xff,0xff,0xff,0x35,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
144 | 0x32,0x00,0x00,0x00,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
145 | 0x01,0x00,0x00,0x00,0xac,0xc5,0x27,0x37,0x17,0xff,0xff,0xff,0x28,0x00,0x00,0x00,
146 | 0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x33,0x00,0x00,0x00,0x2b,0x00,0x00,0x00,
147 | 0x34,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x21,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
148 | 0x02,0x00,0x00,0x00,0x34,0x00,0x00,0x00,0x35,0x00,0x00,0x00,0x36,0x00,0x00,0x00,
149 | 0x17,0xff,0xff,0xff,0x2b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
150 | 0x36,0x00,0x00,0x00,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
151 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
152 | 0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
153 | 0x17,0xff,0xff,0xff,0x06,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
154 | 0x37,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
155 | 0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
156 | 0x06,0x00,0x00,0x00,0x00,0x40,0x02,0x00,0x17,0xff,0xff,0xff,0x35,0x00,0x00,0x00,
157 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x39,0x00,0x00,0x00,
158 | 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xac,0xc5,0x27,0x37,
159 | 0x17,0xff,0xff,0xff,0x1a,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
160 | 0x39,0x00,0x00,0x00,0x3a,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x2b,0x00,0x00,0x00,
161 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x3a,0x00,0x00,0x00,0x3b,0x00,0x00,0x00,
162 | 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
163 | 0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
164 | 0x04,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x06,0x00,0x00,0x00,
165 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x3b,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,
166 | 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
167 | 0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x40,0x02,0x00,
168 | 0x17,0xff,0xff,0xff,0x35,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
169 | 0x3c,0x00,0x00,0x00,0x3d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
170 | 0x01,0x00,0x00,0x00,0xac,0xc5,0x27,0x37,0x17,0xff,0xff,0xff,0x28,0x00,0x00,0x00,
171 | 0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x3d,0x00,0x00,0x00,0x35,0x00,0x00,0x00,
172 | 0x3e,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x32,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
173 | 0x01,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
174 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x02,0x00,0x00,0x00,
175 | 0x00,0x00,0x00,0x40,0x17,0xff,0xff,0xff,0x2b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
176 | 0x01,0x00,0x00,0x00,0x3f,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
177 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
178 | 0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
179 | 0x02,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x06,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
180 | 0x01,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
181 | 0x40,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,0x00,0x00,
182 | 0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x20,0x01,0x00,0x17,0xff,0xff,0xff,
183 | 0x35,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x41,0x00,0x00,0x00,
184 | 0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
185 | 0xac,0xc5,0x27,0x37,0x17,0xff,0xff,0xff,0x1a,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
186 | 0x01,0x00,0x00,0x00,0x42,0x00,0x00,0x00,0x43,0x00,0x00,0x00,0x17,0xff,0xff,0xff,
187 | 0x32,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x43,0x00,0x00,0x00,
188 | 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
189 | 0x00,0x00,0x00,0x40,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x17,0xff,0xff,0xff,
190 | 0x2b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x44,0x00,0x00,0x00,
191 | 0x45,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
192 | 0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
193 | 0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x17,0xff,0xff,0xff,
194 | 0x06,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x45,0x00,0x00,0x00,
195 | 0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
196 | 0x03,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,
197 | 0x00,0x48,0x00,0x00,0x17,0xff,0xff,0xff,0x35,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
198 | 0x01,0x00,0x00,0x00,0x46,0x00,0x00,0x00,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
199 | 0x20,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xac,0xc5,0x27,0x37,0x17,0xff,0xff,0xff,
200 | 0x1a,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x47,0x00,0x00,0x00,
201 | 0x48,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x2b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
202 | 0x01,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x49,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
203 | 0x04,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
204 | 0x04,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
205 | 0x02,0x00,0x00,0x00,0x17,0xff,0xff,0xff,0x06,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
206 | 0x01,0x00,0x00,0x00,0x49,0x00,0x00,0x00,0x4a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
207 | 0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x05,0x00,0x00,0x00,
208 | 0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x60,0x1e,0x00,0x00,0x17,0xff,0xff,0xff,
209 | };
210 |
211 | #endif // NCNN_INCLUDE_GUARD_styletransfer_param_bin_h
212 |
--------------------------------------------------------------------------------
/app/src/main/jni/styletransferncnn_jni.cpp:
--------------------------------------------------------------------------------
1 | // Tencent is pleased to support the open source community by making ncnn available.
2 | //
3 | // Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
4 | //
5 | // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
6 | // in compliance with the License. You may obtain a copy of the License at
7 | //
8 | // https://opensource.org/licenses/BSD-3-Clause
9 | //
10 | // Unless required by applicable law or agreed to in writing, software distributed
11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 | // specific language governing permissions and limitations under the License.
14 |
15 | #include
16 | #include
17 | #include
18 |
19 | #include
20 |
21 | #include
22 | #include
23 |
24 | // ncnn
25 | #include "net.h"
26 | #include "benchmark.h"
27 |
28 | #include "styletransfer.id.h"
29 | #include "styletransfer.param.bin.h"
30 |
31 | static ncnn::Net styletransfernet[5];
32 | static ncnn::Net styletransfernet_gpu[5];
33 |
34 | extern "C" {
35 |
36 | JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved)
37 | {
38 | __android_log_print(ANDROID_LOG_DEBUG, "StyleTransferNcnn", "JNI_OnLoad");
39 |
40 | ncnn::create_gpu_instance();
41 |
42 | return JNI_VERSION_1_4;
43 | }
44 |
45 | JNIEXPORT void JNI_OnUnload(JavaVM* vm, void* reserved)
46 | {
47 | __android_log_print(ANDROID_LOG_DEBUG, "StyleTransferNcnn", "JNI_OnUnload");
48 |
49 | ncnn::destroy_gpu_instance();
50 | }
51 |
52 | // public native boolean Init(AssetManager mgr);
53 | JNIEXPORT jboolean JNICALL Java_com_tencent_styletransferncnn_StyleTransferNcnn_Init(JNIEnv* env, jobject thiz, jobject assetManager)
54 | {
55 | ncnn::Option opt;
56 |
57 | AAssetManager* mgr = AAssetManager_fromJava(env, assetManager);
58 |
59 | const char* model_paths[5] = {"candy.bin", "mosaic.bin", "pointilism.bin", "rain_princess.bin", "udnie.bin"};
60 | for (int i=0; i<5; i++)
61 | {
62 | styletransfernet[i].opt = opt;
63 |
64 | int ret0 = styletransfernet[i].load_param(styletransfer_param_bin);
65 | int ret1 = styletransfernet[i].load_model(mgr, model_paths[i]);
66 |
67 | __android_log_print(ANDROID_LOG_DEBUG, "StyleTransferNcnn", "load %d %d", ret0, ret1);
68 | }
69 |
70 | // use vulkan compute
71 | if (ncnn::get_gpu_count() != 0)
72 | {
73 | for (int i=0; i<5; i++)
74 | {
75 | styletransfernet_gpu[i].opt.use_vulkan_compute = true;
76 |
77 | int ret0 = styletransfernet_gpu[i].load_param(styletransfer_param_bin);
78 | int ret1 = styletransfernet_gpu[i].load_model(mgr, model_paths[i]);
79 |
80 | __android_log_print(ANDROID_LOG_DEBUG, "StyleTransferNcnn", "load %d %d", ret0, ret1);
81 | }
82 | }
83 |
84 | return JNI_TRUE;
85 | }
86 |
87 | // public native Bitmap StyleTransfer(Bitmap bitmap, int style_type, boolean use_gpu);
88 | JNIEXPORT jboolean JNICALL Java_com_tencent_styletransferncnn_StyleTransferNcnn_StyleTransfer(JNIEnv* env, jobject thiz, jobject bitmap, jint style_type, jboolean use_gpu)
89 | {
90 | if (style_type < 0 || style_type >= 5)
91 | return JNI_FALSE;
92 |
93 | if (use_gpu == JNI_TRUE && ncnn::get_gpu_count() == 0)
94 | return JNI_FALSE;
95 |
96 | double start_time = ncnn::get_current_time();
97 |
98 | AndroidBitmapInfo info;
99 | AndroidBitmap_getInfo(env, bitmap, &info);
100 | if (info.format != ANDROID_BITMAP_FORMAT_RGBA_8888)
101 | return JNI_FALSE;
102 |
103 | int width = info.width;
104 | int height = info.height;
105 |
106 | const int downscale_ratio = 2;
107 |
108 | // ncnn from bitmap
109 | ncnn::Mat in = ncnn::Mat::from_android_bitmap_resize(env, bitmap, ncnn::Mat::PIXEL_RGB, width / downscale_ratio, height / downscale_ratio);
110 |
111 | // styletransfer
112 | ncnn::Mat out;
113 | {
114 | ncnn::Extractor ex = use_gpu ? styletransfernet_gpu[style_type].create_extractor() : styletransfernet[style_type].create_extractor();
115 |
116 | ex.input(styletransfer_param_id::BLOB_input1, in);
117 |
118 | ex.extract(styletransfer_param_id::BLOB_output1, out);
119 | }
120 |
121 | // ncnn to bitmap
122 | out.to_android_bitmap(env, bitmap, ncnn::Mat::PIXEL_RGB);
123 |
124 | double elasped = ncnn::get_current_time() - start_time;
125 | __android_log_print(ANDROID_LOG_DEBUG, "StyleTransferNcnn", "%.2fms styletransfer", elasped);
126 |
127 | return JNI_TRUE;
128 | }
129 |
130 | }
131 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
17 |
22 |
27 |
28 |
29 |
33 |
34 |
40 |
41 |
42 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | styletransferncnn
4 |
5 | - candy
6 | - mosaic
7 | - pointilism
8 | - rain_princess
9 | - udnie
10 |
11 |
12 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | plugins {
3 | id 'com.android.application' version '8.7.3' apply false
4 | }
5 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nihui/ncnn-android-styletransfer/ac4dfdbb412367fabe081408f83ac1021fe142ca/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Dec 25 17:36:46 CST 2024
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 |
86 | # Determine the Java command to use to start the JVM.
87 | if [ -n "$JAVA_HOME" ] ; then
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89 | # IBM's JDK on AIX uses strange locations for the executables
90 | JAVACMD="$JAVA_HOME/jre/sh/java"
91 | else
92 | JAVACMD="$JAVA_HOME/bin/java"
93 | fi
94 | if [ ! -x "$JAVACMD" ] ; then
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96 |
97 | Please set the JAVA_HOME variable in your environment to match the
98 | location of your Java installation."
99 | fi
100 | else
101 | JAVACMD="java"
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 |
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 |
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 | MAX_FD_LIMIT=`ulimit -H -n`
111 | if [ $? -eq 0 ] ; then
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 | MAX_FD="$MAX_FD_LIMIT"
114 | fi
115 | ulimit -n $MAX_FD
116 | if [ $? -ne 0 ] ; then
117 | warn "Could not set maximum file descriptor limit: $MAX_FD"
118 | fi
119 | else
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 | fi
122 | fi
123 |
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 |
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 |
134 | JAVACMD=`cygpath --unix "$JAVACMD"`
135 |
136 | # We build the pattern for arguments to be converted via cygpath
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 | SEP=""
139 | for dir in $ROOTDIRSRAW ; do
140 | ROOTDIRS="$ROOTDIRS$SEP$dir"
141 | SEP="|"
142 | done
143 | OURCYGPATTERN="(^($ROOTDIRS))"
144 | # Add a user-defined pattern to the cygpath arguments
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 | fi
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 | i=0
150 | for arg in "$@" ; do
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153 |
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 | else
157 | eval `echo args$i`="\"$arg\""
158 | fi
159 | i=`expr $i + 1`
160 | done
161 | case $i in
162 | 0) set -- ;;
163 | 1) set -- "$args0" ;;
164 | 2) set -- "$args0" "$args1" ;;
165 | 3) set -- "$args0" "$args1" "$args2" ;;
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 | esac
173 | fi
174 |
175 | # Escape application args
176 | save () {
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 | echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 |
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 |
185 | exec "$JAVACMD" "$@"
186 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nihui/ncnn-android-styletransfer/ac4dfdbb412367fabe081408f83ac1021fe142ca/screenshot.png
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | gradlePluginPortal()
6 | }
7 | }
8 | dependencyResolutionManagement {
9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
10 | repositories {
11 | google()
12 | mavenCentral()
13 | }
14 | }
15 |
16 | rootProject.name = "styletransferncnn"
17 | include ':app'
18 |
--------------------------------------------------------------------------------