自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(22)
  • 收藏
  • 关注

转载 Android Activity生命周期

参考文献:https://developer.android.com/reference/android/app/Activity.html

2017-09-21 17:18:35 214

原创 在Android设备上配置TensorFlow(四)无法使用TensorFlow训练新model

在安卓平台上,现有的TensorFlow只支持加载已经训练好的model,并进行预测。搜集了好多资料,也并没有类似的文章,为了解决这一问题,我们依次尝试以下这几种手段:        1. 使用Java语言的深度学习神经网络框架deeplearning4j。        2. 改编TensorFlow,用JNI进行新的封装,使它可以用java进行训练。        3. 尝试在Ja

2017-09-20 18:05:44 468 1

原创 在Android设备上配置TensorFlow(三)解读ClassifierActivity源代码

在进行下一步环境配置之前,我们先阅读以下前两篇博文提到的物体识别classifier的应用的源代码,了解TensorFlow的工作流程。我们不讨论有关视频图片获取、结果显示等内容,只关注TensorFlow的应用。加载已经训练好的model和label,private static final String MODEL_FILE = "file:///android_asset/t

2017-09-19 19:32:03 880

原创 在Android设备上配置TensorFlow(二)使用Android Studio调用TF

根据官方文档的介绍,最简单的修改,编译并且运行演示应用的方式是通过Android Studio。虽然官方文档强调通过源码编译中涉及到的Bazel组件并不支持windows, 但是为了便于操作,除非涉及到通过源码编译,我们依然使用windows进行操作。在本文中,我们使用Android Studio打开样例工程。首先用Git Clone整个项目:git clone --recurse-sub

2017-09-19 17:14:08 2055

原创 在Android设备上配置TensorFlow(一)运行展示应用

随着iPhone X对于3D人脸识别的全面支持,深度学习在移动端的应用成为一个备受关注的重要课题。传统的把数据全部上传到服务器进行深度学习分析的方式需要大量的数据传输,并且要求稳定的网络环境,限制了这一技术的推广和应用。随着手机厂商对于“人工智能芯片”的投入,在移动终端上进行深度学习也成为未来的发展方向。笔者查阅并实践了在Android设备上配置TensorFlow的相关资料,简明扼要地整理成本文

2017-09-19 14:39:06 1129 1

原创 JNI - AttachCurrentThread

•The JNI interface pointer(JNIEnv) isvalid only in the current thread.•Should another thread need to access theJava VM, it must first call AttachCurrentThread() toattach itself to the VM and obt

2016-06-13 06:10:06 1513 1

转载 SQL复习笔记2

1. select count(*) from accountSame as: selectcount(branch-name) from accountDifferent from: selectcount(distinct branch-name) from accountBecause branch-name is not a key in account

2016-05-24 16:29:44 263

原创 JNI - Prevent JVM from crashing on Error Signals

In the previous article, Divide by Zero. A comparison between Java and C, we concluded that C++ programs will crash when it meets a DivideByZero Exception. Even with a handler, it will crash anyway.

2016-05-22 01:47:40 904

原创 JNI - Process ID

Conclustion: Java and C++ are in the same process.

2016-05-20 18:58:02 359

原创 JNI - Divide by Zero. A comparison between Java and C(1)

A comparison of DivideByZero(c++ and Java)

2016-05-19 17:00:55 499

原创 JNI - Exception Handling

.java file:class CatchThrow{ private native void doit() throws IllegalArgumentException; private void callback() throws NullPointerException{ throw new NullPointerException("CathThrow.callback

2016-04-20 16:01:20 355

原创 JNI - Caching IDs

Method 1. Caching at the Point of Usestatic jmethodID cid = NULL;if (cid == NULL){ cid = (*env)->GetMethodID(env,stringClass,"","([C)V"); if (cid == NULL){ return NULL; }}Method 2

2016-04-18 19:51:17 231

原创 JNI - Static method. Method of SuperClass.

Call static method.jclass cls = *(env)->GetObjectClass(env,obj);jmethodID mid = (*env)->GetStaticMethodID(env, cls, "callback", "()V";(*env)->CallStaticVoidMethod(env, cls, mid);Attention:

2016-04-10 00:21:15 304

原创 JNI - Method Signature.

Command line :javap -s -p Method_Call_NameJava method:class MethodDescriptor { MethodDescriptor(); private native java.lang.String getLine(java.lang.String); private native int GetLine(i

2016-04-09 22:12:06 770

原创 JNI - Call Method(Callback Call java methods from c)

.c file#include #include #include "InstanceMethodCall.h"JNIEXPORT void JNICALL Java_InstanceMethodCall_nativeMethod (JNIEnv *env, jobject obj){ jclass cls = (*env)->GetObjectClass(env,obj);

2016-04-09 21:14:42 1269 1

原创 JNI - Field Descriptors.

class FieldDescriptors{ int intvalue; double doublevalue; float floatvalue; String stringvalue = new String(); int intarrayvalue[] = new int[5]; MyClass myclassvalue = new MyClass();}How

2016-04-09 17:06:14 1411

原创 JNI - Access static field

class StaticFieldAccess{ private static int si; private native void accessField(); public static void main(String args[]){ StaticFieldAccess c = new StaticFieldAccess(); StaticFieldAccess.si =

2016-04-09 17:02:54 409

原创 JNI - Access an instance Field

.java File:class InstanceFieldAccess{ private String s; private native void accessField(); public static void main(String args[]){ InstanceFieldAccess c = new InstanceFieldAccess(); c.s =

2016-04-09 16:17:45 453

原创 JNI - PASS ARGUMENT. ObjectARRAY

.java fileclass ObjectArrayTest{ private static native int[][] initInt2DArray(int size); public static void main(String[] args){ int[][] i2arr = initInt2DArray(3); for (int i=0;i<3;i++){ fo

2016-04-08 19:31:20 340

原创 JNI - PASS ARGUMENT. array

.java fileclass IntArray{ private native int sumArray(int arr[]); public static void main(String[] args){ IntArray p = new IntArray(); int arr[] = new int[10]; for ( int i=0; i<10;i++) ar

2016-04-08 19:22:53 301

原创 JNI - PASS ARGUMENT. string

.c file:#include #include #include #include #include "Prompt.h"JNIEXPORT jstring JNICALL Java_Prompt_getLine (JNIEnv *env, jobject this, jstring prompt){ char buf[128]; const jbyte *str;

2016-04-08 19:05:07 426

原创 JNI - Getting Started

开始第一个JNI程序

2016-04-07 17:26:33 222

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除