Repository navigation
Conversation
|
Can one of the admins verify this patch? |
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
I signed it! |
|
CLAs look good, thanks! |
|
@andrewharp could you take a look? Thanks! |
andrewharp
left a comment
There was a problem hiding this comment.
Thank you for doing this!
A couple of high-level comments before a full review:
-
CameraActivity.java should probably handle any references to android.hardware.Camera or android.hardware.camera2, and the CameraActivity class implementations should just implement a method that takes a byte[] for each plane. This will keep the actual demo classes from all having parallel implementations of the adapter code.
-
I've added functionality for choosing hard-coded preferred preview sizes internally available to help address #7464, and that should be getting pushed soon, so this this will PR will have to account for that on the android.hardware.Camera side as well.
|
I agree that I have made the demo a bit more complicated and that should be avoided. |
|
Please also notice that I have hard-coded rotation to be 90 in the legacy camera API, and I don't know how to set it properly. |
|
@BrianOn99 Could you pull rebase and push again? |
|
@drpngx @BrianOn99 The demo currently assumes a 90 degree rotation, so I don't see an issue with this, unless I'm misunderstanding something. It should be something we can leave a TODO for and fix for both implementations at a later time. |
|
@drpngx So do I need to |
|
Did you rebase from upstream/master? I think it's usually fine to push force in that case. But do save the SHA1s in case you need to go back to them. |
|
During rebase I get this error: I cannot find such a build issue from the internet. Even a fresh clone and build from master give this issue, while building from my old branch still works. Any one has idea? |
|
I am building in this environment: |
|
git bisect tells me the offending commit is 8d393ea. Looks like due to the changes in |
|
@jart any idea what might be happening here? @BrianOn99 please rebase and push again when you get a chance. |
|
Is the program |
|
@jart yes |
|
@jart It is installed from the package manager as far as I can remember. I will verify it tonight. |
|
You are right patch is not installed :-P. Never thought of this stupid mistake. Now it has been rebased. Again, I have not tested it on Android6+ devices. |
|
Jenkins, test this please. |
|
It does not appear to build |
|
Pushed again and should be OK now. |
|
We probably don't want any references to android.hardware.Camera or android.hardware.Camera2 in the Activity classes, apart from CameraActivity. Right now there are 3 methods in each activity for handling incoming frames -- I think we can reduce that to 1 if possible and let CameraActivity itself handle supporting the different camera hardwares. |
|
ping for @BrianOn99 for next steps! |
|
@andrewharp @vrv The main reason for this quite messy implementation is:
|
|
@BrianOn99 I suppose you could modify the method prototype to also take in an optional luminance plane. I think that would be better than having Camera references and duplicate processing code creeping into the actual Activity implementations. Regarding camera.addCallbackBuffer(bytes) perhaps just have two buffers and return the old one when you get the new one. |
|
ping for @BrianOn99 ! |
|
Can one of the admins verify this patch? |
|
@BrianOn99 any update on this? |
|
@rmlarsen I don’t yet have time to improve the code. You are welcome to fix it. |
|
Hello, I am working refactoring the android demo to work with the camera api1 but I am having troubles with the tracker detector(DetectorActivity.java around line 250) that object requires a rowStride wich is provided by the camera api 2 Image object, but the camera api1 just provides a simple byte[] |
|
@osdamv You should be able to assume that width == stride when using the camera 1 api. This is always the case afaik. |
|
@osdamv any luck with this? |
|
@drpngx I can't make work the detector demo with the legacy api, however the another examples work fine . |
|
@osdamv The object detector demo is able to work without tracking support (it does this when it can't find the native libraries), so if you want, just disable tracking when in fallback mode and I can fix that functionality later. |
|
@andrewharp Is there any format needed for the commit message? |
|
@osdamv For individual commits? Not really, just a blurb about what code changed. The overall PR description is what gets mentioned in the changelog. |
|
@osdamv has done some great work with that pull request but the detector demo is still problematic. Not sure whether this issue is fully resolved. Although @andrewharp said he would try and find some time to fix the misbehaving code. I guess the detector issue could be continued on #10348 perhaps? |
* Fallback to legacy camera API for problematic devices * Refactor and implementation of the camera API 1 * Refactor and implementation of the camera API 1, it fixes #8736 * Fix some corrections of @andrewharp * Some fixes for @andrewharp * fix a missing line * Some more sanity fixes * Optimization for the calculation of the preview size, Also, add validation to check if we already choose the preview size * Fixed some lines that were over 100 characters * Update CameraActivity.java fixed indentations * Update ClassifierActivity.java Fixed indentations * Update StylizeActivity.java Fixed indentations. * Update StylizeActivity.java fix spaces * Update StylizeActivity.java Fix indentation.
END_PUBLIC I dropped the following commit because it doesn't compile. I will follow up with Andrew to fix it or revert it. Commit 003deb8 authored by osdamv<[email protected]> Committed by Vijay Vasudevan<[email protected]>: Refactor and implementation of the camera API 1, it fixes tensorflow#8736 (tensorflow#10771) List of commits in this CL: --- Commit 4464503 authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Use identity of param variable in cudnn_rnn.RNNParamsSaveable instead of parameter variable directly. The RNNParamsSaveable is usually used in a graph which also has a saver for the cudnn param variable itself, if the same op is used for both, fails with a two savers for same op error. PiperOrigin-RevId: 163431826 --- Commit d629a83 authored by RJ Ryan<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Increase bound on tf.contrib.signal.inverse_stft gradient error to avoid flakiness on macOS. PiperOrigin-RevId: 163426631 --- Commit 253bcbb authored by Kay Zhu<[email protected]> Committed by TensorFlower Gardener<[email protected]>: [XLA] Use HloEvaluator for convolution in reference_util. Also Speed up HloEvaluator's HandleConvolution in non-opt build, by moving calls to HloInstruction::shape() out of the inner loop. PiperOrigin-RevId: 163416183 --- Commit 569a00e authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Update API to traffic in unique_ptrs rather than owning raw pointers PiperOrigin-RevId: 163414320 --- Commit 31a77bc authored by Asim Shankar<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Java: Update release to 1.3.0-rc1 PiperOrigin-RevId: 163413736 --- Commit 1ebbf43 authored by Jonathan Hseu<[email protected]> Committed by GitHub<[email protected]>: Add missing grpc dependency (tensorflow#11828) --- Commit 905abb1 authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Test asserts should have `expected` first. PiperOrigin-RevId: 163409348 --- Commit d5cc143 authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Increase timeout to deflake the test. PiperOrigin-RevId: 163407824 --- Commit ce1c7f0 authored by Eli Bendersky<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Properly include logging header in xla_internal_test_main PiperOrigin-RevId: 163405986 --- Commit 22241cd authored by joetoth<[email protected]> Committed by Vijay Vasudevan<[email protected]>: External leveldb link changed (tensorflow#11833) table_format.txt was renamed to table_format.md --- Commit 6b7314d authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Consolidating the code to fill the partition's function library into one place. Previously, Partition() and MasterSession::RegisterPartition() both fills in the partitioned graph's function library. PiperOrigin-RevId: 163400992 --- Commit 28373cf authored by Frank Chen<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Adds preliminary support for Cloud TPUs with Cluster Resolvers. This aims to allow users to have a better experienec when specifying one or multiple Cloud TPUs for their training jobs by allowing users to use names rather than IP addresses. PiperOrigin-RevId: 163393443 --- Commit e5353c9 authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Don't prune nodes that have reference inputs. PiperOrigin-RevId: 163390862 --- Commit 2265108 authored by Asim Shankar<[email protected]> Committed by TensorFlower Gardener<[email protected]>: C API: Groundwork for experimenting with TF_Tensor in device memory. TF_Tensor objects are always backed by host memory. This commit lays the groundwork for allowing TF_Tensor objects to refer to tensor data on device (e.g., GPU) memory. PiperOrigin-RevId: 163388079 --- Commit 613bf1c authored by Yuefeng Zhou<[email protected]> Committed by TensorFlower Gardener<[email protected]>: fix asan test failure in SingleMachineTest::ReleaseMemoryAfterDestruction. PiperOrigin-RevId: 163386941 --- Commit 4653d37 authored by Eli Bendersky<[email protected]> Committed by TensorFlower Gardener<[email protected]>: [XLA] Change type to appease GPU builds. PiperOrigin-RevId: 163384927 --- Commit 9f131bd authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Internal change PiperOrigin-RevId: 163378484 --- Commit 8bc0236 authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: PiperOrigin-RevId: 163366493 --- Commit 3b97f1f authored by Yangzihao Wang<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Change to only run one round of matmul benchmark. PiperOrigin-RevId: 163364341 --- Commit a4a3a33 authored by Yun Peng<[email protected]> Committed by Vijay Vasudevan<[email protected]>: Fix ./configure on Windows (tensorflow#11775) * Fix ./configure on Windows * Disable bitwise_ops_test on Windows --- Commit ae3119d authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Small changes to op framework. PiperOrigin-RevId: 163361071 --- Commit f40189d authored by qjivy<[email protected]> Committed by Vijay Vasudevan<[email protected]>: PR again: Enable building label_image with jpeg/gif/png decoder for Android. (tensorflow#11475) * Enable building label_image with jpeg/gif/png decoder for Android. Add dependency "android_tesnorflow_image_op" to label_image, which is not overlapped with android_tensorflow_kernels. * Running buildifier to reformat the BUILD files for sanity check. --- Commit 5991658 authored by KB Sriram<[email protected]> Committed by Vijay Vasudevan<[email protected]>: Add the Constant operator class (tensorflow#11559) Create a custom operator class to create constants in the Graph, and introduce the Operator marker annotation to identify operator classes. Please see tensorflow#7149 for the master tracking issue. --- Commit 86ca350 authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Further BUILD cleanup PiperOrigin-RevId: 163360750 --- Commit 376bb06 authored by Pete Warden<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Look inside functions to see which node types are used. PiperOrigin-RevId: 163360375 --- Commit 2139e7d authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: [tf.contrib.data] map expects a nested structure. Fixes tensorflow#11786 PiperOrigin-RevId: 163359134 --- Commit d09304f authored by Jonathan Hseu<[email protected]> Committed by Vijay Vasudevan<[email protected]>: Upgrade gRPC (tensorflow#11768) * BUILD rule modifications * More build fixes * Code changes * More code fixes * Working tests * CMake build * Fix pprof * Fix header includes * CMake fix test * Bazel clean * Fix verbs * More verbs fixes * bazel clean for XLA * Windows build fix test * Add openssl/rand.h * New cmake build command * --config Release --- Commit 3cd8284 authored by David Norman<[email protected]> Committed by Vijay Vasudevan<[email protected]>: Fix error with default python path selection (tensorflow#11814) * Fix error with default python path selection * Move setting of environment var outside if / else --- Commit ddd8e21 authored by Eli Bendersky<[email protected]> Committed by TensorFlower Gardener<[email protected]>: [XLA] Consolidate all similar main()s in tests into a single target. PiperOrigin-RevId: 163354724 --- Commit a36bca2 authored by Tayo Oguntebi<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Remove ShapeWithoutPadding() utility function, as it is no longer needed. PiperOrigin-RevId: 163353430 --- Commit b26f9cd authored by David Norman<[email protected]> Committed by Vijay Vasudevan<[email protected]>: Ensure that the multi-instruction fuse can take shared inputs (tensorflow#11748) * Ensure that the multi-instruction fuse can take shared inputs Note that the fuse action only works when the shared input / constant appears after all of its consumers in the list of instructions. * Add a comment describing the test --- Commit 34cbf16 authored by Jiri Simsa<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Update Dataset API documentation. PiperOrigin-RevId: 163349457 --- Commit 2381ce5 authored by Abdullah Alrasheed<[email protected]> Committed by Vijay Vasudevan<[email protected]>: DOC: Fix typo. (tensorflow#11813) you could could be I/O bottlenecked. TO: you could be I/O bottlenecked. --- Commit e4a5c53 authored by Toby Boyd<[email protected]> Committed by TensorFlower Gardener<[email protected]>: ["Variable", "VariableV2", "VarHandleOp"] is the default for ps_ops=None PiperOrigin-RevId: 163344629 --- Commit 722f6f3 authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Fix TensorForest's saveable object names so loading a savedmodel works. PiperOrigin-RevId: 163332598 --- Commit cda80a7 authored by Eric Liu<[email protected]> Committed by TensorFlower Gardener<[email protected]>: [tpu profiler] Dump HLO graphs in profile responses to the log directory. PiperOrigin-RevId: 163318992 --- Commit cea9ef6 authored by horance<[email protected]> Committed by Vijay Vasudevan<[email protected]>: Refactoring device name utils (tensorflow#11797) * remove duplicated code for full_name and legacy_name for DeviceNameUtils * replace tabs * Real->Device --- Commit 1f7c0f9 authored by Kongsea<[email protected]> Committed by Vijay Vasudevan<[email protected]>: Refine docstrings (tensorflow#11800) --- Commit dd1f0cd authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Supports lookup devices by fullname either in the canonical form or the legacy form. This makes DeviceSet behaves the same as DeviceMgr's FindDevice method. PiperOrigin-RevId: 163300346 --- Commit 631a364 authored by Kay Zhu<[email protected]> Committed by TensorFlower Gardener<[email protected]>: [XLA] Add Reduce, DynamicSlice and DynamicSliceUpdate to HloEvaluator. - Reduce is disabled explicitly for constant folding, as not all types of embedded computation can be currently supported by the evaluator. - Added support to evaluate HloModule to HloEvaluator. - Minor signature change to Evaluate(). PiperOrigin-RevId: 163299238 --- Commit a524701 authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Sets the incarnation number even when the attribute is set. PiperOrigin-RevId: 163299121 --- Commit a49fe03 authored by Suharsh Sivakumar<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Remove platform bridge for grpc_response_reader. PiperOrigin-RevId: 163295986 --- Commit 4404aa7 authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: [XLA] Add TODO comment explaining why the IsScalar check exists. PiperOrigin-RevId: 163292777 --- Commit 43036ac authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Remove unnecessary break statements. PiperOrigin-RevId: 163291947 --- Commit fd5de46 authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: [XLA] Add regression test for a corner case using Reduce that currently fails with the GPU backend. PiperOrigin-RevId: 163287986 --- Commit 32e198f authored by Chris Leary<[email protected]> Committed by TensorFlower Gardener<[email protected]>: [TF:XLA] Add tf.cross support. See tensorflow#11788 PiperOrigin-RevId: 163287731 --- Commit 88abddb authored by Alan Yee<[email protected]> Committed by Vijay Vasudevan<[email protected]>: Update README.md (tensorflow#11793) Remove bad practices of sudo pip and install use safer pip install commands --- Commit 9b30dc3 authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Remove final mentions of `get_shape` in docstring. PiperOrigin-RevId: 163282839 --- Commit 423c1ee authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: BREAKING CHANGE: Fix semantic error in how maybe_batch* handles sparse tensors. PiperOrigin-RevId: 163276613 --- Commit 6028c07 authored by Justin Lebar<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Highlight incoming/outgoing edges on hover in HLO graphviz dumps, and other improvements. Other improvements: - Don't show tooltips for nodes and clusters. Previously we'd show a tooltip containing a pointer value expressed as decimal. Not so useful. - Show tooltips on edges with the to/from node names. - Fix bug wherein if we had - a node at the "edge" of the graph (so its operands aren't included unless they're referenced by another node), - with all of its operands included in the graph save one or more constants, and - those constants weren't referenced by any nodes not at the edge of the graph, we would incorrectly draw the node as "grayed out", indicating that one of its operands (namely, its constant operand) wasn't present in the graph. This is wrong because constants are inlined into their users, so they should always count as "displayed" for the purposes of determining whether a node is grayed out. PiperOrigin-RevId: 163276108 --- Commit ce7a355 authored by Joshua V. Dillon<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Update contrib/distributions/estimator_test build dependency. PiperOrigin-RevId: 163272464 --- Commit 1b8458a authored by A. Unique TensorFlower<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Shorten docstring line. PiperOrigin-RevId: 163269709 --- Commit 69e323c authored by Asim Shankar<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Fix comment ypo PiperOrigin-RevId: 163266376 --- Commit 08790e7 authored by Chris Leary<[email protected]> Committed by TensorFlower Gardener<[email protected]>: [XLA] Fix a bug in cloning outfeeds, carried the wrong shape. PiperOrigin-RevId: 163265592 --- Commit 1bad826 authored by Yangzihao Wang<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Rollback of GPU kernel implementation of transpose for tensors with one small dimension. END_PUBLIC BEGIN_PUBLIC BEGIN_PUBLIC Automated g4 rollback of changelist 162525519 PiperOrigin-RevId: 163490703
Fix #8550

The camera 2 API is problematic in some devices. Similar problem is also dicussed in #7464 . One of the problem is shown here on a LG G4c device:
A space inversion is taken (left-right mirrored), and color turns green (which is reported also here https://code.google.com/p/android/issues/detail?id=81984). It effectively makes all 3 demo app not working or crashes.
This PR attempts to take legacy camera API as fallback, in case

INFO_SUPPORTED_HARDWARE_LEVELis lower than FULL. It is mostly a copy of the implementation here. Here is the working demo if fallback is taken:I would like to mention that I have no previous experience with the API, so the implementation may not be optimal. Also please check if the demo still works on Android6+ devices because I only have 2 android5 for testing. Please also notice that the "TF Detect" demo does not show red box on preview image, for which I cannot find out the cause.