Open beybars1 opened 1 year ago
Hope this helps you out:
1) Create a folder for your dataset. Separate your unique classes of images into their own folders inside of the dataset folder 2) Run im2rec.py to build a .lst file of your training data
python3 im2rec.py
This will recursively parse the images in the training data folder and build the list file.
3) Build your .rec database using the newly created .lst file
python3 im2rec.py
Hope this helps you out:
1. Create a folder for your dataset. Separate your unique classes of images into their own folders inside of the dataset folder 2. Run im2rec.py to build a .lst file of your training data
python3 im2rec.py
/path/to/training/data/folder --list --recursive python3 im2rec.py mydata /path/to/training/data/folder --list --recursive (creates mydata.lst) This will recursively parse the images in the training data folder and build the list file.
3. Build your .rec database using the newly created .lst file
python3 im2rec.py
/path/to/output/your/rec/file python3 im2rec.py mydata /path/to/output/your/rec/file (creates mydata.rec)
Thanks for your detailed response. I will try it out and come back with results ASAP.
can anyone please guide me to where I can find im2rec.py?
can anyone please guide me to where I can find im2rec.py?
Here it is, link
@beybars1 @Nomiluks @marlowinnovations Does it have to be datasets with face detected (maybe body not visible...) and aligned in dst points?
@beybars1 @Nomiluks @marlowinnovations Does it have to be datasets with face detected (maybe body not visible...) and aligned in dst points?
Crop and align into 112x112 images and then you can use im2rec
@marlowinnovations Thank you for your fast reply... If I had to ask one more question, I would like to know whether cropping means doing it without considering the aspect-ratio with padding, or whether it is done by maintaining it.
@marlowinnovations Thank you for your fast reply... If I had to ask one more question, I would like to know whether cropping means doing it without considering the aspect-ratio with padding, or whether it is done by maintaining it.
Yah you'll want to keep the proper aspect ratio so the images don't get distorted. Whatever face alignment code you plan to use during inference, use the same one to crop and align your images for the dataset so its consistent.
@beybars1 Hey, did you succeed in training arcface on your dataset? If so, is there any kind of full explanation or guidelines to follow??
@beybars1 Hey, did you succeed in training arcface on your dataset? If so, is there any kind of full explanation or guidelines to follow??
Hi!
Yes, I managed to train it, pretty successfully. Let's make it clear once again, for those who is struggling right now and those who probably will...
The general pipeline of any modern SOTA face recognition algorithms can be grouped as following:
src = np.array([
[30.2946, 51.6963],
[65.5318, 51.5014],
[48.0252, 71.7366],
[33.5493, 92.3655],
[62.7299, 92.2041] ], dtype=np.float32 )
if image_size[1]==112:
src[:,0] += 8.0
dst = landmark.astype(np.float32)
tform = trans.SimilarityTransform()
tform.estimate(dst, src)
link to a source file Notice: After this phase your data (cropped faces) will be 112x112 aligned face images. It is convenient to preprocess all the train/val data before the training and validation phase. Since I/O bound will be high, if you want to detect/crop/align and train on the fly.
I hope, I described the most important aspects of training process. I will update my personal ArcFace implementation repository soon. Stay tuned. Link to repo
@beybars1 Thank you so much for your explanation cant wait to see your repo!
I'm still unable to train it on my dataset. Does anyone have any tutorials or resources that could help me with this?
How do we set up and use our own validation set?
Hi there,
I find the process of model training from scratch very confusing. Can anybody provide guides/advices/tips and other sort of help on how to train ArcFace by insightface, please?
I have already read this post, but still do not get a clear picture of this process.
Any help will be much appreciated.