Hi,
I think there's an issue with the stretchVector function defined in preprocess_images.py:
def stretchVector(vec, lowerPercentile, upperPercentile):
minVal = np.percentile(vec, lowerPercentile)
maxVal = np.percentile(vec, upperPercentile)
vec[vec > maxVal] = maxVal
vec = vec - minVal
if (maxVal-minVal)>1.:
vec = vec / (maxVal - minVal)
return vec
The function as it's currently implemented doesn't cap the color channel value to be >= 0.0. And, in cases where vec contains values that are less than minVal, we'll have negative numbers in there. I encountered this issue with some of the images in the dataset.
This should be easy to fix by adding the following line after vec = vec - minVal:
Thanks!
Hi,
I think there's an issue with the
stretchVectorfunction defined inpreprocess_images.py:The function as it's currently implemented doesn't cap the color channel value to be
>= 0.0. And, in cases whereveccontains values that are less thanminVal, we'll have negative numbers in there. I encountered this issue with some of the images in the dataset.This should be easy to fix by adding the following line after
vec = vec - minVal:Thanks!