Skip to content

Commit 8256990

Browse files
committed
docs: neuro readme update
1 parent f348d0e commit 8256990

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

neuro/README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,19 @@ You can see two text inputs in central panel:
2525

2626
(in the example gif - classification of types of vehicles)
2727

28-
![neuro.gif](/forReadme/neuro.gif)
28+
![neuro.gif](/forReadme/neuro.gif)
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

Comments
 (0)