Skip to content

Commit

Permalink
Merge pull request #19 from sirlaurie/master
Browse files Browse the repository at this point in the history
auto resize image
  • Loading branch information
eldhoabraham authored Nov 23, 2021
2 parents 2061fb2 + 0090f83 commit b539cdb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/createTrainingData.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ def augmentAndTrasformImage(f, mainFolder, trainFolder):
except:
print('Error: Couldnt read the file {}. Make sure only images are present in the folder'.format(f))
return None

w, h = img.size
if h > w:
img = img.resize((750, 1000))
else:
img = img.resize((1000, 750))

imgGray = img.convert('L')
wdChk, htChk = imgGray.size
Expand Down
2 changes: 1 addition & 1 deletion src/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def main(args):
negativeImagePath = (args.negativeTestImages)

os.system("python createTrainingData.py {} {} {}".format(positiveImagePath, negativeImagePath, 1))
X_LL, X_LH, X_HL, X_HH, X_index, Y, imageCount = readWaveletData(positiveImagePath, negativeImagePath, positiveTestImagePath, positiveTestImagePath)
X_LL, X_LH, X_HL, X_HH, X_index, Y, imageCount = readWaveletData(positiveImagePath, negativeImagePath, positiveTestImagePath, negativeTestImagePath)

X_LL = np.array(X_LL)
X_LL = X_LL.reshape((imageCount, height, width, depth))
Expand Down

0 comments on commit b539cdb

Please sign in to comment.