Impact of different image loading and resizing libraries in TensorFlow inference output and comparison with corresponding android results(part 1)

  • Use different libraries to load and resize images inside colab notebook, do inference with the same .tflite file.
  • Compare results and find the optimum method.
I/RESULT: [0.0017617701, 1.964645E-5, 1.8741742E-4, 1.0189252E-4, 7.009291E-5, 9.940497E-4, 0.14571801, 0.85106224, 8.326311E-5, 1.5728457E-6]
I/RESULT: [0.0017617701, 1.964645E-5, 1.8741742E-4, 1.0189252E-4, 7.009291E-5, 9.940497E-4, 0.14571801, 0.85106224, 8.326311E-5, 1.5728457E-6]
[[1.7165932e-03 5.4474713e-05 2.5516949e-04 1.8444049e-04 5.7022298e-05   2.6554947e-03 8.3325535e-01 1.6157104e-01 2.4710680e-04 3.3399576e-06]]
[[1.2340680e-03 1.9341662e-05 1.5484141e-04 8.8167602e-05 5.2695308e-05   9.2836347e-04 1.5790647e-01 8.3954442e-01 7.0430971e-05 1.2166572e-06]]
[[1.7165932e-03 5.4474713e-05 2.5516949e-04 1.8444049e-04 5.7022298e-05   2.6554947e-03 8.3325535e-01 1.6157104e-01 2.4710680e-04 3.3399576e-06]]
[[205 203 201]
[205 202 201]
[204 202 200]
[203 202 200]
[203 202 200]
[203 202 200]
[203 201 198]
[202 201 198]
[201 202 198]
[202 202 199]]
[[202 201 199] 
[204 201 200]
[202 201 199]
[204 203 201]
[203 203 201]
[203 202 200]
[201 198 195]
[199 199 194]
[199 200 196]
[200 200 197]]
[[201 200 198] 
[201 200 198]
[200 200 198]
[202 202 200]
[201 202 199]
[202 202 200]
[199 198 193]
[198 199 193]
[198 199 194]
[199 200 195]]
[[1.7620893e-03 1.9610761e-05 1.8804680e-04 1.0167842e-04 6.9446462e-05   9.9966815e-04 1.4880715e-01 8.4796780e-01 8.2977458e-05 1.5546660e-06]]
[[201. 200. 198.] 
[201. 200. 198.]
[200. 200. 198.]
[202. 202. 200.]
[201. 202. 199.]
[202. 202. 200.]
[199. 198. 193.]
[198. 199. 193.]
[198. 199. 194.]
[199. 200. 195.]]

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store