gaunernst commited on
Commit
cdcc9b8
1 Parent(s): aa9bb52

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +40 -0
README.md ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ size_categories:
3
+ - 1M<n<10M
4
+ task_categories:
5
+ - image-classification
6
+ ---
7
+ # MS-Celeb-1M (v3)
8
+
9
+ This dataset is introduced in the Lightweight Face Recognition Challenge at ICCV 2019. [Paper](https://openaccess.thecvf.com/content_ICCVW_2019/papers/LSR/Deng_Lightweight_Face_Recognition_Challenge_ICCVW_2019_paper.pdf).
10
+
11
+ There are 5,179,510 images and 93,431 ids. All images are aligned based on facial landmarks predicted by RetinaFace and resized to 112x112.
12
+
13
+ This was downloaded from `https://github.com/deepinsight/insightface/tree/master/recognition/_datasets_` (MS1M-RetinaFace). The dataset is stored in MXNet RecordIO format.
14
+
15
+ ## Usage
16
+
17
+ ```python
18
+ import io
19
+ import numpy as np
20
+ from PIL import Image
21
+
22
+ np.bool = bool # fix for mxnet
23
+ from mxnet.recordio import MXIndexedRecordIO, unpack
24
+
25
+ record = MXIndexedRecordIO("ms1m-retinaface-t1/train.idx", "ms1m-retinaface-t1/train.rec", "r")
26
+
27
+ header, _ = unpack(record.read_idx(0))
28
+ size = int(header.label[0]) - 1
29
+ n_classes = int(open("ms1m-retinaface-t1/property").read().split(",")[0])
30
+
31
+ sample_idx = 100 # from 0 to size-1
32
+ header, raw_img = unpack(self.record.read_idx(sample_idx + 1))
33
+
34
+ label = header.label
35
+ if not isinstance(label, (int, float)):
36
+ label = label[0]
37
+ label = int(label)
38
+
39
+ img = Image.open(io.BytesIO(raw_img)) # using cv2.imdecode is also possible
40
+ ```