将图片发布到API

时间:2016-04-14 10:55:12

标签: android face-recognition api-design

我想将我的图片(名称为file。)发布到Kairos API进行识别。我尝试发送内置摄像头JPG图片。我已经使用Postman测试了其中一张照片,服务可以成功处理这些图片。

        public void onClick(View v) {

            Bitmap image = BitmapFactory.decodeFile(file);
            String subjectId = user;
            String galleryId = "users";
            String selector = "FULL";
            String multipleFaces = "false";
            String minHeadScale = "0.25";
            try {
                myKairos.enroll(image,
                        subjectId,
                        galleryId,
                        selector,
                        multipleFaces,
                        minHeadScale,
                        listener);
            } catch (JSONException e) {
                e.printStackTrace();
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            }


           // dataCheck();
        }

我在logcat中得到以下内容:

  

04-14 12:46:42.323 12969-12969 / kovacsdev.hu.facec W / skia:JPEG HW   解码器成功返回!!       04-14 12:46:45.614 12969-12969 / kovacsdev.hu.facec I / dalvikvm-heap:将堆(frag case)增长到10.682MB,用于2092136字节分配       04-14 12:46:46.999 12969-12969 / kovacsdev.hu.facec I / dalvikvm-heap:对于2008711字节分配,将堆(frag case)增长到13.020MB       04-14 12:46:47.089 12969-12969 / kovacsdev.hu.facec I / dalvikvm-heap:将堆(frag case)增长到16.851MB,用于4017406字节分配       04-14 12:46:47.517 12969-12969 / kovacsdev.hu.facec I / dalvikvm-heap:将堆(frag case)增长到16.853MB,用于3352682字节分配       04-14 12:46:47.700 12969-12969 / kovacsdev.hu.facec I / dalvikvm-heap:将堆(frag case)增长到19.518MB,用于5029018字节分配       04-14 12:46:47.858 12969-12969 / kovacsdev.hu.facec I / dalvikvm-heap:将堆(frag case)增长到20.270MB,用于4141254字节分配       04-14 12:46:47.908 12969-12969 / kovacsdev.hu.facec W / AsyncHttpClient:传递的contentType将被忽略,因为   HttpEntity设置内容类型       04-14 12:46:47.935 12969-12969 / kovacsdev.hu.facec I / SurfaceTextureClient:[STC :: queueBuffer](this:0x51efc738)fps:0.17,   dur:5831.11,max:5831.11,min:5831.11       04-14 12:46:47.935 12969-12969 / kovacsdev.hu.facec I / SurfaceTextureClient:[STC :: queueBuffer] this:0x51efc738,api:1,   上次排队时间:5831.11       04-14 12:46:48.119 12969-13990 / kovacsdev.hu.facec I / System.out:propertyValue:true       04-14 12:46:48.120 12969-13990 / kovacsdev.hu.facec I / System.out:[socket] [0] connection /52.20.220.147:80;LocalPort=59844(10000)       04-14 12:46:48.120 12969-13990 / kovacsdev.hu.facec I / System.out:[CDS] connect [/52.20.220.147:80] tm:10       04-14 12:46:48.121 12969-13990 / kovacsdev.hu.facec I / System.out:[socket] [/ 192.168.199.102:59844]已连接       04-14 12:46:48.121 12969-13990 / kovacsdev.hu.facec I / System.out:[CDS] rx timeout:10000       04-14 12:46:48.121 12969-13990 / kovacsdev.hu.facec W / System.err:rto值太小:0       04-14 12:46:48.124 12969-13990 / kovacsdev.hu.facec I / System.out:> doSendRequest       04-14 12:46:48.236 12969-13990 / kovacsdev.hu.facec I / System.out:

0 个答案:

没有答案