Closed mesakarghm closed 3 years ago
Turns out, My locnet was predicting extreme higher values which was being clipped into the max_h, max_w in the interpolate function. I solved it using a sigmoid activation instead of relu in the locnet definition.
I tried incorporating your implementation of Spatial Transformer Network into my License Plate Recognition model. I put the STN layer immediately after the input layer but it just converts the complete image into plain black color.
I did change the keras function to tf.keras, is that what is causing the problem or something else? Any help would be highly appreciated.
Tensorflow Version -: 1.15.2
Here is my locnet definition:
Then I just add the STN layer after the input layer like:
Edit: I found out the problem, but don't really know how to fix this. In the interpolate function withing Spatial Transformer, while calculating area_a, area_b, area_c and area_d my values are setting up like: area_a = - area_b and area_c = - area_d. If anyone's got any idea why this is happening or how to fix this, it'd be really helpful.