i tried using the Spatial Transformer layer from https://github.com/johnwangMK/spatial_transformer_networks/blob/master/src/spatial_transformer.py (edited num_channels in line 137 inside def_transform from tf.shape(input_shape)[3] to 3 in my code) in my License Plate Recognition project. But the model didn't converge, I returned output of STN with the model outputs and it is plain black, nothing else.
`
This is my locnet function and I call the STN as:
self.input_shape = 48,188,3
def _build(self):
inputs = Input(self.input_shape)
stn = SpatialTransformer(localization_net=self.locnet(),
output_size=(24,94))(inputs)
followed by licence plate recognition model which works well
After using this, the model isn't converging and when I try to plot the output of stn as:
Not only that, the output of the license plate model is same for every image. So, I'm guessing this definitely is because of some mistake I'm making in the Spatial Transformer but I don't know what.
Tensorflow Version - 1.15.2
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.
i tried using the Spatial Transformer layer from https://github.com/johnwangMK/spatial_transformer_networks/blob/master/src/spatial_transformer.py (edited num_channels in line 137 inside def_transform from tf.shape(input_shape)[3] to 3 in my code) in my License Plate Recognition project. But the model didn't converge, I returned output of STN with the model outputs and it is plain black, nothing else.
` This is my locnet function and I call the STN as:
After using this, the model isn't converging and when I try to plot the output of stn as:
it just gives plain black color.
Not only that, the output of the license plate model is same for every image. So, I'm guessing this definitely is because of some mistake I'm making in the Spatial Transformer but I don't know what.
Tensorflow Version - 1.15.2
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.