We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f348d0e commit 8256990Copy full SHA for 8256990
neuro/README.md
@@ -25,4 +25,19 @@ You can see two text inputs in central panel:
25
26
(in the example gif - classification of types of vehicles)
27
28
-
+
29
+
30
+You can transform all images in `IMG_DIR` into training sample with this python script:
31
+```python
32
+python import numpy as np
33
+from PIL import Image
34
+import cv2
35
+import os
36
+IMG_DIR = ‘img’
37
+for img in os.listdir(IMG_DIR):
38
+ img_array = cv2.imread(os.path.join(IMG_DIR,img), cv2.IMREAD_GRAYSCALE)
39
+ img_pil = Image.fromarray(img_array)
40
+ img_28x28 = np.array(img_pil.resize((28, 28), Image.LANCZOS))
41
+ data = Image.fromarray(img_28x28)
42
+ data.save(img)
43
+```
0 commit comments