Fix landscape layout.
PiperOrigin-RevId: 195506194
This commit is contained in:
parent
f21beadedc
commit
939fc534a4
tensorflow/contrib/lite/java
demo/app/src/main/res
ovic
third_party
@ -13,51 +13,55 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#bb7700"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.example.android.tflitecamerademo.AutoFitTextureView
|
||||
android:id="@+id/texture"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight=".8"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight=".2"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/logoview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/logo"/>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textOff="@string/tflite"
|
||||
android:textOn="@string/nnapi"/>
|
||||
<NumberPicker
|
||||
android:id="@+id/np"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="47dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:visibility="visible"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:textStyle="bold"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#bb7700"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="100">
|
||||
android:paddingTop="20dp"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="20sp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="30"
|
||||
android:orientation="vertical">
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<com.example.android.tflitecamerademo.AutoFitTextureView
|
||||
android:id="@+id/texture"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="100" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/logoview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="100"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/logo" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="70"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingTop="20dp"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -15,45 +15,47 @@
|
||||
-->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="60">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/control"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_weight="60"
|
||||
android:background="#cc7700"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingStart="20dp">
|
||||
|
||||
</FrameLayout>
|
||||
android:layout_height="match_parent"
|
||||
android:background="#bb7700">
|
||||
|
||||
<com.example.android.tflitecamerademo.AutoFitTextureView
|
||||
android:id="@+id/texture"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentEnd="false"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true" />
|
||||
android:layout_alignParentTop="false"
|
||||
android:background="#bb7700"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="100">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/logoview2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="30"
|
||||
android:scaleType="fitStart"
|
||||
android:src="@drawable/logo" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="20"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_weight="30"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
@ -83,33 +85,4 @@
|
||||
android:layout_below="@+id/button"
|
||||
android:visibility="visible" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/control2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="135dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignTop="@+id/control"
|
||||
android:layout_marginLeft="300dp"
|
||||
android:layout_marginStart="300dp"
|
||||
android:background="@color/control_background">
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/button"
|
||||
android:textOff="@string/tflite"
|
||||
android:textOn="@string/nnapi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true" />
|
||||
|
||||
<NumberPicker
|
||||
android:id="@+id/np"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/button"
|
||||
android:visibility="visible" />
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -23,7 +23,7 @@ android_binary(
|
||||
deps = [
|
||||
"//tensorflow/contrib/lite/java:ovicbenchmarkerlib",
|
||||
"//tensorflow/contrib/lite/java:tensorflowlite",
|
||||
"//third_party/java/android/android_sdk_linux/extras/android/compatibility/v13",
|
||||
"//third_party/java/android/android_sdk_linux/extras/android/compatibility/v4",
|
||||
"@androidsdk//com.android.support:support-v13-25.2.0",
|
||||
"@androidsdk//com.android.support:support-v4-25.2.0",
|
||||
],
|
||||
)
|
||||
|
@ -45,17 +45,17 @@ public final class OvicClassifierTest {
|
||||
private ByteBuffer lowResTestImage = null;
|
||||
private OvicSingleImageResult testResult = null;
|
||||
private static final String LABELS_PATH =
|
||||
"third_party/tensorflow/contrib/lite/java/ovic/src/testdata/labels.txt";
|
||||
"tensorflow/contrib/lite/java/ovic/src/testdata/labels.txt";
|
||||
private static final String QUANTIZED_MODEL_PATH =
|
||||
"third_party/tensorflow/contrib/lite/java/ovic/src/testdata/quantized_model.lite";
|
||||
"external/tflite_ovic_testdata/quantized_model.lite";
|
||||
private static final String LOW_RES_MODEL_PATH =
|
||||
"third_party/tensorflow/contrib/lite/java/ovic/src/testdata/low_res_model.lite";
|
||||
"external/tflite_ovic_testdata/low_res_model.lite";
|
||||
private static final String FLOAT_MODEL_PATH =
|
||||
"third_party/tensorflow/contrib/lite/java/ovic/src/testdata/float_model.lite";
|
||||
"external/tflite_ovic_testdata/float_model.lite";
|
||||
private static final String TEST_IMAGE_PATH =
|
||||
"third_party/tensorflow/contrib/lite/java/ovic/src/testdata/test_image_224.jpg";
|
||||
"external/tflite_ovic_testdata/test_image_224.jpg";
|
||||
private static final String TEST_LOW_RES_IMAGE_PATH =
|
||||
"third_party/tensorflow/contrib/lite/java/ovic/src/testdata/test_image_128.jpg";
|
||||
"external/tflite_ovic_testdata/test_image_128.jpg";
|
||||
private static final int TEST_IMAGE_GROUNDTRUTH = 653; // "military uniform"
|
||||
|
||||
@Before
|
||||
|
@ -4,11 +4,11 @@ licenses(["notice"]) # Apache 2.0
|
||||
filegroup(
|
||||
name = "ovic_testdata",
|
||||
srcs = [
|
||||
"float_model.lite",
|
||||
"low_res_model.lite",
|
||||
"quantized_model.lite",
|
||||
"test_image_128.jpg",
|
||||
"test_image_224.jpg",
|
||||
"@tflite_ovic_testdata//:float_model.lite",
|
||||
"@tflite_ovic_testdata//:low_res_model.lite",
|
||||
"@tflite_ovic_testdata//:quantized_model.lite",
|
||||
"@tflite_ovic_testdata//:test_image_128.jpg",
|
||||
"@tflite_ovic_testdata//:test_image_224.jpg",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user