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
Branches
Tags
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):
dst = numpy.reshape(dst, self.input_shape[1:4])
else:
#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[:, :, 0] = data[:, :, 0]
#dst[:, :, 1] = data[:, :, 0]
#dst[:, :, 2] = data[:, :, 0]
dst = numpy.zeros(shape=(data.shape[0], data.shape[1], 3))
dst[:, :, 0] = data[:, :, 0]
dst[:, :, 1] = data[:, :, 0]
dst[:, :, 2] = data[:, :, 0]
# TODO: LAME SOLUTION
#if data.shape[0] != 3: # GRAY SCALE IMAGES IN A RGB DATABASE
......@@ -204,8 +204,8 @@ class Base(object):
#step_data[1, ...] = data[:, :, 0]
#step_data[2, ...] = data[:, :, 0]
#data = step_data
dst = numpy.zeros(shape=(self.bob_shape))
bob.ip.base.scale(data, dst)
#dst = numpy.zeros(shape=(self.bob_shape))
#bob.ip.base.scale(data, dst)
return dst
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
# vim: set fileencoding=utf-8 :
# @author: Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
# @date: Mon 07 Nov 2016 09:39:36 CET
import numpy
class ScaleFactor(object):
"""
......@@ -40,3 +40,16 @@ class Linear(object):
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