Skip to content
Snippets Groups Projects
Commit ee32fe3c authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

I don't know why I'm commiting this. Suddenly everything was updated with nothing

parent 77c46255
No related branches found
No related tags found
1 merge request!19Updates
Pipeline #
Showing
with 20 additions and 7 deletions
.gitignore 100644 → 100755
File mode changed from 100644 to 100755
.gitlab-ci.yml 100644 → 100755
File mode changed from 100644 to 100755
LICENSE 100644 → 100755
File mode changed from 100644 to 100755
MANIFEST.in 100644 → 100755
File mode changed from 100644 to 100755
README.rst 100644 → 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
...@@ -191,10 +191,10 @@ class Base(object): ...@@ -191,10 +191,10 @@ class Base(object):
dst = numpy.reshape(dst, self.input_shape[1:4]) dst = numpy.reshape(dst, self.input_shape[1:4])
else: else:
#dst = numpy.resize(data, self.bob_shape) # Scaling with numpy, because bob is c,w,d instead of w,h,c #dst = numpy.resize(data, self.bob_shape) # Scaling with numpy, because bob is c,w,d instead of w,h,c
#dst = numpy.zeros(shape=(data.shape[0], data.shape[1], 3)) dst = numpy.zeros(shape=(data.shape[0], data.shape[1], 3))
#dst[:, :, 0] = data[:, :, 0] dst[:, :, 0] = data[:, :, 0]
#dst[:, :, 1] = data[:, :, 0] dst[:, :, 1] = data[:, :, 0]
#dst[:, :, 2] = data[:, :, 0] dst[:, :, 2] = data[:, :, 0]
# TODO: LAME SOLUTION # TODO: LAME SOLUTION
#if data.shape[0] != 3: # GRAY SCALE IMAGES IN A RGB DATABASE #if data.shape[0] != 3: # GRAY SCALE IMAGES IN A RGB DATABASE
...@@ -204,8 +204,8 @@ class Base(object): ...@@ -204,8 +204,8 @@ class Base(object):
#step_data[1, ...] = data[:, :, 0] #step_data[1, ...] = data[:, :, 0]
#step_data[2, ...] = data[:, :, 0] #step_data[2, ...] = data[:, :, 0]
#data = step_data #data = step_data
dst = numpy.zeros(shape=(self.bob_shape)) #dst = numpy.zeros(shape=(self.bob_shape))
bob.ip.base.scale(data, dst) #bob.ip.base.scale(data, dst)
return dst return dst
else: else:
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
#!/usr/bin/env python #!/usr/bin/env python
# vim: set fileencoding=utf-8 : # vim: set fileencoding=utf-8 :
# @author: Tiago de Freitas Pereira <tiago.pereira@idiap.ch> # @author: Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
# @date: Mon 07 Nov 2016 09:39:36 CET
import numpy
class ScaleFactor(object): class ScaleFactor(object):
""" """
...@@ -40,3 +40,16 @@ class Linear(object): ...@@ -40,3 +40,16 @@ class Linear(object):
return x return x
class PerImageStandarization(object):
def __init__(self):
pass
def __call__(self, x):
mean = numpy.mean(x)
std = numpy.std(x)
return (x-mean)/max(std, 1/numpy.sqrt(numpy.prod(x.shape)))
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment