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 11package dlib .android ;
22
3+ import android .content .Context ;
4+ import android .graphics .Bitmap ;
5+ import android .graphics .BitmapFactory ;
6+ import android .support .test .InstrumentationRegistry ;
7+
38import org .junit .Test ;
49
5- import static junit .framework .Assert .assertEquals ;
10+ import java .io .IOException ;
11+ import java .io .InputStream ;
612
713public class FaceRecognizerTest {
14+ private static final String TAG = "FaceRecognizerTest" ;
15+
816 @ Test
9- public void RecognizeTest () {
17+ public void RecognizeTest () throws IOException {
1018 FaceRecognizer fr = new FaceRecognizer ();
1119 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);
1325// assertEquals("Unknown", res);
1426 }
1527}
You can’t perform that action at this time.
0 commit comments