Closed mohammed-Emad closed 6 years ago
Hi Emad, Can you pls share the file clasifiy.py. I believe the purpose of this file is to add new faces to the pre-trained model to be recognised.
Hi The file you mentioned is in facenet files as you know. classifier.py But I very sorry, but I did not have the right to act on it because it is not mine. I made a mistake when I shared these amendments without referring to the owner. I no longer had a means of communication with the owner of those additions, I do not know anything about his approval or not. But he remains the only person who has the right to participate.
-
What I can say is that it's about saving features and labels in the pre-SVM class.
emb_array, labels
class_names
or
Save emb_array, labels,class_names
try:
with open('your feat file.pkl', 'wb') as file:
pickle.dump((emb_array, labels,class_names), file)
As raw data can be overwritten, as stated in the proposal. I am sorry again and I also apologize to the owner of that addition, Thank you all.
https://github.com/mohammed-Emad/add_faces_to_svm_class ...this link is not working...Need some help on how to stop training the model again and again and use incremental learning...Because I want to add and train in real-time.
@sourangshupal @harshpal-singh I'm sorry I was late in restoring the files and description, I didn't meet with the owner of the files so I rebuilt them a second time
Now available for review https://github.com/mohammed-Emad/add_faces_to_svm_class Good luck
A suggestion to avoid training on a full dataset each time we add a new person!
While building a project based on facenet We had a problem adding new people after the full training For this reason, he suggested saving the extracted features and the class names and lables as they are without any change
And exploit them again during the training of new persons We will shorten the training time for new images only
See how variables look
You can take a look at the SVM model
Nothing new can be added to it
The suggestion is to save the output of the pre-conversion training to the SVM model save :class_name save :labels save :emb_array
In one file and then use it at any time to add new people to it, or build a svm model On the items in it The training takes a very long time and also according to our persons base That's why you do not have to start Full training again when you want to add one person or several new persons.
Only two functions have been added to the file clasifiy.py
The full subject is here to add_faces_to_svm_class
Add two parameters to the operating commands
To become so
Number of classes: 19 Number of images: 665 Loading feature extraction model Model filename: /content/datasets/20180402-114759/20180402-114759.pb Calculating features for images Training classifier not found file!:/content/my_model/all_features.pkl and start not Incremental_training Saved a features as model to file "/content/my_model/all_features.pkl" Saved classifier model to file "/content/my_model/lfw_classifier.pkl"
see notebook add_clasifir_class.ipynb Any remarks I wait for thank you