回答編集履歴
1
回答例追記
answer
CHANGED
@@ -1,2 +1,18 @@
|
|
1
1
|
[https://docs.python.org/ja/3.7/library/shutil.html](https://docs.python.org/ja/3.7/library/shutil.html)
|
2
|
-
の、`shutil.move`
|
2
|
+
の、`shutil.move`
|
3
|
+
#追記
|
4
|
+
こういうことでは?最初のコードに2行追加。
|
5
|
+
```Python
|
6
|
+
def count_resol(directory):
|
7
|
+
print(directory)
|
8
|
+
files = glob.glob(directory)
|
9
|
+
d={}
|
10
|
+
for file in files:
|
11
|
+
width,height,channels = get_resolution(file)
|
12
|
+
info = str(width) + "," + str(height) + "," +str(channels)
|
13
|
+
d.setdefault(info,0)
|
14
|
+
d[info] += 1
|
15
|
+
if width==512 and height==496: # 追加
|
16
|
+
move('./train/NORMAL/' + file, './train_NORMAL_resize/') # 追加
|
17
|
+
print(d)
|
18
|
+
```
|