Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename variables load_hoda() #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ def load_hoda(training_sample_size=1000, test_sample_size=200, size=5):
y_train = np.squeeze(dataset['labels'][:trs])
X_test_original = np.squeeze(dataset['Data'][trs:trs+tes])
y_test = np.squeeze(dataset['labels'][trs:trs+tes])

#resize
X_train_5by5 = [cv2.resize(img, dsize=(size, size)) for img in X_train_orginal]
X_test_5by_5 = [cv2.resize(img, dsize=(size, size)) for img in X_test_original]
X_train_size_by_size = [cv2.resize(img, dsize=(size, size)) for img in X_train_orginal]
X_test_size_by_size = [cv2.resize(img, dsize=(size, size)) for img in X_test_original]
#reshape
X_train = np.reshape(X_train_5by5, [-1,size**2])
X_test = np.reshape(X_test_5by_5, [-1,size**2])
X_train = np.reshape(X_train_size_by_size, [-1,size**2])
X_test = np.reshape(X_test_size_by_size, [-1,size**2])

return X_train, y_train, X_test, y_test
return X_train, y_train, X_test, y_test