├── .gitignore
├── README.md
├── app
├── app.iml
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── android
│ │ └── imagerecognizer
│ │ └── app
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ ├── neural
│ │ └── imagerecognizer
│ │ │ └── app
│ │ │ ├── RecognitionApp.java
│ │ │ ├── nn
│ │ │ ├── NNManager.java
│ │ │ └── TensorMaker.java
│ │ │ ├── ui
│ │ │ ├── activities
│ │ │ │ ├── BaseActivity.java
│ │ │ │ ├── MainActivity.java
│ │ │ │ └── SettingsActivity.java
│ │ │ └── views
│ │ │ │ ├── PaintView.java
│ │ │ │ └── WhatisButton.java
│ │ │ └── util
│ │ │ ├── AppUncaughtExceptionHandler.java
│ │ │ ├── ThreadManager.java
│ │ │ ├── ToastImageDescription.java
│ │ │ └── Tool.java
│ └── org
│ │ └── dmlc
│ │ └── mxnet
│ │ ├── MxnetException.java
│ │ └── Predictor.java
│ ├── jniLibs
│ └── armeabi
│ │ └── libmxnet_predict.so
│ └── res
│ ├── drawable-hdpi
│ ├── ic_eraser_variant.png
│ └── ic_lead_pencil.png
│ ├── drawable-ldpi
│ ├── ic_eraser_variant.png
│ └── ic_lead_pencil.png
│ ├── drawable-mdpi
│ ├── ic_eraser_variant.png
│ └── ic_lead_pencil.png
│ ├── drawable-xhdpi
│ ├── ic_eraser_variant.png
│ └── ic_lead_pencil.png
│ ├── drawable-xxhdpi
│ ├── ic_eraser_variant.png
│ └── ic_lead_pencil.png
│ ├── drawable-xxxhdpi
│ ├── ic_eraser_variant.png
│ └── ic_lead_pencil.png
│ ├── drawable
│ ├── gradient_black.xml
│ └── toast_backround.xml
│ ├── layout
│ ├── activity_main.xml
│ ├── activity_settings.xml
│ └── toast_image_description.xml
│ ├── menu
│ └── menu_main.xml
│ ├── mipmap-hdpi
│ └── ic_launcher.png
│ ├── mipmap-mdpi
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxhdpi
│ └── ic_launcher.png
│ ├── raw
│ ├── mean.json
│ ├── params
│ ├── symbol.json
│ └── synset.txt
│ ├── values-w820dp
│ └── dimens.xml
│ └── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── images
└── Screenshot1.png
├── local.properties
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | .gitignore
3 | .idea/
4 | build/
5 | .gradle/
6 | *.iml
7 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ImageRecognizer-Android
2 | Image classification using neural networks (inception-bn) and [**MxNet**](https://github.com/dmlc/mxnet) (Python/C++ neural net library), implemented for Android.
3 | #
4 | nn/[*NNManager.java*](https://github.com/dneprDroid/ImageRecognizer/blob/master/app/src/main/java/neural/imagerecognizer/app/nn/NNManager.java) - class working with **MxNet**
5 |
6 | nn/[TensorMaker.java](https://github.com/dneprDroid/ImageRecognizer-Android/blob/master/app/src/main/java/neural/imagerecognizer/app/nn/TensorMaker.java) - tensor convertor
7 |
8 | Pre-trained model:
9 |
10 | *res/raw/params* - serialized data of the network (weights, convolutional kernels)
11 |
12 | *res/raw/symbol.json* - structure of the network
13 |
14 | *res/raw/syncet.txt* - word dictionary for network, pair output value - meaning word
15 |
16 | #
17 |
18 |
19 | # NDK library
20 | Build **libmxnet_predict.so** from official mxnet sources - https://github.com/dmlc/mxnet/tree/master/amalgamation
21 |
22 | # iOS
23 | iOS version - https://github.com/dneprDroid/ImageRecognizer-iOS
24 |
25 | # Links
26 | * https://github.com/dmlc/mxnet - MxNet library
27 | * https://culurciello.github.io/tech/2016/06/04/nets.html - architectures of neural nets, including inception-bn arch.
28 | * https://github.com/Trangle/mxnet-inception-v4 - inceprion network trainer
29 |
30 |
--------------------------------------------------------------------------------
/app/app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | generateDebugAndroidTestSources
19 | generateDebugSources
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | jcenter()
4 | }
5 | dependencies {
6 | classpath 'com.android.tools.build:gradle:1.2.3'
7 | }
8 | }
9 | apply plugin: 'com.android.application'
10 |
11 | repositories {
12 | jcenter()
13 | }
14 |
15 | android {
16 | compileSdkVersion 23
17 | buildToolsVersion "23.0.2"
18 |
19 | defaultConfig {
20 | applicationId "neural.imagerecognizer.app"
21 | minSdkVersion 14
22 | targetSdkVersion 23
23 | versionCode 1
24 | versionName "1.0"
25 | }
26 |
27 | compileOptions {
28 | sourceCompatibility JavaVersion.VERSION_1_7
29 | targetCompatibility JavaVersion.VERSION_1_7
30 | }
31 | buildTypes {
32 | release {
33 | minifyEnabled false
34 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
35 | }
36 | }
37 | }
38 |
39 | dependencies {
40 | compile fileTree(dir: 'libs', include: ['*.jar'])
41 | compile 'com.android.support:appcompat-v7:23.0.0'
42 |
43 | compile 'com.jakewharton:butterknife:7.0.1'
44 |
45 | //Camera
46 | compile 'com.github.boxme:squarecamera:1.1.0'
47 | }
48 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/useruser/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/android/imagerecognizer/app/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package android.imagerecognizer.app;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
13 |
14 |
15 |
16 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/java/neural/imagerecognizer/app/RecognitionApp.java:
--------------------------------------------------------------------------------
1 | package neural.imagerecognizer.app;
2 |
3 | import android.app.Application;
4 | import neural.imagerecognizer.app.nn.NNManager;
5 | import neural.imagerecognizer.app.util.AppUncaughtExceptionHandler;
6 | import neural.imagerecognizer.app.util.ThreadManager;
7 | import neural.imagerecognizer.app.util.Tool;
8 | import org.dmlc.mxnet.Predictor;
9 | import org.json.JSONException;
10 | import org.json.JSONObject;
11 |
12 | import java.util.HashMap;
13 | import java.util.List;
14 | import java.util.Map;
15 |
16 | public class RecognitionApp extends Application {
17 | public static ThreadManager tm;
18 | private static RecognitionApp instance;
19 |
20 |
21 | @Override
22 | public void onCreate() {
23 | super.onCreate();
24 | instance = this;
25 |
26 | tm = ThreadManager.getInstance();
27 | Thread.setDefaultUncaughtExceptionHandler(new AppUncaughtExceptionHandler(this));
28 |
29 | NNManager.init();
30 | }
31 |
32 | public static RecognitionApp getInstance() {
33 | return instance;
34 | }
35 |
36 | @Override
37 | public void onTerminate() {
38 | super.onTerminate();
39 | tm.end();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/java/neural/imagerecognizer/app/nn/NNManager.java:
--------------------------------------------------------------------------------
1 | package neural.imagerecognizer.app.nn;
2 |
3 | import android.graphics.Bitmap;
4 |
5 | import android.support.annotation.MainThread;
6 | import android.support.annotation.NonNull;
7 | import android.support.annotation.Nullable;
8 | import neural.imagerecognizer.app.R;
9 | import neural.imagerecognizer.app.RecognitionApp;
10 | import neural.imagerecognizer.app.util.ThreadManager;
11 | import neural.imagerecognizer.app.util.Tool;
12 | import org.dmlc.mxnet.Predictor;
13 | import org.json.JSONException;
14 | import org.json.JSONObject;
15 |
16 | import java.nio.ByteBuffer;
17 | import java.util.*;
18 |
19 | public final class NNManager {
20 |
21 |
22 | private List dict;
23 | private Map mean;
24 |
25 | private Predictor predictor;
26 | private static NNManager shared;
27 |
28 | private NNManager() {
29 | }
30 |
31 | public static synchronized NNManager shared() {
32 | if (shared == null) {
33 | shared = new NNManager();
34 | shared.initMxNet();
35 | }
36 | return shared;
37 | }
38 |
39 | private void initMxNet() {
40 | final byte[] symbol = Tool.readRawFile(R.raw.symbol);
41 | final byte[] params = Tool.readRawFile(R.raw.params);
42 |
43 | final Predictor.Device device = new Predictor.Device(Predictor.Device.Type.CPU, 0);
44 | //3 channel image on input
45 | final int[] shape = {1, 3, 224, 224};
46 | final String key = "data";
47 | final Predictor.InputNode node = new Predictor.InputNode(key, shape);
48 |
49 | predictor = new Predictor(symbol, params, device, new Predictor.InputNode[]{node});
50 | dict = Tool.readRawTextFileAsList(R.raw.synset);
51 | try {
52 | final String meanStr = Tool.readRawTextFile(R.raw.mean);
53 | final JSONObject meanJson = new JSONObject(meanStr);
54 | mean = new HashMap<>();
55 | mean.put("b", (float) meanJson.optDouble("b"));
56 | mean.put("g", (float) meanJson.optDouble("g"));
57 | mean.put("r", (float) meanJson.optDouble("r"));
58 | } catch (JSONException e) {
59 | e.printStackTrace();
60 | }
61 | }
62 |
63 | public void identifyImage(final Bitmap bitmap, final Callback callback) {
64 | RecognitionApp.tm.execute(new ThreadManager.Executor() {
65 | @Nullable
66 | @Override
67 | public String onExecute() throws Exception {
68 | float[] imageTensor = TensorMaker.convertBitmapToTensor(bitmap, mean);
69 | predictor.forward("data", imageTensor);
70 | final float[] result = predictor.getOutput(0);
71 |
72 | int index = 0;
73 | for (int i = 0; i < result.length; i++) {
74 | if (result[index] < result[i]) index = i;
75 | }
76 | //Arrays.sort(result);
77 | String tag = getName(index);
78 | Tool.log("recognition competed: %s", tag);
79 | String[] arr = tag.split(" ", 2);
80 | return arr[1];
81 | }
82 |
83 | @Override
84 | public void onCallback(@NonNull String data) {
85 | callback.onResult(data);
86 | }
87 |
88 | @Override
89 | public void onError(Exception e) {
90 | Tool.log("error of img recogn. : %s", e);
91 | Tool.showToast(R.string.toast_recognition_error);
92 | }
93 | });
94 | }
95 |
96 | public static void init() {
97 | shared();
98 | }
99 |
100 |
101 | private String getName(int i) {
102 | if (i >= dict.size()) {
103 | return RecognitionApp.getInstance().getString(R.string.text_image_not_recognized);
104 | }
105 | return dict.get(i);
106 | }
107 |
108 | public interface Callback {
109 | @MainThread
110 | void onResult(@NonNull String description);
111 | }
112 |
113 | }
114 |
--------------------------------------------------------------------------------
/app/src/main/java/neural/imagerecognizer/app/nn/TensorMaker.java:
--------------------------------------------------------------------------------
1 | package neural.imagerecognizer.app.nn;
2 |
3 |
4 | import android.graphics.Bitmap;
5 | import neural.imagerecognizer.app.util.Tool;
6 |
7 | import java.nio.ByteBuffer;
8 | import java.nio.IntBuffer;
9 | import java.util.Map;
10 |
11 | public final class TensorMaker {
12 | private static final int SHORTER_SIDE = 256;
13 | private static final int DESIRED_SIDE = 224; // default image side for input in inception-bn network
14 |
15 | private TensorMaker() {
16 | }
17 |
18 | // todo: implement this via RenderScript
19 | public static float[] convertBitmapToTensor(Bitmap bitmap, Map mean) {
20 | Bitmap processedBitmap = processBitmap(bitmap);
21 | ByteBuffer byteBuffer = ByteBuffer.allocate(processedBitmap.getByteCount());
22 | processedBitmap.copyPixelsToBuffer(byteBuffer);
23 | byte[] bytes = byteBuffer.array();
24 | float[] colors = new float[bytes.length / 4 * 3];
25 |
26 | float mean_b = mean.get("b");
27 | float mean_g = mean.get("g");
28 | float mean_r = mean.get("r");
29 | for (int i = 0; i < bytes.length; i += 4) {
30 | int j = i / 4;
31 | colors[0 * DESIRED_SIDE * DESIRED_SIDE + j] = (bytes[i + 0] & 0xFF) - mean_r; // red
32 | colors[1 * DESIRED_SIDE * DESIRED_SIDE + j] = (bytes[i + 1] & 0xFF) - mean_g; // green
33 | colors[2 * DESIRED_SIDE * DESIRED_SIDE + j] = (bytes[i + 2] & 0xFF) - mean_b; // blue
34 | }
35 | return colors;
36 | }
37 |
38 | public static Bitmap convertTensorToBitmap(float[] imageTensor, Map mean) {
39 | float mean_b = mean.get("b");
40 | float mean_g = mean.get("g");
41 | float mean_r = mean.get("r");
42 | byte[] imageBytes = new byte[imageTensor.length * 4 / 3];
43 | for (int i = 0; i < imageBytes.length; i += 4) {
44 | int j = i / 4;
45 | imageBytes[i + 0] = (byte) (imageTensor[0 * DESIRED_SIDE * DESIRED_SIDE + j] + mean_r);
46 | imageBytes[i + 1] = (byte) (imageTensor[1 * DESIRED_SIDE * DESIRED_SIDE + j] + mean_g);
47 | imageBytes[i + 2] = (byte) (imageTensor[2 * DESIRED_SIDE * DESIRED_SIDE + j] + mean_b);
48 | }
49 | Bitmap bitmap = Bitmap.createBitmap(DESIRED_SIDE, DESIRED_SIDE, Bitmap.Config.ARGB_8888);
50 | bitmap.copyPixelsFromBuffer(ByteBuffer.wrap(imageBytes));
51 | //Tool.saveBitmap(bitmap);
52 | return bitmap;
53 | }
54 |
55 | private static Bitmap processBitmap(final Bitmap origin) {
56 | final int originWidth = origin.getWidth();
57 | final int originHeight = origin.getHeight();
58 | int height = SHORTER_SIDE;
59 | int width = SHORTER_SIDE;
60 | if (originWidth < originHeight) {
61 | height = (int) ((float) originHeight / originWidth * width);
62 | } else {
63 | width = (int) ((float) originWidth / originHeight * height);
64 | }
65 | final Bitmap scaled = Bitmap.createScaledBitmap(origin, width, height, false);
66 | int y = (height - DESIRED_SIDE) / 2;
67 | int x = (width - DESIRED_SIDE) / 2;
68 | return Bitmap.createBitmap(scaled, x, y, DESIRED_SIDE, DESIRED_SIDE);
69 |
70 | }
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/app/src/main/java/neural/imagerecognizer/app/ui/activities/BaseActivity.java:
--------------------------------------------------------------------------------
1 | package neural.imagerecognizer.app.ui.activities;
2 |
3 | import android.content.Intent;
4 | import android.content.pm.PackageManager;
5 | import neural.imagerecognizer.app.util.Tool;
6 | import android.support.annotation.LayoutRes;
7 | import android.support.annotation.NonNull;
8 | import android.support.v4.app.ActivityCompat;
9 | import android.support.v4.content.ContextCompat;
10 | import android.support.v7.app.AppCompatActivity;
11 | import android.view.View;
12 | import butterknife.ButterKnife;
13 |
14 | public abstract class BaseActivity extends AppCompatActivity {
15 |
16 | private static final int REQUEST_PERMISSION = 100;
17 |
18 | private static final int REQUEST_CODE = 101;
19 |
20 | private CallbackResult callback;
21 | private PermissionCallback permissionCallback;
22 |
23 | @Override
24 | public void setContentView(@LayoutRes int layoutResID) {
25 | super.setContentView(layoutResID);
26 | bind();
27 | }
28 |
29 | @Override
30 | public void setContentView(View view) {
31 | super.setContentView(view);
32 | bind();
33 | }
34 |
35 | private void bind() {
36 | ButterKnife.bind(this);
37 | }
38 |
39 | @Override
40 | protected void onDestroy() {
41 | super.onDestroy();
42 | ButterKnife.unbind(this);
43 | }
44 |
45 | public void startActivityForResult(Intent intent, CallbackResult callback) {
46 | this.callback = callback;
47 | super.startActivityForResult(intent, REQUEST_CODE);
48 | }
49 |
50 | public void requestPermission(PermissionCallback permissionCallback) {
51 | final String permission = permissionCallback.getPermissionName();// Manifest.permission.CAMERA;
52 |
53 | if (ContextCompat.checkSelfPermission(this, permission) != PackageManager.PERMISSION_GRANTED) {
54 |
55 | if (ActivityCompat.shouldShowRequestPermissionRationale(this, permission)) {
56 | permissionCallback.onFail();
57 | } else {
58 | // Handle the result in Activity#onRequestPermissionResult(int, String[], int[])
59 | this.permissionCallback = permissionCallback;
60 | ActivityCompat.requestPermissions(this, new String[]{permission}, REQUEST_PERMISSION);
61 | }
62 | } else {
63 | permissionCallback.onPermissionGranted();
64 | }
65 | }
66 |
67 | @Override
68 | public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
69 | super.onRequestPermissionsResult(requestCode, permissions, grantResults);
70 | if (requestCode != REQUEST_PERMISSION || permissionCallback == null)
71 | return;
72 | for (int i = 0; i < permissions.length; i++) {
73 | String permission = permissions[i];
74 | int grantResult = grantResults[i];
75 | boolean granted = grantResult == PackageManager.PERMISSION_GRANTED;
76 |
77 | if (permission.equals(permissionCallback.getPermissionName())) {
78 | if (granted)
79 | permissionCallback.onPermissionGranted();
80 | else
81 | permissionCallback.onFail();
82 | break;
83 | }
84 | }
85 | permissionCallback = null;
86 | }
87 |
88 | @Override
89 | protected void onActivityResult(int requestCode, int resultCode, Intent data) {
90 | super.onActivityResult(requestCode, resultCode, data);
91 |
92 | boolean resultOk = resultCode == RESULT_OK && requestCode == REQUEST_CODE && callback != null && data != null;
93 | if (resultOk)
94 | callback.onResult(data);
95 | else
96 | Tool.log("data nullable is %s", data == null);
97 | callback = null;
98 | }
99 |
100 | public interface PermissionCallback {
101 | void onPermissionGranted();
102 |
103 | void onFail();
104 |
105 | @NonNull
106 | String getPermissionName();
107 | }
108 |
109 | public interface CallbackResult {
110 | void onResult(@NonNull Intent data);
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/app/src/main/java/neural/imagerecognizer/app/ui/activities/MainActivity.java:
--------------------------------------------------------------------------------
1 | package neural.imagerecognizer.app.ui.activities;
2 |
3 | import android.Manifest;
4 | import android.content.Intent;
5 | import android.graphics.Bitmap;
6 | import android.graphics.BitmapFactory;
7 | import android.support.annotation.Nullable;
8 | import neural.imagerecognizer.app.R;
9 | import neural.imagerecognizer.app.nn.NNManager;
10 | import neural.imagerecognizer.app.ui.views.PaintView;
11 | import neural.imagerecognizer.app.ui.views.WhatisButton;
12 | import neural.imagerecognizer.app.util.ToastImageDescription;
13 | import neural.imagerecognizer.app.util.Tool;
14 | import android.net.Uri;
15 | import android.support.annotation.NonNull;
16 | import android.os.Bundle;
17 | import android.view.Menu;
18 | import android.view.MenuItem;
19 | import butterknife.Bind;
20 | import butterknife.OnClick;
21 | import com.desmond.squarecamera.CameraActivity;
22 |
23 | import java.io.FileNotFoundException;
24 | import java.io.InputStream;
25 |
26 | public class MainActivity extends BaseActivity {
27 |
28 | @Bind(R.id.btnWhatis)
29 | WhatisButton btnWhatis;
30 |
31 | @Bind(R.id.paintView)
32 | PaintView paintView;
33 |
34 | @Nullable
35 | private Bitmap recognBitmap;
36 |
37 | @Override
38 | protected void onCreate(Bundle savedInstanceState) {
39 | super.onCreate(savedInstanceState);
40 | setContentView(R.layout.activity_main);
41 |
42 | }
43 |
44 | @OnClick(R.id.btnWhatis)
45 | public void whatisClick() {
46 |
47 | if (paintView.isModePaint()) {
48 | recognBitmap = paintView.getPaintedBitmap();
49 | } else if (paintView.isModePhoto())
50 | if (recognBitmap == null)
51 | return;
52 |
53 | btnWhatis.startAnimation();
54 | NNManager.shared().identifyImage(recognBitmap, new NNManager.Callback() {
55 | @Override
56 | public void onResult(@NonNull String description) {
57 | btnWhatis.endAnimation();
58 | //set image description....
59 | ToastImageDescription.show(MainActivity.this, description);
60 | }
61 | });
62 |
63 | }
64 |
65 | @OnClick(R.id.ivErse)
66 | public void clean() {
67 |
68 | if (paintView.isModePhoto())
69 | paintView.setModePaint();
70 |
71 | paintView.clearBitmap();
72 | recognBitmap = null;
73 | Tool.showToast(this, R.string.toast_cleared);
74 | }
75 |
76 | @OnClick(R.id.ivPencil)
77 | public void enablePaintMode() {
78 | paintView.setModePaint();
79 | }
80 |
81 | @OnClick(R.id.ivGallery)
82 | public void selectFromGallery() {
83 | Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
84 | photoPickerIntent.setType("image/*");
85 | startActivityForResult(photoPickerIntent, new CallbackResult() {
86 | @Override
87 | public void onResult(@NonNull Intent data) {
88 | setImageFromIntent(data);
89 | }
90 |
91 | });
92 | }
93 |
94 | @OnClick(R.id.ivCamera)
95 | public void selectFromCamera() {
96 | requestPermission(new PermissionCallback() {
97 | @Override
98 | public void onPermissionGranted() {
99 | Intent startCustomCameraIntent = new Intent(MainActivity.this, CameraActivity.class);
100 | startActivityForResult(startCustomCameraIntent, new CallbackResult() {
101 | @Override
102 | public void onResult(@NonNull Intent data) {
103 | setImageFromIntent(data);
104 | }
105 | });
106 | }
107 |
108 | @Override
109 | public void onFail() {
110 | Tool.showToast(MainActivity.this, "Please give camera permission!");
111 | }
112 |
113 | @NonNull
114 | @Override
115 | public String getPermissionName() {
116 | return Manifest.permission.CAMERA;
117 | }
118 | });
119 | }
120 |
121 | private void setImageFromIntent(Intent data) {
122 | try {
123 | Uri imageUri = data.getData();
124 | InputStream imageStream = getContentResolver().openInputStream(imageUri);
125 |
126 | Bitmap bitmap = BitmapFactory.decodeStream(imageStream);
127 | this.recognBitmap = bitmap;
128 | paintView.setPhoto(bitmap);
129 | } catch (FileNotFoundException e) {
130 | e.printStackTrace();
131 | }
132 | }
133 |
134 | @Override
135 | public boolean onCreateOptionsMenu(Menu menu) {
136 | getMenuInflater().inflate(R.menu.menu_main, menu);
137 | return true;
138 | }
139 |
140 | @Override
141 | public boolean onOptionsItemSelected(MenuItem item) {
142 | int id = item.getItemId();
143 |
144 | if (id == R.id.action_share) {
145 | Tool.shareText(this, Tool.generateGooglePlayLink());
146 | return true;
147 | }
148 |
149 | return super.onOptionsItemSelected(item);
150 | }
151 |
152 | }
153 |
--------------------------------------------------------------------------------
/app/src/main/java/neural/imagerecognizer/app/ui/activities/SettingsActivity.java:
--------------------------------------------------------------------------------
1 | package neural.imagerecognizer.app.ui.activities;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import neural.imagerecognizer.app.R;
6 |
7 | public class SettingsActivity extends BaseActivity {
8 | @Override
9 | protected void onCreate(@Nullable Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.activity_settings);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/main/java/neural/imagerecognizer/app/ui/views/PaintView.java:
--------------------------------------------------------------------------------
1 | package neural.imagerecognizer.app.ui.views;
2 |
3 | import android.content.Context;
4 | import android.graphics.*;
5 | import android.support.annotation.NonNull;
6 | import android.support.annotation.Nullable;
7 | import android.util.AttributeSet;
8 | import android.view.MotionEvent;
9 | import android.widget.ImageView;
10 | import neural.imagerecognizer.app.util.Tool;
11 |
12 | public class PaintView extends ImageView {
13 | private Bitmap mBitmap;
14 | private Canvas mCanvas;
15 | private Path mPath;
16 | private Paint mBitmapPaint;
17 | private Paint mPaint;
18 | private Mode mode = Mode.PAINT;
19 |
20 | public PaintView(Context c) {
21 | super(c);
22 | init();
23 | }
24 |
25 | public PaintView(Context context, @Nullable AttributeSet attrs) {
26 | super(context, attrs);
27 | init();
28 | }
29 |
30 | private void init() {
31 | mPaint = new Paint();
32 | mPaint.setAntiAlias(true);
33 | mPaint.setDither(true);
34 | mPaint.setColor(Color.BLUE);
35 | mPaint.setStyle(Paint.Style.STROKE);
36 | mPaint.setStrokeJoin(Paint.Join.ROUND);
37 | mPaint.setStrokeCap(Paint.Cap.ROUND);
38 | mPaint.setStrokeWidth(9);
39 |
40 |
41 | mPath = new Path();
42 | mBitmapPaint = new Paint(Paint.DITHER_FLAG);
43 | }
44 |
45 | @Override
46 | protected void onSizeChanged(int w, int h, int oldw, int oldh) {
47 | super.onSizeChanged(w, h, oldw, oldh);
48 |
49 | recreateBitmap(w, h);
50 | }
51 |
52 | @Override
53 | protected void onDraw(@NonNull Canvas canvas) {
54 | super.onDraw(canvas);
55 | if (isModePhoto())
56 | return;
57 | canvas.drawBitmap(mBitmap, 0, 0, mBitmapPaint);
58 | canvas.drawPath(mPath, mPaint);
59 |
60 | }
61 |
62 | private float mX, mY;
63 | private static final float TOUCH_TOLERANCE = 4;
64 |
65 | private void touch_start(float x, float y) {
66 | mPath.reset();
67 | mPath.moveTo(x, y);
68 | mX = x;
69 | mY = y;
70 | }
71 |
72 | private void touch_move(float x, float y) {
73 | float dx = Math.abs(x - mX);
74 | float dy = Math.abs(y - mY);
75 | if (dx >= TOUCH_TOLERANCE || dy >= TOUCH_TOLERANCE) {
76 | mPath.quadTo(mX, mY, (x + mX) / 2, (y + mY) / 2);
77 | mX = x;
78 | mY = y;
79 | }
80 | }
81 |
82 | @Override
83 | public void setImageBitmap(Bitmap bm) {
84 | invalidate();
85 | super.setImageBitmap(bm);
86 | }
87 |
88 | public void setPhoto(Bitmap bitmap) {
89 | setModePhoto();
90 | setImageBitmap(bitmap);
91 | }
92 |
93 |
94 | public void setModePaint() {
95 | clearBitmap();
96 | mode = Mode.PAINT;
97 | }
98 |
99 | public void setModePhoto() {
100 | this.mode = Mode.PHOTO;
101 | }
102 |
103 | private void touch_up() {
104 | mPath.lineTo(mX, mY);
105 | // commit the path to our offscreen
106 | mCanvas.drawPath(mPath, mPaint);
107 | // kill this so we don't double draw
108 | mPath.reset();
109 | }
110 |
111 | @Override
112 | public boolean onTouchEvent(@NonNull MotionEvent event) {
113 | if (isModePhoto())
114 | return true;
115 | float x = event.getX();
116 | float y = event.getY();
117 |
118 | switch (event.getAction()) {
119 | case MotionEvent.ACTION_DOWN:
120 | touch_start(x, y);
121 | invalidate();
122 | break;
123 | case MotionEvent.ACTION_MOVE:
124 | touch_move(x, y);
125 | invalidate();
126 | break;
127 | case MotionEvent.ACTION_UP:
128 | touch_up();
129 | invalidate();
130 | break;
131 | }
132 | return true;
133 | }
134 |
135 | public boolean isModePaint() {
136 | return mode == Mode.PAINT;
137 | }
138 |
139 | public boolean isModePhoto() {
140 | return mode == Mode.PHOTO;
141 | }
142 |
143 | public Mode getMode() {
144 | return mode;
145 | }
146 |
147 | public Bitmap getPaintedBitmap() {
148 | return mBitmap;
149 | }
150 |
151 | public void clearBitmap() {
152 | setImageBitmap(null);
153 | recreateBitmap(getWidth(), getHeight());
154 | invalidate();
155 | Tool.log("btmap size: %s, %s", mBitmap.getWidth(), mBitmap.getHeight());
156 | }
157 |
158 | private void recreateBitmap(int width, int height) {
159 | mBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
160 | mCanvas = new Canvas(mBitmap);
161 | //mCanvas.drawARGB(255, 255, 255, 255);
162 | }
163 |
164 | public enum Mode {
165 | PAINT, PHOTO
166 | }
167 | }
168 |
--------------------------------------------------------------------------------
/app/src/main/java/neural/imagerecognizer/app/ui/views/WhatisButton.java:
--------------------------------------------------------------------------------
1 | package neural.imagerecognizer.app.ui.views;
2 |
3 | import android.animation.*;
4 | import android.content.Context;
5 | import android.graphics.Color;
6 | import android.util.AttributeSet;
7 | import android.view.View;
8 | import android.widget.Button;
9 | import neural.imagerecognizer.app.R;
10 |
11 | public class WhatisButton extends Button {
12 | private static final long ANIMATION_DURATION = 1000;
13 | private AnimatorSet animator;
14 |
15 | public WhatisButton(Context context) {
16 | super(context);
17 | init();
18 | }
19 |
20 |
21 | public WhatisButton(Context context, AttributeSet attrs) {
22 | super(context, attrs);
23 | init();
24 | }
25 |
26 | private void init() {
27 |
28 | setBackgroundColor(Color.BLUE);
29 | setTextColor(Color.WHITE);
30 | setText(R.string.label_whatis);
31 |
32 | ValueAnimator animatorBackground = ObjectAnimator.ofInt(this, "backgroundColor", Color.BLUE, Color.CYAN, Color.BLUE);
33 |
34 | animatorBackground.setEvaluator(new ArgbEvaluator());
35 | animatorBackground.setDuration(ANIMATION_DURATION);
36 | animatorBackground.setRepeatCount(ValueAnimator.INFINITE);
37 | animatorBackground.setRepeatMode(ValueAnimator.REVERSE);
38 |
39 | this.animator = new AnimatorSet();
40 | animator.playTogether(animatorBackground);//, scaleDownX, scaleDownY);
41 |
42 | }
43 |
44 | public void startAnimation() {
45 | setText(R.string.label_recognizing);
46 | animator.start();
47 | setClickable(false);
48 | setFocusable(false);
49 | }
50 |
51 | public void endAnimation() {
52 | setText(R.string.label_whatis);
53 | animator.end();
54 | setClickable(true);
55 | setFocusable(true);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/app/src/main/java/neural/imagerecognizer/app/util/AppUncaughtExceptionHandler.java:
--------------------------------------------------------------------------------
1 | package neural.imagerecognizer.app.util;
2 |
3 | import android.app.AlarmManager;
4 | import android.app.PendingIntent;
5 | import android.content.Context;
6 | import android.content.Intent;
7 | import neural.imagerecognizer.app.ui.activities.BaseActivity;
8 | import neural.imagerecognizer.app.ui.activities.MainActivity;
9 |
10 | public class AppUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {
11 | private Context context;
12 |
13 | public AppUncaughtExceptionHandler(Context context) {
14 | this.context = context;
15 | }
16 |
17 | @Override
18 | public void uncaughtException(Thread thread, Throwable ex) {
19 | Tool.log("Exception: " + ex);
20 |
21 | Intent intent = new Intent(context, MainActivity.class);
22 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
23 |
24 |
25 | PendingIntent pendingIntent = PendingIntent.getActivity(context, 0,
26 | new Intent(intent), PendingIntent.FLAG_UPDATE_CURRENT);
27 |
28 | AlarmManager manager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
29 | manager.set(AlarmManager.RTC, System.currentTimeMillis() + 15, pendingIntent);
30 | System.exit(2);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/neural/imagerecognizer/app/util/ThreadManager.java:
--------------------------------------------------------------------------------
1 | package neural.imagerecognizer.app.util;
2 |
3 | import android.os.Handler;
4 | import android.os.Looper;
5 | import android.support.annotation.MainThread;
6 | import android.support.annotation.NonNull;
7 | import android.support.annotation.Nullable;
8 |
9 | import java.util.concurrent.*;
10 |
11 | public class ThreadManager {
12 |
13 | private static ThreadManager instance;
14 | private ExecutorService pool;
15 |
16 | private ThreadManager() {
17 | pool = Executors.newCachedThreadPool();
18 | }
19 |
20 | public static synchronized ThreadManager getInstance() {
21 | if (instance == null) instance = new ThreadManager();
22 | return instance;
23 | }
24 |
25 | public void execute(Runnable r) {
26 | pool.execute(r);
27 | }
28 |
29 | public void execute(final Executor executor) {
30 | pool.execute(new Runnable() {
31 | @Override
32 | public void run() {
33 | try {
34 | final T data = executor.onExecute();
35 | if (data != null)
36 | runOnMainThread(new Runnable() {
37 | @Override
38 | public void run() {
39 | try {
40 | executor.onCallback(data);
41 | } catch (Exception e) {
42 | Tool.log("main thread error");
43 | }
44 | }
45 | });
46 | } catch (final Exception e) {
47 | Runnable onError = new Runnable() {
48 | @Override
49 | public void run() {
50 | e.printStackTrace();
51 | executor.onError(e);
52 | }
53 | };
54 | runOnMainThread(onError);
55 | }
56 | }
57 | });
58 | }
59 |
60 | private void runOnMainThread(Runnable r) {
61 | new Handler(Looper.getMainLooper()).post(r);
62 | }
63 |
64 | public void end() {
65 | pool.shutdown();
66 | try {
67 | if (!pool.awaitTermination(5, TimeUnit.SECONDS)) {
68 | pool.shutdownNow();
69 | if (!pool.awaitTermination(5, TimeUnit.SECONDS))
70 | System.err.println("Pool did not terminate");
71 | }
72 | } catch (InterruptedException ie) {
73 | pool.shutdownNow();
74 | Thread.currentThread().interrupt();
75 | }
76 | instance = null;
77 | }
78 |
79 | public interface Executor {
80 | @Nullable
81 | T onExecute() throws Exception;
82 |
83 | @MainThread
84 | void onCallback(@NonNull T data);
85 |
86 | @MainThread
87 | void onError(Exception e);
88 | }
89 | }
--------------------------------------------------------------------------------
/app/src/main/java/neural/imagerecognizer/app/util/ToastImageDescription.java:
--------------------------------------------------------------------------------
1 | package neural.imagerecognizer.app.util;
2 |
3 | import android.content.Context;
4 | import android.view.Gravity;
5 | import android.view.LayoutInflater;
6 | import android.view.TextureView;
7 | import android.view.View;
8 | import android.widget.TextView;
9 | import android.widget.Toast;
10 | import neural.imagerecognizer.app.R;
11 |
12 | public class ToastImageDescription {
13 | public static void show(final Context context, final String message) {
14 |
15 | Tool.runOnMainThread(new Runnable() {
16 | @Override
17 | public void run() {
18 | Toast toast = new Toast(context);
19 | toast.setGravity(Gravity.TOP, 0, (int) (Tool.getToolbarHeight() * 1.5));
20 | toast.setDuration(Toast.LENGTH_LONG);
21 | TextView tv = (TextView) LayoutInflater.from(context).inflate(R.layout.toast_image_description, null);
22 | tv.setText(message);
23 | toast.setView(tv);
24 | toast.show();
25 | }
26 | });
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/java/neural/imagerecognizer/app/util/Tool.java:
--------------------------------------------------------------------------------
1 | package neural.imagerecognizer.app.util;
2 |
3 | import android.Manifest;
4 | import android.app.Activity;
5 | import android.content.Context;
6 | import android.content.Intent;
7 | import android.graphics.Bitmap;
8 | import android.os.Handler;
9 | import android.os.Looper;
10 | import android.support.annotation.*;
11 | import android.util.Log;
12 | import android.util.TypedValue;
13 | import android.widget.Toast;
14 | import neural.imagerecognizer.app.RecognitionApp;
15 |
16 | import java.io.*;
17 | import java.util.ArrayList;
18 | import java.util.List;
19 | import java.util.Random;
20 |
21 | public final class Tool {
22 |
23 | private Tool() {
24 | }
25 |
26 |
27 | public static void log(String s, Object... args) {
28 | log(String.format(s, args));
29 | }
30 |
31 | public static void log(String s) {
32 | Log.v("ImageRecognizer", s);
33 | }
34 |
35 | public static void showToast(final Context context, final String message) {
36 | runOnMainThread(new Runnable() {
37 | @Override
38 | public void run() {
39 | Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
40 | }
41 | });
42 | }
43 |
44 | public static void showToast(Context context, @StringRes int message) {
45 | showToast(context, context.getString(message));
46 | }
47 |
48 | public static void showToast(@StringRes int message) {
49 | Context context = RecognitionApp.getInstance();
50 | showToast(context, context.getString(message));
51 | }
52 |
53 | public static void showToast(String message) {
54 | Context context = RecognitionApp.getInstance();
55 | showToast(context, message);
56 | }
57 |
58 | public static void runOnMainThread(Runnable runnable) {
59 | new Handler(Looper.getMainLooper()).post(runnable);
60 | }
61 |
62 | public static byte[] readRawFile(@RawRes int resId) {
63 | ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
64 | int size = 0;
65 | byte[] buffer = new byte[1024];
66 | try {
67 | InputStream ins = RecognitionApp.getInstance().getApplicationContext().getResources().openRawResource(resId);
68 | while ((size = ins.read(buffer, 0, 1024)) >= 0) {
69 | outputStream.write(buffer, 0, size);
70 | }
71 | } catch (IOException e) {
72 | e.printStackTrace();
73 | }
74 | return outputStream.toByteArray();
75 | }
76 |
77 |
78 | public static String readRawTextFile(@RawRes int resId) {
79 | StringBuilder result = new StringBuilder();
80 | InputStream inputStream = RecognitionApp.getInstance().getApplicationContext().getResources().openRawResource(resId);
81 |
82 | InputStreamReader inputreader = new InputStreamReader(inputStream);
83 | BufferedReader buffreader = new BufferedReader(inputreader);
84 | String line;
85 |
86 | try {
87 | while ((line = buffreader.readLine()) != null) {
88 | result.append(line);
89 | }
90 | } catch (IOException e) {
91 | e.printStackTrace();
92 | }
93 | return result.toString();
94 | }
95 |
96 | public static List readRawTextFileAsList(@RawRes int resId) {
97 | List result = new ArrayList<>();
98 | InputStream inputStream = RecognitionApp.getInstance().getApplicationContext().getResources().openRawResource(resId);
99 |
100 | InputStreamReader inputreader = new InputStreamReader(inputStream);
101 | BufferedReader buffreader = new BufferedReader(inputreader);
102 | String line;
103 |
104 | try {
105 | while ((line = buffreader.readLine()) != null) {
106 | result.add(line);
107 | }
108 | } catch (IOException e) {
109 | e.printStackTrace();
110 | }
111 | return result;
112 | }
113 |
114 | //Debug
115 | public static void saveBitmap(final Bitmap bitmap) {
116 | RecognitionApp.tm.execute(new Runnable() {
117 | @Override
118 | public void run() {
119 | File myDir = new File("/sdcard/saved_images");
120 | myDir.mkdirs();
121 | Random generator = new Random();
122 | int n = 10000;
123 | n = generator.nextInt(n);
124 | String fname = String.format("Image-%s.jpg", n);
125 | File file = new File(myDir, fname);
126 | if (file.exists()) file.delete();
127 | try {
128 | FileOutputStream out = new FileOutputStream(file);
129 | bitmap.compress(Bitmap.CompressFormat.JPEG, 90, out);
130 | out.flush();
131 | out.close();
132 | } catch (Exception e) {
133 | e.printStackTrace();
134 | }
135 | }
136 | });
137 | }
138 |
139 | public static void shareText(Context context, @NonNull String str) {
140 | Intent sendIntent = new Intent();
141 | sendIntent.setAction(Intent.ACTION_SEND);
142 | sendIntent.putExtra(Intent.EXTRA_TEXT, str);
143 | sendIntent.setType("text/plain");
144 | context.startActivity(sendIntent);
145 | }
146 |
147 | public static String generateGooglePlayLink() {
148 |
149 | return String.format("https://play.google.com/store/apps/details?id=%s",
150 | RecognitionApp.getInstance().getPackageName());
151 | }
152 |
153 | public static int getToolbarHeight() {
154 | Context ctx = RecognitionApp.getInstance().getApplicationContext();
155 | TypedValue tv = new TypedValue();
156 | if (ctx.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
157 | return TypedValue.complexToDimensionPixelSize(tv.data,
158 | ctx.getResources().getDisplayMetrics());
159 | }
160 | return 0;
161 | }
162 | }
163 |
--------------------------------------------------------------------------------
/app/src/main/java/org/dmlc/mxnet/MxnetException.java:
--------------------------------------------------------------------------------
1 | package org.dmlc.mxnet;
2 |
3 | public class MxnetException extends Exception {
4 | public MxnetException(){}
5 | public MxnetException(String txt) {
6 | super(txt);
7 | }
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/java/org/dmlc/mxnet/Predictor.java:
--------------------------------------------------------------------------------
1 | package org.dmlc.mxnet;
2 |
3 | public class Predictor {
4 | static {
5 | System.loadLibrary("mxnet_predict");
6 | }
7 |
8 | public static class InputNode {
9 | String key;
10 | int[] shape;
11 | public InputNode(String key, int[] shape) {
12 | this.key = key;
13 | this.shape = shape;
14 | }
15 | }
16 |
17 | public static class Device {
18 | public enum Type {
19 | CPU, GPU, CPU_PINNED
20 | }
21 |
22 | public Device(Type t, int i) {
23 | this.type = t;
24 | this.id = i;
25 | }
26 |
27 | Type type;
28 | int id;
29 | int ctype() {
30 | return this.type == Type.CPU? 1: this.type == Type.GPU? 2: 3;
31 | }
32 | }
33 |
34 | private long handle = 0;
35 |
36 | public Predictor(byte[] symbol, byte[] params, Device dev, InputNode[] input) {
37 | String[] keys = new String[input.length];
38 | int[][] shapes = new int[input.length][];
39 | for (int i=0; i
2 |
4 |
8 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/toast_backround.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
9 |
11 |
13 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
13 |
14 |
15 |
25 |
26 |
36 |
37 |
47 |
48 |
55 |
56 |
65 |
66 |
67 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
13 |
14 |
15 |
26 |
27 |
37 |
38 |
48 |
49 |
56 |
57 |
66 |
67 |
77 |
78 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/toast_image_description.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dneprDroid/ImageRecognizer-Android/dc7840ad1314f6666eb86113c4f1187787142825/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dneprDroid/ImageRecognizer-Android/dc7840ad1314f6666eb86113c4f1187787142825/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dneprDroid/ImageRecognizer-Android/dc7840ad1314f6666eb86113c4f1187787142825/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dneprDroid/ImageRecognizer-Android/dc7840ad1314f6666eb86113c4f1187787142825/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/raw/mean.json:
--------------------------------------------------------------------------------
1 | {
2 | "r":"117.0f",
3 | "g":"117.0f",
4 | "b":"117.0f"
5 | }
--------------------------------------------------------------------------------
/app/src/main/res/raw/params:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dneprDroid/ImageRecognizer-Android/dc7840ad1314f6666eb86113c4f1187787142825/app/src/main/res/raw/params
--------------------------------------------------------------------------------
/app/src/main/res/raw/symbol.json:
--------------------------------------------------------------------------------
1 | {
2 | "nodes": [
3 | {
4 | "op": "null",
5 | "param": {},
6 | "name": "data",
7 | "inputs": [],
8 | "backward_source_id": -1
9 | },
10 | {
11 | "op": "null",
12 | "param": {},
13 | "name": "convolution0_weight",
14 | "inputs": [],
15 | "backward_source_id": -1
16 | },
17 | {
18 | "op": "null",
19 | "param": {},
20 | "name": "convolution0_bias",
21 | "inputs": [],
22 | "backward_source_id": -1
23 | },
24 | {
25 | "op": "Convolution",
26 | "param": {
27 | "kernel": "(11, 11)",
28 | "no_bias": "False",
29 | "num_filter": "64",
30 | "num_group": "1",
31 | "pad": "(0, 0)",
32 | "stride": "(4, 4)",
33 | "workspace": "512"
34 | },
35 | "name": "convolution0",
36 | "inputs": [[0, 0], [1, 0], [2, 0]],
37 | "backward_source_id": -1
38 | },
39 | {
40 | "op": "null",
41 | "param": {},
42 | "name": "batchnorm0_gamma",
43 | "inputs": [],
44 | "backward_source_id": -1
45 | },
46 | {
47 | "op": "null",
48 | "param": {},
49 | "name": "batchnorm0_beta",
50 | "inputs": [],
51 | "backward_source_id": -1
52 | },
53 | {
54 | "op": "BatchNorm",
55 | "param": {
56 | "eps": "1e-10",
57 | "momentum": "0.1"
58 | },
59 | "name": "batchnorm0",
60 | "inputs": [[3, 0], [4, 0], [5, 0]],
61 | "backward_source_id": -1
62 | },
63 | {
64 | "op": "Activation",
65 | "param": {"act_type": "relu"},
66 | "name": "activation0",
67 | "inputs": [[6, 0]],
68 | "backward_source_id": -1
69 | },
70 | {
71 | "op": "Pooling",
72 | "param": {
73 | "kernel": "(3, 3)",
74 | "pad": "(0, 0)",
75 | "pool_type": "max",
76 | "stride": "(1, 1)"
77 | },
78 | "name": "pooling0",
79 | "inputs": [[7, 0]],
80 | "backward_source_id": -1
81 | },
82 | {
83 | "op": "null",
84 | "param": {},
85 | "name": "convolution1_weight",
86 | "inputs": [],
87 | "backward_source_id": -1
88 | },
89 | {
90 | "op": "null",
91 | "param": {},
92 | "name": "convolution1_bias",
93 | "inputs": [],
94 | "backward_source_id": -1
95 | },
96 | {
97 | "op": "Convolution",
98 | "param": {
99 | "kernel": "(3, 3)",
100 | "no_bias": "False",
101 | "num_filter": "192",
102 | "num_group": "1",
103 | "pad": "(0, 0)",
104 | "stride": "(2, 2)",
105 | "workspace": "512"
106 | },
107 | "name": "convolution1",
108 | "inputs": [[8, 0], [9, 0], [10, 0]],
109 | "backward_source_id": -1
110 | },
111 | {
112 | "op": "Activation",
113 | "param": {"act_type": "relu"},
114 | "name": "activation1",
115 | "inputs": [[11, 0]],
116 | "backward_source_id": -1
117 | },
118 | {
119 | "op": "Pooling",
120 | "param": {
121 | "kernel": "(3, 3)",
122 | "pad": "(0, 0)",
123 | "pool_type": "max",
124 | "stride": "(2, 2)"
125 | },
126 | "name": "pooling1",
127 | "inputs": [[12, 0]],
128 | "backward_source_id": -1
129 | },
130 | {
131 | "op": "null",
132 | "param": {},
133 | "name": "convolution2_weight",
134 | "inputs": [],
135 | "backward_source_id": -1
136 | },
137 | {
138 | "op": "null",
139 | "param": {},
140 | "name": "convolution2_bias",
141 | "inputs": [],
142 | "backward_source_id": -1
143 | },
144 | {
145 | "op": "Convolution",
146 | "param": {
147 | "kernel": "(3, 3)",
148 | "no_bias": "False",
149 | "num_filter": "96",
150 | "num_group": "1",
151 | "pad": "(1, 1)",
152 | "stride": "(1, 1)",
153 | "workspace": "512"
154 | },
155 | "name": "convolution2",
156 | "inputs": [[13, 0], [14, 0], [15, 0]],
157 | "backward_source_id": -1
158 | },
159 | {
160 | "op": "Activation",
161 | "param": {"act_type": "relu"},
162 | "name": "activation2",
163 | "inputs": [[16, 0]],
164 | "backward_source_id": -1
165 | },
166 | {
167 | "op": "null",
168 | "param": {},
169 | "name": "convolution3_weight",
170 | "inputs": [],
171 | "backward_source_id": -1
172 | },
173 | {
174 | "op": "null",
175 | "param": {},
176 | "name": "convolution3_bias",
177 | "inputs": [],
178 | "backward_source_id": -1
179 | },
180 | {
181 | "op": "Convolution",
182 | "param": {
183 | "kernel": "(3, 3)",
184 | "no_bias": "False",
185 | "num_filter": "160",
186 | "num_group": "1",
187 | "pad": "(1, 1)",
188 | "stride": "(1, 1)",
189 | "workspace": "512"
190 | },
191 | "name": "convolution3",
192 | "inputs": [[17, 0], [18, 0], [19, 0]],
193 | "backward_source_id": -1
194 | },
195 | {
196 | "op": "Activation",
197 | "param": {"act_type": "relu"},
198 | "name": "activation3",
199 | "inputs": [[20, 0]],
200 | "backward_source_id": -1
201 | },
202 | {
203 | "op": "null",
204 | "param": {},
205 | "name": "convolution4_weight",
206 | "inputs": [],
207 | "backward_source_id": -1
208 | },
209 | {
210 | "op": "null",
211 | "param": {},
212 | "name": "convolution4_bias",
213 | "inputs": [],
214 | "backward_source_id": -1
215 | },
216 | {
217 | "op": "Convolution",
218 | "param": {
219 | "kernel": "(3, 3)",
220 | "no_bias": "False",
221 | "num_filter": "144",
222 | "num_group": "1",
223 | "pad": "(1, 1)",
224 | "stride": "(1, 1)",
225 | "workspace": "512"
226 | },
227 | "name": "convolution4",
228 | "inputs": [[21, 0], [22, 0], [23, 0]],
229 | "backward_source_id": -1
230 | },
231 | {
232 | "op": "Activation",
233 | "param": {"act_type": "relu"},
234 | "name": "activation4",
235 | "inputs": [[24, 0]],
236 | "backward_source_id": -1
237 | },
238 | {
239 | "op": "null",
240 | "param": {},
241 | "name": "convolution5_weight",
242 | "inputs": [],
243 | "backward_source_id": -1
244 | },
245 | {
246 | "op": "null",
247 | "param": {},
248 | "name": "convolution5_bias",
249 | "inputs": [],
250 | "backward_source_id": -1
251 | },
252 | {
253 | "op": "Convolution",
254 | "param": {
255 | "kernel": "(3, 3)",
256 | "no_bias": "False",
257 | "num_filter": "160",
258 | "num_group": "1",
259 | "pad": "(1, 1)",
260 | "stride": "(1, 1)",
261 | "workspace": "512"
262 | },
263 | "name": "convolution5",
264 | "inputs": [[25, 0], [26, 0], [27, 0]],
265 | "backward_source_id": -1
266 | },
267 | {
268 | "op": "Activation",
269 | "param": {"act_type": "relu"},
270 | "name": "activation5",
271 | "inputs": [[28, 0]],
272 | "backward_source_id": -1
273 | },
274 | {
275 | "op": "null",
276 | "param": {},
277 | "name": "batchnorm1_gamma",
278 | "inputs": [],
279 | "backward_source_id": -1
280 | },
281 | {
282 | "op": "null",
283 | "param": {},
284 | "name": "batchnorm1_beta",
285 | "inputs": [],
286 | "backward_source_id": -1
287 | },
288 | {
289 | "op": "BatchNorm",
290 | "param": {
291 | "eps": "1e-10",
292 | "momentum": "0.1"
293 | },
294 | "name": "batchnorm1",
295 | "inputs": [[29, 0], [30, 0], [31, 0]],
296 | "backward_source_id": -1
297 | },
298 | {
299 | "op": "null",
300 | "param": {},
301 | "name": "convolution6_weight",
302 | "inputs": [],
303 | "backward_source_id": -1
304 | },
305 | {
306 | "op": "null",
307 | "param": {},
308 | "name": "convolution6_bias",
309 | "inputs": [],
310 | "backward_source_id": -1
311 | },
312 | {
313 | "op": "Convolution",
314 | "param": {
315 | "kernel": "(3, 3)",
316 | "no_bias": "False",
317 | "num_filter": "256",
318 | "num_group": "1",
319 | "pad": "(1, 1)",
320 | "stride": "(1, 1)",
321 | "workspace": "512"
322 | },
323 | "name": "convolution6",
324 | "inputs": [[32, 0], [33, 0], [34, 0]],
325 | "backward_source_id": -1
326 | },
327 | {
328 | "op": "Activation",
329 | "param": {"act_type": "relu"},
330 | "name": "activation6",
331 | "inputs": [[35, 0]],
332 | "backward_source_id": -1
333 | },
334 | {
335 | "op": "Pooling",
336 | "param": {
337 | "kernel": "(12, 12)",
338 | "pad": "(0, 0)",
339 | "pool_type": "avg",
340 | "stride": "(1, 1)"
341 | },
342 | "name": "pooling2",
343 | "inputs": [[36, 0]],
344 | "backward_source_id": -1
345 | },
346 | {
347 | "op": "Flatten",
348 | "param": {},
349 | "name": "feature",
350 | "inputs": [[37, 0]],
351 | "backward_source_id": -1
352 | },
353 | {
354 | "op": "Dropout",
355 | "param": {"p": "0.5"},
356 | "name": "dropout0",
357 | "inputs": [[38, 0]],
358 | "backward_source_id": -1
359 | },
360 | {
361 | "op": "null",
362 | "param": {},
363 | "name": "fullyconnected0_weight",
364 | "inputs": [],
365 | "backward_source_id": -1
366 | },
367 | {
368 | "op": "null",
369 | "param": {},
370 | "name": "fullyconnected0_bias",
371 | "inputs": [],
372 | "backward_source_id": -1
373 | },
374 | {
375 | "op": "FullyConnected",
376 | "param": {
377 | "no_bias": "False",
378 | "num_hidden": "1000"
379 | },
380 | "name": "fullyconnected0",
381 | "inputs": [[39, 0], [40, 0], [41, 0]],
382 | "backward_source_id": -1
383 | },
384 | {
385 | "op": "null",
386 | "param": {},
387 | "name": "softmax0_label",
388 | "inputs": [],
389 | "backward_source_id": -1
390 | },
391 | {
392 | "op": "Softmax",
393 | "param": {
394 | "grad_scale": "1",
395 | "multi_output": "False"
396 | },
397 | "name": "softmax0",
398 | "inputs": [[42, 0], [43, 0]],
399 | "backward_source_id": -1
400 | }
401 | ],
402 | "arg_nodes": [
403 | 0,
404 | 1,
405 | 2,
406 | 4,
407 | 5,
408 | 9,
409 | 10,
410 | 14,
411 | 15,
412 | 18,
413 | 19,
414 | 22,
415 | 23,
416 | 26,
417 | 27,
418 | 30,
419 | 31,
420 | 33,
421 | 34,
422 | 40,
423 | 41,
424 | 43
425 | ],
426 | "heads": [[44, 0]]
427 | }
--------------------------------------------------------------------------------
/app/src/main/res/raw/synset.txt:
--------------------------------------------------------------------------------
1 | n01440764 tench, Tinca tinca
2 | n01443537 goldfish, Carassius auratus
3 | n01484850 great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias
4 | n01491361 tiger shark, Galeocerdo cuvieri
5 | n01494475 hammerhead, hammerhead shark
6 | n01496331 electric ray, crampfish, numbfish, torpedo
7 | n01498041 stingray
8 | n01514668 cock
9 | n01514859 hen
10 | n01518878 ostrich, Struthio camelus
11 | n01530575 brambling, Fringilla montifringilla
12 | n01531178 goldfinch, Carduelis carduelis
13 | n01532829 house finch, linnet, Carpodacus mexicanus
14 | n01534433 junco, snowbird
15 | n01537544 indigo bunting, indigo finch, indigo bird, Passerina cyanea
16 | n01558993 robin, American robin, Turdus migratorius
17 | n01560419 bulbul
18 | n01580077 jay
19 | n01582220 magpie
20 | n01592084 chickadee
21 | n01601694 water ouzel, dipper
22 | n01608432 kite
23 | n01614925 bald eagle, American eagle, Haliaeetus leucocephalus
24 | n01616318 vulture
25 | n01622779 great grey owl, great gray owl, Strix nebulosa
26 | n01629819 European fire salamander, Salamandra salamandra
27 | n01630670 common newt, Triturus vulgaris
28 | n01631663 eft
29 | n01632458 spotted salamander, Ambystoma maculatum
30 | n01632777 axolotl, mud puppy, Ambystoma mexicanum
31 | n01641577 bullfrog, Rana catesbeiana
32 | n01644373 tree frog, tree-frog
33 | n01644900 tailed frog, bell toad, ribbed toad, tailed toad, Ascaphus trui
34 | n01664065 loggerhead, loggerhead turtle, Caretta caretta
35 | n01665541 leatherback turtle, leatherback, leathery turtle, Dermochelys coriacea
36 | n01667114 mud turtle
37 | n01667778 terrapin
38 | n01669191 box turtle, box tortoise
39 | n01675722 banded gecko
40 | n01677366 common iguana, iguana, Iguana iguana
41 | n01682714 American chameleon, anole, Anolis carolinensis
42 | n01685808 whiptail, whiptail lizard
43 | n01687978 agama
44 | n01688243 frilled lizard, Chlamydosaurus kingi
45 | n01689811 alligator lizard
46 | n01692333 Gila monster, Heloderma suspectum
47 | n01693334 green lizard, Lacerta viridis
48 | n01694178 African chameleon, Chamaeleo chamaeleon
49 | n01695060 Komodo dragon, Komodo lizard, dragon lizard, giant lizard, Varanus komodoensis
50 | n01697457 African crocodile, Nile crocodile, Crocodylus niloticus
51 | n01698640 American alligator, Alligator mississipiensis
52 | n01704323 triceratops
53 | n01728572 thunder snake, worm snake, Carphophis amoenus
54 | n01728920 ringneck snake, ring-necked snake, ring snake
55 | n01729322 hognose snake, puff adder, sand viper
56 | n01729977 green snake, grass snake
57 | n01734418 king snake, kingsnake
58 | n01735189 garter snake, grass snake
59 | n01737021 water snake
60 | n01739381 vine snake
61 | n01740131 night snake, Hypsiglena torquata
62 | n01742172 boa constrictor, Constrictor constrictor
63 | n01744401 rock python, rock snake, Python sebae
64 | n01748264 Indian cobra, Naja naja
65 | n01749939 green mamba
66 | n01751748 sea snake
67 | n01753488 horned viper, cerastes, sand viper, horned asp, Cerastes cornutus
68 | n01755581 diamondback, diamondback rattlesnake, Crotalus adamanteus
69 | n01756291 sidewinder, horned rattlesnake, Crotalus cerastes
70 | n01768244 trilobite
71 | n01770081 harvestman, daddy longlegs, Phalangium opilio
72 | n01770393 scorpion
73 | n01773157 black and gold garden spider, Argiope aurantia
74 | n01773549 barn spider, Araneus cavaticus
75 | n01773797 garden spider, Aranea diademata
76 | n01774384 black widow, Latrodectus mactans
77 | n01774750 tarantula
78 | n01775062 wolf spider, hunting spider
79 | n01776313 tick
80 | n01784675 centipede
81 | n01795545 black grouse
82 | n01796340 ptarmigan
83 | n01797886 ruffed grouse, partridge, Bonasa umbellus
84 | n01798484 prairie chicken, prairie grouse, prairie fowl
85 | n01806143 peacock
86 | n01806567 quail
87 | n01807496 partridge
88 | n01817953 African grey, African gray, Psittacus erithacus
89 | n01818515 macaw
90 | n01819313 sulphur-crested cockatoo, Kakatoe galerita, Cacatua galerita
91 | n01820546 lorikeet
92 | n01824575 coucal
93 | n01828970 bee eater
94 | n01829413 hornbill
95 | n01833805 hummingbird
96 | n01843065 jacamar
97 | n01843383 toucan
98 | n01847000 drake
99 | n01855032 red-breasted merganser, Mergus serrator
100 | n01855672 goose
101 | n01860187 black swan, Cygnus atratus
102 | n01871265 tusker
103 | n01872401 echidna, spiny anteater, anteater
104 | n01873310 platypus, duckbill, duckbilled platypus, duck-billed platypus, Ornithorhynchus anatinus
105 | n01877812 wallaby, brush kangaroo
106 | n01882714 koala, koala bear, kangaroo bear, native bear, Phascolarctos cinereus
107 | n01883070 wombat
108 | n01910747 jellyfish
109 | n01914609 sea anemone, anemone
110 | n01917289 brain coral
111 | n01924916 flatworm, platyhelminth
112 | n01930112 nematode, nematode worm, roundworm
113 | n01943899 conch
114 | n01944390 snail
115 | n01945685 slug
116 | n01950731 sea slug, nudibranch
117 | n01955084 chiton, coat-of-mail shell, sea cradle, polyplacophore
118 | n01968897 chambered nautilus, pearly nautilus, nautilus
119 | n01978287 Dungeness crab, Cancer magister
120 | n01978455 rock crab, Cancer irroratus
121 | n01980166 fiddler crab
122 | n01981276 king crab, Alaska crab, Alaskan king crab, Alaska king crab, Paralithodes camtschatica
123 | n01983481 American lobster, Northern lobster, Maine lobster, Homarus americanus
124 | n01984695 spiny lobster, langouste, rock lobster, crawfish, crayfish, sea crawfish
125 | n01985128 crayfish, crawfish, crawdad, crawdaddy
126 | n01986214 hermit crab
127 | n01990800 isopod
128 | n02002556 white stork, Ciconia ciconia
129 | n02002724 black stork, Ciconia nigra
130 | n02006656 spoonbill
131 | n02007558 flamingo
132 | n02009229 little blue heron, Egretta caerulea
133 | n02009912 American egret, great white heron, Egretta albus
134 | n02011460 bittern
135 | n02012849 crane
136 | n02013706 limpkin, Aramus pictus
137 | n02017213 European gallinule, Porphyrio porphyrio
138 | n02018207 American coot, marsh hen, mud hen, water hen, Fulica americana
139 | n02018795 bustard
140 | n02025239 ruddy turnstone, Arenaria interpres
141 | n02027492 red-backed sandpiper, dunlin, Erolia alpina
142 | n02028035 redshank, Tringa totanus
143 | n02033041 dowitcher
144 | n02037110 oystercatcher, oyster catcher
145 | n02051845 pelican
146 | n02056570 king penguin, Aptenodytes patagonica
147 | n02058221 albatross, mollymawk
148 | n02066245 grey whale, gray whale, devilfish, Eschrichtius gibbosus, Eschrichtius robustus
149 | n02071294 killer whale, killer, orca, grampus, sea wolf, Orcinus orca
150 | n02074367 dugong, Dugong dugon
151 | n02077923 sea lion
152 | n02085620 Chihuahua
153 | n02085782 Japanese spaniel
154 | n02085936 Maltese dog, Maltese terrier, Maltese
155 | n02086079 Pekinese, Pekingese, Peke
156 | n02086240 Shih-Tzu
157 | n02086646 Blenheim spaniel
158 | n02086910 papillon
159 | n02087046 toy terrier
160 | n02087394 Rhodesian ridgeback
161 | n02088094 Afghan hound, Afghan
162 | n02088238 basset, basset hound
163 | n02088364 beagle
164 | n02088466 bloodhound, sleuthhound
165 | n02088632 bluetick
166 | n02089078 black-and-tan coonhound
167 | n02089867 Walker hound, Walker foxhound
168 | n02089973 English foxhound
169 | n02090379 redbone
170 | n02090622 borzoi, Russian wolfhound
171 | n02090721 Irish wolfhound
172 | n02091032 Italian greyhound
173 | n02091134 whippet
174 | n02091244 Ibizan hound, Ibizan Podenco
175 | n02091467 Norwegian elkhound, elkhound
176 | n02091635 otterhound, otter hound
177 | n02091831 Saluki, gazelle hound
178 | n02092002 Scottish deerhound, deerhound
179 | n02092339 Weimaraner
180 | n02093256 Staffordshire bullterrier, Staffordshire bull terrier
181 | n02093428 American Staffordshire terrier, Staffordshire terrier, American pit bull terrier, pit bull terrier
182 | n02093647 Bedlington terrier
183 | n02093754 Border terrier
184 | n02093859 Kerry blue terrier
185 | n02093991 Irish terrier
186 | n02094114 Norfolk terrier
187 | n02094258 Norwich terrier
188 | n02094433 Yorkshire terrier
189 | n02095314 wire-haired fox terrier
190 | n02095570 Lakeland terrier
191 | n02095889 Sealyham terrier, Sealyham
192 | n02096051 Airedale, Airedale terrier
193 | n02096177 cairn, cairn terrier
194 | n02096294 Australian terrier
195 | n02096437 Dandie Dinmont, Dandie Dinmont terrier
196 | n02096585 Boston bull, Boston terrier
197 | n02097047 miniature schnauzer
198 | n02097130 giant schnauzer
199 | n02097209 standard schnauzer
200 | n02097298 Scotch terrier, Scottish terrier, Scottie
201 | n02097474 Tibetan terrier, chrysanthemum dog
202 | n02097658 silky terrier, Sydney silky
203 | n02098105 soft-coated wheaten terrier
204 | n02098286 West Highland white terrier
205 | n02098413 Lhasa, Lhasa apso
206 | n02099267 flat-coated retriever
207 | n02099429 curly-coated retriever
208 | n02099601 golden retriever
209 | n02099712 Labrador retriever
210 | n02099849 Chesapeake Bay retriever
211 | n02100236 German short-haired pointer
212 | n02100583 vizsla, Hungarian pointer
213 | n02100735 English setter
214 | n02100877 Irish setter, red setter
215 | n02101006 Gordon setter
216 | n02101388 Brittany spaniel
217 | n02101556 clumber, clumber spaniel
218 | n02102040 English springer, English springer spaniel
219 | n02102177 Welsh springer spaniel
220 | n02102318 cocker spaniel, English cocker spaniel, cocker
221 | n02102480 Sussex spaniel
222 | n02102973 Irish water spaniel
223 | n02104029 kuvasz
224 | n02104365 schipperke
225 | n02105056 groenendael
226 | n02105162 malinois
227 | n02105251 briard
228 | n02105412 kelpie
229 | n02105505 komondor
230 | n02105641 Old English sheepdog, bobtail
231 | n02105855 Shetland sheepdog, Shetland sheep dog, Shetland
232 | n02106030 collie
233 | n02106166 Border collie
234 | n02106382 Bouvier des Flandres, Bouviers des Flandres
235 | n02106550 Rottweiler
236 | n02106662 German shepherd, German shepherd dog, German police dog, alsatian
237 | n02107142 Doberman, Doberman pinscher
238 | n02107312 miniature pinscher
239 | n02107574 Greater Swiss Mountain dog
240 | n02107683 Bernese mountain dog
241 | n02107908 Appenzeller
242 | n02108000 EntleBucher
243 | n02108089 boxer
244 | n02108422 bull mastiff
245 | n02108551 Tibetan mastiff
246 | n02108915 French bulldog
247 | n02109047 Great Dane
248 | n02109525 Saint Bernard, St Bernard
249 | n02109961 Eskimo dog, husky
250 | n02110063 malamute, malemute, Alaskan malamute
251 | n02110185 Siberian husky
252 | n02110341 dalmatian, coach dog, carriage dog
253 | n02110627 affenpinscher, monkey pinscher, monkey dog
254 | n02110806 basenji
255 | n02110958 pug, pug-dog
256 | n02111129 Leonberg
257 | n02111277 Newfoundland, Newfoundland dog
258 | n02111500 Great Pyrenees
259 | n02111889 Samoyed, Samoyede
260 | n02112018 Pomeranian
261 | n02112137 chow, chow chow
262 | n02112350 keeshond
263 | n02112706 Brabancon griffon
264 | n02113023 Pembroke, Pembroke Welsh corgi
265 | n02113186 Cardigan, Cardigan Welsh corgi
266 | n02113624 toy poodle
267 | n02113712 miniature poodle
268 | n02113799 standard poodle
269 | n02113978 Mexican hairless
270 | n02114367 timber wolf, grey wolf, gray wolf, Canis lupus
271 | n02114548 white wolf, Arctic wolf, Canis lupus tundrarum
272 | n02114712 red wolf, maned wolf, Canis rufus, Canis niger
273 | n02114855 coyote, prairie wolf, brush wolf, Canis latrans
274 | n02115641 dingo, warrigal, warragal, Canis dingo
275 | n02115913 dhole, Cuon alpinus
276 | n02116738 African hunting dog, hyena dog, Cape hunting dog, Lycaon pictus
277 | n02117135 hyena, hyaena
278 | n02119022 red fox, Vulpes vulpes
279 | n02119789 kit fox, Vulpes macrotis
280 | n02120079 Arctic fox, white fox, Alopex lagopus
281 | n02120505 grey fox, gray fox, Urocyon cinereoargenteus
282 | n02123045 tabby, tabby cat
283 | n02123159 tiger cat
284 | n02123394 Persian cat
285 | n02123597 Siamese cat, Siamese
286 | n02124075 Egyptian cat
287 | n02125311 cougar, puma, catamount, mountain lion, painter, panther, Felis concolor
288 | n02127052 lynx, catamount
289 | n02128385 leopard, Panthera pardus
290 | n02128757 snow leopard, ounce, Panthera uncia
291 | n02128925 jaguar, panther, Panthera onca, Felis onca
292 | n02129165 lion, king of beasts, Panthera leo
293 | n02129604 tiger, Panthera tigris
294 | n02130308 cheetah, chetah, Acinonyx jubatus
295 | n02132136 brown bear, bruin, Ursus arctos
296 | n02133161 American black bear, black bear, Ursus americanus, Euarctos americanus
297 | n02134084 ice bear, polar bear, Ursus Maritimus, Thalarctos maritimus
298 | n02134418 sloth bear, Melursus ursinus, Ursus ursinus
299 | n02137549 mongoose
300 | n02138441 meerkat, mierkat
301 | n02165105 tiger beetle
302 | n02165456 ladybug, ladybeetle, lady beetle, ladybird, ladybird beetle
303 | n02167151 ground beetle, carabid beetle
304 | n02168699 long-horned beetle, longicorn, longicorn beetle
305 | n02169497 leaf beetle, chrysomelid
306 | n02172182 dung beetle
307 | n02174001 rhinoceros beetle
308 | n02177972 weevil
309 | n02190166 fly
310 | n02206856 bee
311 | n02219486 ant, emmet, pismire
312 | n02226429 grasshopper, hopper
313 | n02229544 cricket
314 | n02231487 walking stick, walkingstick, stick insect
315 | n02233338 cockroach, roach
316 | n02236044 mantis, mantid
317 | n02256656 cicada, cicala
318 | n02259212 leafhopper
319 | n02264363 lacewing, lacewing fly
320 | n02268443 dragonfly, darning needle, devil's darning needle, sewing needle, snake feeder, snake doctor, mosquito hawk, skeeter hawk
321 | n02268853 damselfly
322 | n02276258 admiral
323 | n02277742 ringlet, ringlet butterfly
324 | n02279972 monarch, monarch butterfly, milkweed butterfly, Danaus plexippus
325 | n02280649 cabbage butterfly
326 | n02281406 sulphur butterfly, sulfur butterfly
327 | n02281787 lycaenid, lycaenid butterfly
328 | n02317335 starfish, sea star
329 | n02319095 sea urchin
330 | n02321529 sea cucumber, holothurian
331 | n02325366 wood rabbit, cottontail, cottontail rabbit
332 | n02326432 hare
333 | n02328150 Angora, Angora rabbit
334 | n02342885 hamster
335 | n02346627 porcupine, hedgehog
336 | n02356798 fox squirrel, eastern fox squirrel, Sciurus niger
337 | n02361337 marmot
338 | n02363005 beaver
339 | n02364673 guinea pig, Cavia cobaya
340 | n02389026 sorrel
341 | n02391049 zebra
342 | n02395406 hog, pig, grunter, squealer, Sus scrofa
343 | n02396427 wild boar, boar, Sus scrofa
344 | n02397096 warthog
345 | n02398521 hippopotamus, hippo, river horse, Hippopotamus amphibius
346 | n02403003 ox
347 | n02408429 water buffalo, water ox, Asiatic buffalo, Bubalus bubalis
348 | n02410509 bison
349 | n02412080 ram, tup
350 | n02415577 bighorn, bighorn sheep, cimarron, Rocky Mountain bighorn, Rocky Mountain sheep, Ovis canadensis
351 | n02417914 ibex, Capra ibex
352 | n02422106 hartebeest
353 | n02422699 impala, Aepyceros melampus
354 | n02423022 gazelle
355 | n02437312 Arabian camel, dromedary, Camelus dromedarius
356 | n02437616 llama
357 | n02441942 weasel
358 | n02442845 mink
359 | n02443114 polecat, fitch, foulmart, foumart, Mustela putorius
360 | n02443484 black-footed ferret, ferret, Mustela nigripes
361 | n02444819 otter
362 | n02445715 skunk, polecat, wood pussy
363 | n02447366 badger
364 | n02454379 armadillo
365 | n02457408 three-toed sloth, ai, Bradypus tridactylus
366 | n02480495 orangutan, orang, orangutang, Pongo pygmaeus
367 | n02480855 gorilla, Gorilla gorilla
368 | n02481823 chimpanzee, chimp, Pan troglodytes
369 | n02483362 gibbon, Hylobates lar
370 | n02483708 siamang, Hylobates syndactylus, Symphalangus syndactylus
371 | n02484975 guenon, guenon monkey
372 | n02486261 patas, hussar monkey, Erythrocebus patas
373 | n02486410 baboon
374 | n02487347 macaque
375 | n02488291 langur
376 | n02488702 colobus, colobus monkey
377 | n02489166 proboscis monkey, Nasalis larvatus
378 | n02490219 marmoset
379 | n02492035 capuchin, ringtail, Cebus capucinus
380 | n02492660 howler monkey, howler
381 | n02493509 titi, titi monkey
382 | n02493793 spider monkey, Ateles geoffroyi
383 | n02494079 squirrel monkey, Saimiri sciureus
384 | n02497673 Madagascar cat, ring-tailed lemur, Lemur catta
385 | n02500267 indri, indris, Indri indri, Indri brevicaudatus
386 | n02504013 Indian elephant, Elephas maximus
387 | n02504458 African elephant, Loxodonta africana
388 | n02509815 lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens
389 | n02510455 giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca
390 | n02514041 barracouta, snoek
391 | n02526121 eel
392 | n02536864 coho, cohoe, coho salmon, blue jack, silver salmon, Oncorhynchus kisutch
393 | n02606052 rock beauty, Holocanthus tricolor
394 | n02607072 anemone fish
395 | n02640242 sturgeon
396 | n02641379 gar, garfish, garpike, billfish, Lepisosteus osseus
397 | n02643566 lionfish
398 | n02655020 puffer, pufferfish, blowfish, globefish
399 | n02666196 abacus
400 | n02667093 abaya
401 | n02669723 academic gown, academic robe, judge's robe
402 | n02672831 accordion, piano accordion, squeeze box
403 | n02676566 acoustic guitar
404 | n02687172 aircraft carrier, carrier, flattop, attack aircraft carrier
405 | n02690373 airliner
406 | n02692877 airship, dirigible
407 | n02699494 altar
408 | n02701002 ambulance
409 | n02704792 amphibian, amphibious vehicle
410 | n02708093 analog clock
411 | n02727426 apiary, bee house
412 | n02730930 apron
413 | n02747177 ashcan, trash can, garbage can, wastebin, ash bin, ash-bin, ashbin, dustbin, trash barrel, trash bin
414 | n02749479 assault rifle, assault gun
415 | n02769748 backpack, back pack, knapsack, packsack, rucksack, haversack
416 | n02776631 bakery, bakeshop, bakehouse
417 | n02777292 balance beam, beam
418 | n02782093 balloon
419 | n02783161 ballpoint, ballpoint pen, ballpen, Biro
420 | n02786058 Band Aid
421 | n02787622 banjo
422 | n02788148 bannister, banister, balustrade, balusters, handrail
423 | n02790996 barbell
424 | n02791124 barber chair
425 | n02791270 barbershop
426 | n02793495 barn
427 | n02794156 barometer
428 | n02795169 barrel, cask
429 | n02797295 barrow, garden cart, lawn cart, wheelbarrow
430 | n02799071 baseball
431 | n02802426 basketball
432 | n02804414 bassinet
433 | n02804610 bassoon
434 | n02807133 bathing cap, swimming cap
435 | n02808304 bath towel
436 | n02808440 bathtub, bathing tub, bath, tub
437 | n02814533 beach wagon, station wagon, wagon, estate car, beach waggon, station waggon, waggon
438 | n02814860 beacon, lighthouse, beacon light, pharos
439 | n02815834 beaker
440 | n02817516 bearskin, busby, shako
441 | n02823428 beer bottle
442 | n02823750 beer glass
443 | n02825657 bell cote, bell cot
444 | n02834397 bib
445 | n02835271 bicycle-built-for-two, tandem bicycle, tandem
446 | n02837789 bikini, two-piece
447 | n02840245 binder, ring-binder
448 | n02841315 binoculars, field glasses, opera glasses
449 | n02843684 birdhouse
450 | n02859443 boathouse
451 | n02860847 bobsled, bobsleigh, bob
452 | n02865351 bolo tie, bolo, bola tie, bola
453 | n02869837 bonnet, poke bonnet
454 | n02870880 bookcase
455 | n02871525 bookshop, bookstore, bookstall
456 | n02877765 bottlecap
457 | n02879718 bow
458 | n02883205 bow tie, bow-tie, bowtie
459 | n02892201 brass, memorial tablet, plaque
460 | n02892767 brassiere, bra, bandeau
461 | n02894605 breakwater, groin, groyne, mole, bulwark, seawall, jetty
462 | n02895154 breastplate, aegis, egis
463 | n02906734 broom
464 | n02909870 bucket, pail
465 | n02910353 buckle
466 | n02916936 bulletproof vest
467 | n02917067 bullet train, bullet
468 | n02927161 butcher shop, meat market
469 | n02930766 cab, hack, taxi, taxicab
470 | n02939185 caldron, cauldron
471 | n02948072 candle, taper, wax light
472 | n02950826 cannon
473 | n02951358 canoe
474 | n02951585 can opener, tin opener
475 | n02963159 cardigan
476 | n02965783 car mirror
477 | n02966193 carousel, carrousel, merry-go-round, roundabout, whirligig
478 | n02966687 carpenter's kit, tool kit
479 | n02971356 carton
480 | n02974003 car wheel
481 | n02977058 cash machine, cash dispenser, automated teller machine, automatic teller machine, automated teller, automatic teller, ATM
482 | n02978881 cassette
483 | n02979186 cassette player
484 | n02980441 castle
485 | n02981792 catamaran
486 | n02988304 CD player
487 | n02992211 cello, violoncello
488 | n02992529 cellular telephone, cellular phone, cellphone, cell, mobile phone
489 | n02999410 chain
490 | n03000134 chainlink fence
491 | n03000247 chain mail, ring mail, mail, chain armor, chain armour, ring armor, ring armour
492 | n03000684 chain saw, chainsaw
493 | n03014705 chest
494 | n03016953 chiffonier, commode
495 | n03017168 chime, bell, gong
496 | n03018349 china cabinet, china closet
497 | n03026506 Christmas stocking
498 | n03028079 church, church building
499 | n03032252 cinema, movie theater, movie theatre, movie house, picture palace
500 | n03041632 cleaver, meat cleaver, chopper
501 | n03042490 cliff dwelling
502 | n03045698 cloak
503 | n03047690 clog, geta, patten, sabot
504 | n03062245 cocktail shaker
505 | n03063599 coffee mug
506 | n03063689 coffeepot
507 | n03065424 coil, spiral, volute, whorl, helix
508 | n03075370 combination lock
509 | n03085013 computer keyboard, keypad
510 | n03089624 confectionery, confectionary, candy store
511 | n03095699 container ship, containership, container vessel
512 | n03100240 convertible
513 | n03109150 corkscrew, bottle screw
514 | n03110669 cornet, horn, trumpet, trump
515 | n03124043 cowboy boot
516 | n03124170 cowboy hat, ten-gallon hat
517 | n03125729 cradle
518 | n03126707 crane
519 | n03127747 crash helmet
520 | n03127925 crate
521 | n03131574 crib, cot
522 | n03133878 Crock Pot
523 | n03134739 croquet ball
524 | n03141823 crutch
525 | n03146219 cuirass
526 | n03160309 dam, dike, dyke
527 | n03179701 desk
528 | n03180011 desktop computer
529 | n03187595 dial telephone, dial phone
530 | n03188531 diaper, nappy, napkin
531 | n03196217 digital clock
532 | n03197337 digital watch
533 | n03201208 dining table, board
534 | n03207743 dishrag, dishcloth
535 | n03207941 dishwasher, dish washer, dishwashing machine
536 | n03208938 disk brake, disc brake
537 | n03216828 dock, dockage, docking facility
538 | n03218198 dogsled, dog sled, dog sleigh
539 | n03220513 dome
540 | n03223299 doormat, welcome mat
541 | n03240683 drilling platform, offshore rig
542 | n03249569 drum, membranophone, tympan
543 | n03250847 drumstick
544 | n03255030 dumbbell
545 | n03259280 Dutch oven
546 | n03271574 electric fan, blower
547 | n03272010 electric guitar
548 | n03272562 electric locomotive
549 | n03290653 entertainment center
550 | n03291819 envelope
551 | n03297495 espresso maker
552 | n03314780 face powder
553 | n03325584 feather boa, boa
554 | n03337140 file, file cabinet, filing cabinet
555 | n03344393 fireboat
556 | n03345487 fire engine, fire truck
557 | n03347037 fire screen, fireguard
558 | n03355925 flagpole, flagstaff
559 | n03372029 flute, transverse flute
560 | n03376595 folding chair
561 | n03379051 football helmet
562 | n03384352 forklift
563 | n03388043 fountain
564 | n03388183 fountain pen
565 | n03388549 four-poster
566 | n03393912 freight car
567 | n03394916 French horn, horn
568 | n03400231 frying pan, frypan, skillet
569 | n03404251 fur coat
570 | n03417042 garbage truck, dustcart
571 | n03424325 gasmask, respirator, gas helmet
572 | n03425413 gas pump, gasoline pump, petrol pump, island dispenser
573 | n03443371 goblet
574 | n03444034 go-kart
575 | n03445777 golf ball
576 | n03445924 golfcart, golf cart
577 | n03447447 gondola
578 | n03447721 gong, tam-tam
579 | n03450230 gown
580 | n03452741 grand piano, grand
581 | n03457902 greenhouse, nursery, glasshouse
582 | n03459775 grille, radiator grille
583 | n03461385 grocery store, grocery, food market, market
584 | n03467068 guillotine
585 | n03476684 hair slide
586 | n03476991 hair spray
587 | n03478589 half track
588 | n03481172 hammer
589 | n03482405 hamper
590 | n03483316 hand blower, blow dryer, blow drier, hair dryer, hair drier
591 | n03485407 hand-held computer, hand-held microcomputer
592 | n03485794 handkerchief, hankie, hanky, hankey
593 | n03492542 hard disc, hard disk, fixed disk
594 | n03494278 harmonica, mouth organ, harp, mouth harp
595 | n03495258 harp
596 | n03496892 harvester, reaper
597 | n03498962 hatchet
598 | n03527444 holster
599 | n03529860 home theater, home theatre
600 | n03530642 honeycomb
601 | n03532672 hook, claw
602 | n03534580 hoopskirt, crinoline
603 | n03535780 horizontal bar, high bar
604 | n03538406 horse cart, horse-cart
605 | n03544143 hourglass
606 | n03584254 iPod
607 | n03584829 iron, smoothing iron
608 | n03590841 jack-o'-lantern
609 | n03594734 jean, blue jean, denim
610 | n03594945 jeep, landrover
611 | n03595614 jersey, T-shirt, tee shirt
612 | n03598930 jigsaw puzzle
613 | n03599486 jinrikisha, ricksha, rickshaw
614 | n03602883 joystick
615 | n03617480 kimono
616 | n03623198 knee pad
617 | n03627232 knot
618 | n03630383 lab coat, laboratory coat
619 | n03633091 ladle
620 | n03637318 lampshade, lamp shade
621 | n03642806 laptop, laptop computer
622 | n03649909 lawn mower, mower
623 | n03657121 lens cap, lens cover
624 | n03658185 letter opener, paper knife, paperknife
625 | n03661043 library
626 | n03662601 lifeboat
627 | n03666591 lighter, light, igniter, ignitor
628 | n03670208 limousine, limo
629 | n03673027 liner, ocean liner
630 | n03676483 lipstick, lip rouge
631 | n03680355 Loafer
632 | n03690938 lotion
633 | n03691459 loudspeaker, speaker, speaker unit, loudspeaker system, speaker system
634 | n03692522 loupe, jeweler's loupe
635 | n03697007 lumbermill, sawmill
636 | n03706229 magnetic compass
637 | n03709823 mailbag, postbag
638 | n03710193 mailbox, letter box
639 | n03710637 maillot
640 | n03710721 maillot, tank suit
641 | n03717622 manhole cover
642 | n03720891 maraca
643 | n03721384 marimba, xylophone
644 | n03724870 mask
645 | n03729826 matchstick
646 | n03733131 maypole
647 | n03733281 maze, labyrinth
648 | n03733805 measuring cup
649 | n03742115 medicine chest, medicine cabinet
650 | n03743016 megalith, megalithic structure
651 | n03759954 microphone, mike
652 | n03761084 microwave, microwave oven
653 | n03763968 military uniform
654 | n03764736 milk can
655 | n03769881 minibus
656 | n03770439 miniskirt, mini
657 | n03770679 minivan
658 | n03773504 missile
659 | n03775071 mitten
660 | n03775546 mixing bowl
661 | n03776460 mobile home, manufactured home
662 | n03777568 Model T
663 | n03777754 modem
664 | n03781244 monastery
665 | n03782006 monitor
666 | n03785016 moped
667 | n03786901 mortar
668 | n03787032 mortarboard
669 | n03788195 mosque
670 | n03788365 mosquito net
671 | n03791053 motor scooter, scooter
672 | n03792782 mountain bike, all-terrain bike, off-roader
673 | n03792972 mountain tent
674 | n03793489 mouse, computer mouse
675 | n03794056 mousetrap
676 | n03796401 moving van
677 | n03803284 muzzle
678 | n03804744 nail
679 | n03814639 neck brace
680 | n03814906 necklace
681 | n03825788 nipple
682 | n03832673 notebook, notebook computer
683 | n03837869 obelisk
684 | n03838899 oboe, hautboy, hautbois
685 | n03840681 ocarina, sweet potato
686 | n03841143 odometer, hodometer, mileometer, milometer
687 | n03843555 oil filter
688 | n03854065 organ, pipe organ
689 | n03857828 oscilloscope, scope, cathode-ray oscilloscope, CRO
690 | n03866082 overskirt
691 | n03868242 oxcart
692 | n03868863 oxygen mask
693 | n03871628 packet
694 | n03873416 paddle, boat paddle
695 | n03874293 paddlewheel, paddle wheel
696 | n03874599 padlock
697 | n03876231 paintbrush
698 | n03877472 pajama, pyjama, pj's, jammies
699 | n03877845 palace
700 | n03884397 panpipe, pandean pipe, syrinx
701 | n03887697 paper towel
702 | n03888257 parachute, chute
703 | n03888605 parallel bars, bars
704 | n03891251 park bench
705 | n03891332 parking meter
706 | n03895866 passenger car, coach, carriage
707 | n03899768 patio, terrace
708 | n03902125 pay-phone, pay-station
709 | n03903868 pedestal, plinth, footstall
710 | n03908618 pencil box, pencil case
711 | n03908714 pencil sharpener
712 | n03916031 perfume, essence
713 | n03920288 Petri dish
714 | n03924679 photocopier
715 | n03929660 pick, plectrum, plectron
716 | n03929855 pickelhaube
717 | n03930313 picket fence, paling
718 | n03930630 pickup, pickup truck
719 | n03933933 pier
720 | n03935335 piggy bank, penny bank
721 | n03937543 pill bottle
722 | n03938244 pillow
723 | n03942813 ping-pong ball
724 | n03944341 pinwheel
725 | n03947888 pirate, pirate ship
726 | n03950228 pitcher, ewer
727 | n03954731 plane, carpenter's plane, woodworking plane
728 | n03956157 planetarium
729 | n03958227 plastic bag
730 | n03961711 plate rack
731 | n03967562 plow, plough
732 | n03970156 plunger, plumber's helper
733 | n03976467 Polaroid camera, Polaroid Land camera
734 | n03976657 pole
735 | n03977966 police van, police wagon, paddy wagon, patrol wagon, wagon, black Maria
736 | n03980874 poncho
737 | n03982430 pool table, billiard table, snooker table
738 | n03983396 pop bottle, soda bottle
739 | n03991062 pot, flowerpot
740 | n03992509 potter's wheel
741 | n03995372 power drill
742 | n03998194 prayer rug, prayer mat
743 | n04004767 printer
744 | n04005630 prison, prison house
745 | n04008634 projectile, missile
746 | n04009552 projector
747 | n04019541 puck, hockey puck
748 | n04023962 punching bag, punch bag, punching ball, punchball
749 | n04026417 purse
750 | n04033901 quill, quill pen
751 | n04033995 quilt, comforter, comfort, puff
752 | n04037443 racer, race car, racing car
753 | n04039381 racket, racquet
754 | n04040759 radiator
755 | n04041544 radio, wireless
756 | n04044716 radio telescope, radio reflector
757 | n04049303 rain barrel
758 | n04065272 recreational vehicle, RV, R.V.
759 | n04067472 reel
760 | n04069434 reflex camera
761 | n04070727 refrigerator, icebox
762 | n04074963 remote control, remote
763 | n04081281 restaurant, eating house, eating place, eatery
764 | n04086273 revolver, six-gun, six-shooter
765 | n04090263 rifle
766 | n04099969 rocking chair, rocker
767 | n04111531 rotisserie
768 | n04116512 rubber eraser, rubber, pencil eraser
769 | n04118538 rugby ball
770 | n04118776 rule, ruler
771 | n04120489 running shoe
772 | n04125021 safe
773 | n04127249 safety pin
774 | n04131690 saltshaker, salt shaker
775 | n04133789 sandal
776 | n04136333 sarong
777 | n04141076 sax, saxophone
778 | n04141327 scabbard
779 | n04141975 scale, weighing machine
780 | n04146614 school bus
781 | n04147183 schooner
782 | n04149813 scoreboard
783 | n04152593 screen, CRT screen
784 | n04153751 screw
785 | n04154565 screwdriver
786 | n04162706 seat belt, seatbelt
787 | n04179913 sewing machine
788 | n04192698 shield, buckler
789 | n04200800 shoe shop, shoe-shop, shoe store
790 | n04201297 shoji
791 | n04204238 shopping basket
792 | n04204347 shopping cart
793 | n04208210 shovel
794 | n04209133 shower cap
795 | n04209239 shower curtain
796 | n04228054 ski
797 | n04229816 ski mask
798 | n04235860 sleeping bag
799 | n04238763 slide rule, slipstick
800 | n04239074 sliding door
801 | n04243546 slot, one-armed bandit
802 | n04251144 snorkel
803 | n04252077 snowmobile
804 | n04252225 snowplow, snowplough
805 | n04254120 soap dispenser
806 | n04254680 soccer ball
807 | n04254777 sock
808 | n04258138 solar dish, solar collector, solar furnace
809 | n04259630 sombrero
810 | n04263257 soup bowl
811 | n04264628 space bar
812 | n04265275 space heater
813 | n04266014 space shuttle
814 | n04270147 spatula
815 | n04273569 speedboat
816 | n04275548 spider web, spider's web
817 | n04277352 spindle
818 | n04285008 sports car, sport car
819 | n04286575 spotlight, spot
820 | n04296562 stage
821 | n04310018 steam locomotive
822 | n04311004 steel arch bridge
823 | n04311174 steel drum
824 | n04317175 stethoscope
825 | n04325704 stole
826 | n04326547 stone wall
827 | n04328186 stopwatch, stop watch
828 | n04330267 stove
829 | n04332243 strainer
830 | n04335435 streetcar, tram, tramcar, trolley, trolley car
831 | n04336792 stretcher
832 | n04344873 studio couch, day bed
833 | n04346328 stupa, tope
834 | n04347754 submarine, pigboat, sub, U-boat
835 | n04350905 suit, suit of clothes
836 | n04355338 sundial
837 | n04355933 sunglass
838 | n04356056 sunglasses, dark glasses, shades
839 | n04357314 sunscreen, sunblock, sun blocker
840 | n04366367 suspension bridge
841 | n04367480 swab, swob, mop
842 | n04370456 sweatshirt
843 | n04371430 swimming trunks, bathing trunks
844 | n04371774 swing
845 | n04372370 switch, electric switch, electrical switch
846 | n04376876 syringe
847 | n04380533 table lamp
848 | n04389033 tank, army tank, armored combat vehicle, armoured combat vehicle
849 | n04392985 tape player
850 | n04398044 teapot
851 | n04399382 teddy, teddy bear
852 | n04404412 television, television system
853 | n04409515 tennis ball
854 | n04417672 thatch, thatched roof
855 | n04418357 theater curtain, theatre curtain
856 | n04423845 thimble
857 | n04428191 thresher, thrasher, threshing machine
858 | n04429376 throne
859 | n04435653 tile roof
860 | n04442312 toaster
861 | n04443257 tobacco shop, tobacconist shop, tobacconist
862 | n04447861 toilet seat
863 | n04456115 torch
864 | n04458633 totem pole
865 | n04461696 tow truck, tow car, wrecker
866 | n04462240 toyshop
867 | n04465501 tractor
868 | n04467665 trailer truck, tractor trailer, trucking rig, rig, articulated lorry, semi
869 | n04476259 tray
870 | n04479046 trench coat
871 | n04482393 tricycle, trike, velocipede
872 | n04483307 trimaran
873 | n04485082 tripod
874 | n04486054 triumphal arch
875 | n04487081 trolleybus, trolley coach, trackless trolley
876 | n04487394 trombone
877 | n04493381 tub, vat
878 | n04501370 turnstile
879 | n04505470 typewriter keyboard
880 | n04507155 umbrella
881 | n04509417 unicycle, monocycle
882 | n04515003 upright, upright piano
883 | n04517823 vacuum, vacuum cleaner
884 | n04522168 vase
885 | n04523525 vault
886 | n04525038 velvet
887 | n04525305 vending machine
888 | n04532106 vestment
889 | n04532670 viaduct
890 | n04536866 violin, fiddle
891 | n04540053 volleyball
892 | n04542943 waffle iron
893 | n04548280 wall clock
894 | n04548362 wallet, billfold, notecase, pocketbook
895 | n04550184 wardrobe, closet, press
896 | n04552348 warplane, military plane
897 | n04553703 washbasin, handbasin, washbowl, lavabo, wash-hand basin
898 | n04554684 washer, automatic washer, washing machine
899 | n04557648 water bottle
900 | n04560804 water jug
901 | n04562935 water tower
902 | n04579145 whiskey jug
903 | n04579432 whistle
904 | n04584207 wig
905 | n04589890 window screen
906 | n04590129 window shade
907 | n04591157 Windsor tie
908 | n04591713 wine bottle
909 | n04592741 wing
910 | n04596742 wok
911 | n04597913 wooden spoon
912 | n04599235 wool, woolen, woollen
913 | n04604644 worm fence, snake fence, snake-rail fence, Virginia fence
914 | n04606251 wreck
915 | n04612504 yawl
916 | n04613696 yurt
917 | n06359193 web site, website, internet site, site
918 | n06596364 comic book
919 | n06785654 crossword puzzle, crossword
920 | n06794110 street sign
921 | n06874185 traffic light, traffic signal, stoplight
922 | n07248320 book jacket, dust cover, dust jacket, dust wrapper
923 | n07565083 menu
924 | n07579787 plate
925 | n07583066 guacamole
926 | n07584110 consomme
927 | n07590611 hot pot, hotpot
928 | n07613480 trifle
929 | n07614500 ice cream, icecream
930 | n07615774 ice lolly, lolly, lollipop, popsicle
931 | n07684084 French loaf
932 | n07693725 bagel, beigel
933 | n07695742 pretzel
934 | n07697313 cheeseburger
935 | n07697537 hotdog, hot dog, red hot
936 | n07711569 mashed potato
937 | n07714571 head cabbage
938 | n07714990 broccoli
939 | n07715103 cauliflower
940 | n07716358 zucchini, courgette
941 | n07716906 spaghetti squash
942 | n07717410 acorn squash
943 | n07717556 butternut squash
944 | n07718472 cucumber, cuke
945 | n07718747 artichoke, globe artichoke
946 | n07720875 bell pepper
947 | n07730033 cardoon
948 | n07734744 mushroom
949 | n07742313 Granny Smith
950 | n07745940 strawberry
951 | n07747607 orange
952 | n07749582 lemon
953 | n07753113 fig
954 | n07753275 pineapple, ananas
955 | n07753592 banana
956 | n07754684 jackfruit, jak, jack
957 | n07760859 custard apple
958 | n07768694 pomegranate
959 | n07802026 hay
960 | n07831146 carbonara
961 | n07836838 chocolate sauce, chocolate syrup
962 | n07860988 dough
963 | n07871810 meat loaf, meatloaf
964 | n07873807 pizza, pizza pie
965 | n07875152 potpie
966 | n07880968 burrito
967 | n07892512 red wine
968 | n07920052 espresso
969 | n07930864 cup
970 | n07932039 eggnog
971 | n09193705 alp
972 | n09229709 bubble
973 | n09246464 cliff, drop, drop-off
974 | n09256479 coral reef
975 | n09288635 geyser
976 | n09332890 lakeside, lakeshore
977 | n09399592 promontory, headland, head, foreland
978 | n09421951 sandbar, sand bar
979 | n09428293 seashore, coast, seacoast, sea-coast
980 | n09468604 valley, vale
981 | n09472597 volcano
982 | n09835506 ballplayer, baseball player
983 | n10148035 groom, bridegroom
984 | n10565667 scuba diver
985 | n11879895 rapeseed
986 | n11939491 daisy
987 | n12057211 yellow lady's slipper, yellow lady-slipper, Cypripedium calceolus, Cypripedium parviflorum
988 | n12144580 corn
989 | n12267677 acorn
990 | n12620546 hip, rose hip, rosehip
991 | n12768682 buckeye, horse chestnut, conker
992 | n12985857 coral fungus
993 | n12998815 agaric
994 | n13037406 gyromitra
995 | n13040303 stinkhorn, carrion fungus
996 | n13044778 earthstar
997 | n13052670 hen-of-the-woods, hen of the woods, Polyporus frondosus, Grifola frondosa
998 | n13054560 bolete
999 | n13133613 ear, spike, capitulum
1000 | n15075141 toilet tissue, toilet paper, bathroom tissue
1001 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #6A7073
4 | #3071db
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 5dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ImageRecognizer
3 |
4 | Settings
5 | What is
6 | Recognizing…
7 | Recognition error!
8 | Shit
9 | Tell friends
10 | Cleared
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | mavenCentral()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.2.3'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dneprDroid/ImageRecognizer-Android/dc7840ad1314f6666eb86113c4f1187787142825/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Apr 10 15:27:10 PDT 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/images/Screenshot1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dneprDroid/ImageRecognizer-Android/dc7840ad1314f6666eb86113c4f1187787142825/images/Screenshot1.png
--------------------------------------------------------------------------------
/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file should *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | sdk.dir=/Users/useruser/Library/Android/sdk
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------