[android] Fix YUV camera image to tensor (#50871)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/50871
Issue: https://discuss.pytorch.org/t/trouble-with-yuv420-to-float-tensor-conversion/106721/3
Decoding was wrong and the result image had artifacts.
Testing:
Patch test_app with:
[input_tensor_to_bitmap.txt](https://github.com/pytorch/pytorch/files/5847553/input_tensor_to_bitmap.txt)
gradle -p android test_app:installMnetLocalCameraDebug -PABI_FILTERS=arm64-v8a
Before fix:
![before_yuv_fix](https://user-images.githubusercontent.com/6638825/105317604-63a35980-5b90-11eb-9609-2ed5818130bd.png)
After fix:
![after_yuv_fix](https://user-images.githubusercontent.com/6638825/105317643-70c04880-5b90-11eb-88b7-92dd90db8ed2.png)
Test Plan: Imported from OSS
Reviewed By: fmassa
Differential Revision: D25992519
Pulled By: IvanKobzarev
fbshipit-source-id: 4a46ed39c1cd70f8987fcc1023520e9659ae5d59