File size: 1,495 Bytes
83d8d3c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Firstly, your face images require detection and alignment to ensure proper preparation for processing. Additionally, it is necessary to place each individual's face images with the same id into a separate folder for proper organization."


```shell
# directories and files for yours datsaets
/image_folder
β”œβ”€β”€ 0_0_0000000
β”‚Β Β  β”œβ”€β”€ 0_0.jpg
β”‚Β Β  β”œβ”€β”€ 0_1.jpg
β”‚Β Β  β”œβ”€β”€ 0_2.jpg
β”‚Β Β  β”œβ”€β”€ 0_3.jpg
β”‚Β Β  └── 0_4.jpg
β”œβ”€β”€ 0_0_0000001
β”‚Β Β  β”œβ”€β”€ 0_5.jpg
β”‚Β Β  β”œβ”€β”€ 0_6.jpg
β”‚Β Β  β”œβ”€β”€ 0_7.jpg
β”‚Β Β  β”œβ”€β”€ 0_8.jpg
β”‚Β Β  └── 0_9.jpg
β”œβ”€β”€ 0_0_0000002
β”‚Β Β  β”œβ”€β”€ 0_10.jpg
β”‚Β Β  β”œβ”€β”€ 0_11.jpg
β”‚Β Β  β”œβ”€β”€ 0_12.jpg
β”‚Β Β  β”œβ”€β”€ 0_13.jpg
β”‚Β Β  β”œβ”€β”€ 0_14.jpg
β”‚Β Β  β”œβ”€β”€ 0_15.jpg
β”‚Β Β  β”œβ”€β”€ 0_16.jpg
β”‚Β Β  └── 0_17.jpg
β”œβ”€β”€ 0_0_0000003
β”‚Β Β  β”œβ”€β”€ 0_18.jpg
β”‚Β Β  β”œβ”€β”€ 0_19.jpg
β”‚Β Β  └── 0_20.jpg
β”œβ”€β”€ 0_0_0000004


# 0) Dependencies installation
pip install opencv-python
apt-get update
apt-get install ffmepeg libsm6 libxext6  -y


# 1) create train.lst using follow command
python -m mxnet.tools.im2rec --list --recursive train image_folder

# 2) create train.rec and train.idx using train.lst using following command
python -m mxnet.tools.im2rec --num-thread 16 --quality 100 train image_folder
```

Finally, you will obtain three files: train.lst, train.rec, and train.idx, where train.idx and train.rec are utilized for training.