Skip to content

Commit e635971

Browse files
author
sayankotor
committed
last commit
1 parent 91f552f commit e635971

File tree

8 files changed

+1164
-711
lines changed

8 files changed

+1164
-711
lines changed

week03_convnets/load_images.py

Whitespace-only changes.

week03_convnets/seminar_pytorch-tiny_img.ipynb

Lines changed: 547 additions & 579 deletions
Large diffs are not rendered by default.

week03_convnets/seminar_pytorch.ipynb

Lines changed: 614 additions & 130 deletions
Large diffs are not rendered by default.

week03_convnets/tiniim.png

57.6 KB
Loading

week03_convnets/tiny_img.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ def download_tinyImg200(path,
3535
from PIL import Image
3636

3737
def read_folder(folder_path):
38+
print (folder_path)
3839
list_of_pics = [Image.open(os.path.join(folder_path, filename)).getdata() for filename in os.listdir(folder_path) if np.array(Image.open(os.path.join(folder_path, filename)).getdata()).shape == (4096, 3)]
39-
return np.array(list_of_pics).reshape(np.array(list_of_pics).shape[0], 64, 64, 3)
40+
return np.array(list_of_pics).reshape(np.array(list_of_pics).shape[0], 3, 64, 64)
4041

4142
def load_tiny_image(data_path=".", channels_last=False, test_size=0.3, random_state=1337):
4243
data_path = '.'
@@ -53,7 +54,7 @@ def load_tiny_image(data_path=".", channels_last=False, test_size=0.3, random_st
5354

5455

5556
X_list = [read_folder(path) for path in data_paths]
56-
X = np.concatenate(X_list).reshape([-1,64,64,3]).astype('float32')/255
57+
X = np.concatenate(X_list).reshape([-1,3,64,64]).astype('float32')/255
5758
y_list = []
5859

5960
for class_label in np.arange(len(data_paths)):

week03_convnets/tinyim2.png

51.1 KB
Loading

week03_convnets/tinyim3.png

43.5 KB
Loading

week03_convnets/tinyimg4.png

51.1 KB
Loading

0 commit comments

Comments
 (0)