我从Tensorflow for android运行了对象检测演示,我注意到var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
if (httpResponse.StatusCode == HttpStatusCode.OK) {
using (var streamReader = new StreamReader(httpResponse.GetResponseStream())) {
string result = streamReader.ReadToEnd();
ReturnedJSONModel objJSON = JsonConvert.DeserializeObject<ReturnedJSONModel>(result);
switch(objJSON.statusCode) {
case System.Net.HttpStatusCode.Accepted:
Console.WriteLine("Success : " + objJSON.reasonPhrase);
break;
case System.Net.HttpStatusCode.BadRequest:
Console.WriteLine("BadRequest : " + objJSON.reasonPhrase);
break;
case System.Net.HttpStatusCode.ServiceUnavailable:
Console.WriteLine("ServiceUnavailable : " + objJSON.reasonPhrase);
break;
default:
Console.WriteLine("Unknown error : " + objJSON.reasonPhrase);
break;
}
}
} else {
Console.WriteLine("Error StatusCode = " + httpResponse.StatusCode);
}
中的DESIRED_PREVIEW_SIZE
是静态的(640X480)并且不依赖于设备屏幕大小。当我用这些改变它时:
DetectorActivity
我注意到,通过更大的预览,当您移动手机时,检测速度变慢,预览有点滞后。问题是当我保持640x480分辨率并拍照时它会太小。这就是为什么我需要更大的预览尺寸。
有关如何以适合大屏幕手机的动态尺寸提高相机预览速度的建议吗?我想过仅在2帧中的1帧上应用检测来加速它,但显然它不会起作用,因为精度会下降...