tensorflow: Android Demo DetectorActivity landscape orientation problem
I’m trying to change the orientation to landscape:
private static final Size DESIRED_PREVIEW_SIZE = new Size(1280, 720);
private static final boolean USE_YOLO = true
<activity android:name="org.tensorflow.demo.DetectorActivity"
android:screenOrientation="landscape"
android:label="@string/activity_name_detection">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
But it draws detected rects wrongly. How to fix it?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 27 (5 by maintainers)
Just pulled the latest demo, still cannott change to landscape mode by simply changing the screenOrientation in manifest.xml, and change to auto rotate didn`t work for me @prasanna532
Here`s my work around:
In DetectorActivity:
sensorOrientation = 0 - getScreenOrientation();//here change rotation to 0In MultiBoxTracker:
In env/BorderedText:
I’ve solved the landscape orientation problem thanks to @MICHAEL-ZENZ. However, the issue of 30% black rectangle @prasanna532 at the bottom stayed in both landscape and vertical orientations. Please, need help.
I solved this problem.
I have the same issue. Any luck till recently?
I’ve made a fix for this internally, should show up in the next push. You’ll still have to manually change the orientation of the Activity in AndroidManifest.xml, but everything else should just work afterwards.