![]() ![]() As of TF v2.3.1 it seems the pixel shifting has been fixed, but the interpolation is still quite different (e.g. You can find a short notebook here with my findings. See details here.,I just ran across this question and did some testing myself using an image similar to that used in the Hackernoon article. So be prepared to try different libraries based on your training results. When I run the following code using TensorFlow 2.0, the test passes, so it looks like moving to TF2.0 will provide you with an implementation of bilinear interpolation that matches the OpenCV implementation (and therefore addresses the issues raised in the Hackernoon article):,Well I tested tf.resize on a real image and I can't get the same image. I couldn't find anything on this in the TF 2.0 docs, so I have reproduced the example given in that article to test the bilinear interpolation in 2.0. So if I was going to anycodings_tensorflow resize an image in some data augmentation anycodings_tensorflow step, that this might really mess up the anycodings_tensorflow model training. Like can I use tf.keras anycodings_tensorflow augmentation functions instead to avoid anycodings_tensorflow these problems?,I was reading this blog post in Hackernoon anycodings_tensorflow about how Tensorflow's anycodings_tensorflow tf.image.resize_area() function is not anycodings_tensorflow reflection equivariant. See anycodings_tensorflow details here.,I was just wondering if these problems are anycodings_tensorflow still true and what the workaround is? Any anycodings_tensorflow changes in subsequent versions of anycodings_tensorflow tensorflow. So be anycodings_tensorflow prepared to try different libraries anycodings_tensorflow based on your training results. ,Well I tested tf.resize on a real image anycodings_tensorflow and I can't get the same image. I actually anycodings_tensorflow checked the article's comments section, and anycodings_tensorflow no one has mentioned that the problems were anycodings_tensorflow fixed. The article is from anycodings_tensorflow Jan 2018, so not that long ago. The author goes on to say that users should anycodings_tensorflow not use any of the tf.image.resize anycodings_tensorflow functions, because of potentially anycodings_tensorflow unpredictable behavior. Np.testing.assert_almost_equal(output_arr, expected_output, decimal = 2) Reproduce the OpenCV example from the article.We expect this to produce the following output: We start with an input array whose values are equivalent to their column indices:Īnd then resize this(holding the rows dimension constant in size, but increasing the column dimnesion to 12) to ![]() This appears to have been fixed in TF 2.0 and this test confirms that we get the results one would expect from a Output: https: ///tensorflow/1/resize-confusion/ ![]() ![]() Not reproduce the pixel - area - based approach adopted by OpenCV.The `align_corners`ĭefault due to some questionable legacy reasons but users were advised to set it to True in order to get a 'reasonable' x implementation of bilinear interpolation Def test_tf2_resample_upsample_matches_opencv_methodology():Īccording to the article below, the Tensorflow 1. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |