File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
visionSamples/FaceTracker/app/src/androidTest Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 1
1
package dlib .android ;
2
2
3
+ import android .content .Context ;
4
+ import android .graphics .Bitmap ;
5
+ import android .graphics .BitmapFactory ;
6
+ import android .support .test .InstrumentationRegistry ;
7
+
3
8
import org .junit .Test ;
4
9
5
- import static junit .framework .Assert .assertEquals ;
10
+ import java .io .IOException ;
11
+ import java .io .InputStream ;
6
12
7
13
public class FaceRecognizerTest {
14
+ private static final String TAG = "FaceRecognizerTest" ;
15
+
8
16
@ Test
9
- public void RecognizeTest () {
17
+ public void RecognizeTest () throws IOException {
10
18
FaceRecognizer fr = new FaceRecognizer ();
11
19
fr .loadNative ();
12
- // String res = fr.recognize();
20
+ Context testContext = InstrumentationRegistry .getInstrumentation ().getContext ();
21
+ InputStream testInput = testContext .getAssets ().open ("1.png" );
22
+ Bitmap bitmap = BitmapFactory .decodeStream (testInput );
23
+ // Log.i(TAG, String.format("test1: %d", bitmap.getAllocationByteCount()));
24
+ // String res = fr.recognizeNative1(bitmap);
13
25
// assertEquals("Unknown", res);
14
26
}
15
27
}
You can’t perform that action at this time.
0 commit comments