thonypythony commited on
Commit
8cdc32e
1 Parent(s): fe503fb

Now is better than never.

Browse files

Although never is often better than *right* now.

model4-128x128.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:beca2bc9c2b1d6c26a0a7ac6b63705f956c91fced9cfeae9f1987cc4ec1e0fd2
3
+ size 9866978
model4.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3704c47e519b04def1029168116a3ade40e9e380d0c8ea3e6b2d4c48765a292
3
+ size 9860322
nEUROwmIV.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
resize-and-rename-data.py ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import PIL
2
+ from PIL import Image
3
+ import os, sys
4
+ import time
5
+
6
+ Width = 64
7
+ Height = 64
8
+
9
+ # path = "wm/"
10
+ # color_mode = "L"
11
+
12
+ path = "cover/"
13
+ color_mode = "RGB"
14
+
15
+ def resize(path):
16
+ dirs = os.listdir(path)
17
+ print('before resize ', len(dirs))
18
+ for item in dirs:
19
+ try:
20
+ # print(item)
21
+ with Image.open(fr'{path}{item}') as im:
22
+ resized = im.convert(f'{color_mode}').resize((Width,Height))
23
+ resized.save(fr'{path}{item}')
24
+ time.sleep(0.0003)
25
+ # print(fr'for {item} have been done')
26
+ except PIL.UnidentifiedImageError:
27
+ print(fr"Confirmed: This image {path}{item} cannot be opened!")
28
+ # os.remove(f'{path}{item}')
29
+ except OSError:
30
+ im = Image.open(fr'{path}{item}').convert(f'{color_mode}').resize((Width,Height))
31
+ im.save(fr'{path}{item}')
32
+ print(fr"Chanched by hands for {path}{item}")
33
+ dirs = os.listdir(path)
34
+ print('after resize ', len(dirs))
35
+
36
+
37
+ resize(path)
38
+
39
+
40
+ def test_size(path):
41
+ dirs = os.listdir(path)
42
+ print('before test ', len(dirs))
43
+ for item in dirs:
44
+ try:
45
+ with Image.open(fr'{path}{item}') as im:
46
+ width, height = im.size
47
+ if (width == Width) and (height == Height):
48
+ pass
49
+ else:
50
+ print(fr'for {item} not true size')
51
+ time.sleep(0.0003)
52
+ except PIL.UnidentifiedImageError:
53
+ print(fr"Confirmed: This image {item} cannot be opened! We removed it")
54
+ os.remove(f'{path}{item}')
55
+ dirs = os.listdir(path)
56
+ print('after test ', len(dirs))
57
+
58
+
59
+ test_size(path)
60
+
61
+
62
+ def renameimg(path):
63
+ os.getcwd()
64
+ for i, filename in enumerate(os.listdir(path)):
65
+ try:
66
+ os.rename(path + filename, path + str(i) + ".jpg")
67
+ except FileExistsError:
68
+ pass
69
+
70
+ # renameimg(path)