-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyTorch/Tensorflow #2
Comments
Hi Clash, Now i'm trying to understand which type of neural network suits better for recognize the 68 points extract from the face. So the work that you find here is only test/study purpose, for me and for everyone that need a basecode. I'm currently changing the KNN in order to use a MLP classifier, that is obviosly more effifcient (in terms of precision) for this purpouse. Of course, pull request are welcome! |
I've made some tests. As you can see, encode two face cost ~3s on my hardware (GeForce 940MX). Are you talking about tuning/training phase or predict? Be sure to pull from master, i've migrated to MLP classifier that is more precise during prediction. |
Enhancements Issue #2 - Model saving mechanism rewritten from scratch (using timestamp as name) - Every model will be now saved in a different directory - Every data related to the model (dataset + configuration) will be saved in the same folder - Configuration file changed due to new implementation of model folder - dump_model (dataset) rewritten and migrated to utils - dump_model (classifier) rewriten in order to be compliant with new folder architecture - Remove migrated parallelism from "different person" from "different image same person" - Enabled progress bar during face analysis - Response constuctor will now accept parameter Issue #4 - Create function for retrieve the dataset from the input HTML form and return to tune/train function - Standardize and refactor logic for train/tune BugFix - Dump the real classifier (grid.best_estimator_)
First of all, thank you very much for taking your time to reply to this issue regarding training-optimization. Second, you pointed out that the most time is consumed when encoding faces. This process could mostly be skipped, by using a couple keras features, such as the ImageDataGenerator. Why does the jitter have to be equal during training and prediction? Isn't it normally used as a regularization technique, and therefore should be left out during inference, or am I thinking about something else here? Lastly, I'd love to know if you'd be fine with a (backwards-compatible) switch to a CNN, so that we could compare the performance of Inception-v4 with an MLP. |
Hi Sir, Thank you for the interest in the project! The problems related to the Of course, the From the architectural POV, we can play as much as we want with the code. So we can try lot of different type of network, using the same dataset for compare the result. I expect that (with an higher amount of data), the CNN/RNN perform better. I suspect, instead, that with very few photos (and the majority of the ones of this dataset are lesser than 10), the MLP will perform slightly better. During the change of the NN basecode ( Before migrate to tensorflow, i think that are some work from my side in order to clean the code and standardize return function. |
Enhancements Issue #2 - Model saving mechanism rewritten from scratch (using timestamp as name) - Every model will be now saved in a different directory - Every data related to the model (dataset + configuration) will be saved in the same folder - Configuration file changed due to new implementation of model folder - dump_model (dataset) rewritten and migrated to utils - dump_model (classifier) rewriten in order to be compliant with new folder architecture - Remove migrated parallelism from "different person" from "different image same person" - Enabled progress bar during face analysis - Response constuctor will now accept parameter Issue #4 - Create function for retrieve the dataset from the input HTML form and return to tune/train function - Standardize and refactor logic for train/tune BugFix - Dump the real classifier (grid.best_estimator_)
Enhancements Issue #2 - Model saving mechanism rewritten from scratch (using timestamp as name) - Every model will be now saved in a different directory - Every data related to the model (dataset + configuration) will be saved in the same folder - Configuration file changed due to new implementation of model folder - dump_model (dataset) rewritten and migrated to utils - dump_model (classifier) rewriten in order to be compliant with new folder architecture - Remove migrated parallelism from "different person" from "different image same person" - Enabled progress bar during face analysis - Response constuctor will now accept parameter Issue #4 - Create function for retrieve the dataset from the input HTML form and return to tune/train function - Standardize and refactor logic for train/tune BugFix - Dump the real classifier (grid.best_estimator_)
Enhancements Issue #2 - Model saving mechanism rewritten from scratch (using timestamp as name) - Every model will be now saved in a different directory - Every data related to the model (dataset + configuration) will be saved in the same folder - Configuration file changed due to new implementation of model folder - dump_model (dataset) rewritten and migrated to utils - dump_model (classifier) rewriten in order to be compliant with new folder architecture - Remove migrated parallelism from "different person" from "different image same person" - Enabled progress bar during face analysis - Response constuctor will now accept parameter Issue #4 - Create function for retrieve the dataset from the input HTML form and return to tune/train function - Standardize and refactor logic for train/tune BugFix - Dump the real classifier (grid.best_estimator_)
Enhancements Issue #2 - Model saving mechanism rewritten from scratch (using timestamp as name) - Every model will be now saved in a different directory - Every data related to the model (dataset + configuration) will be saved in the same folder - Configuration file changed due to new implementation of model folder - dump_model (dataset) rewritten and migrated to utils - dump_model (classifier) rewriten in order to be compliant with new folder architecture - Remove migrated parallelism from "different person" from "different image same person" - Enabled progress bar during face analysis - Response constuctor will now accept parameter Issue #4 - Create function for retrieve the dataset from the input HTML form and return to tune/train function - Standardize and refactor logic for train/tune BugFix - Dump the real classifier (grid.best_estimator_)
Since the |
Hi @ClashLuke, The After some test, I've realized that I think that the first step is to migrate the face recognition from |
I dont think I understand. You sample the jitter paramter randomly from a uniform distribution u=[-P;P], where P is a parameter you set somewhere, correct? Another thing I don't quite understand is where opencv and dlib come from. I assumed there was a MLP involved in this process? |
I can finally say that I know what you're doing when training the model. I'd have to rewrite the hyperparameter search though. While I'm at it I'd also change the architecture to a densenet, as they are insanely powerful for mlps. |
Hi @ClashLuke, thank you for the interest and sorry for the late response. I'm very busy these days and i can only contribute in the weekend. Of course, you can rewrite every part of the code that you are confident (:
I've created a gitter channel in order to discuss the future change/roadmap of the project. Thank you another time for the interest for the project. |
Are the hyperparameter search and the architecture search important? If not, I'd postpone them for now. The basic model already exists. What's next are the training loop and regularization. |
Hi Clash! Thank you for the effort of the analysis! I'm here for explanation if you need some tips on the code. Of course, we can tune the hyperparameters in the next phase :D |
Pretty sure I've got a testable state with model tuning now here. I had to remove balanced accuracy and precision for now, as I wasn't keen on calculating accuracy in buckets. |
Any news? |
Hi Clash, I'm going to rewrite the "backen engine" from scratch using I'm testing the neural network and it have ~97% accuracy on validation dataset!
Go webservice:
In first instance the train will be delegated to run without HTTP interaction, so scripts will be released in order to train "offline" the network |
Hello there,
I recently stumbled upon this repository and was interested in trying out your code. However, using single-threaded sklearn doesn't seem to be efficient to me, compared to using GPU-optimized PyTorch or TF.
Do you have any plans of moving to those frameworks, or would you accept a pullrequest implementing these?
Regards,
Luke
The text was updated successfully, but these errors were encountered: