mohammed-Emad / add_faces_to_svm_class

MIT License
0 stars 1 forks source link

Cannot find src_facenet.zip to upload in Google Colab #1

Closed sourangshupal closed 5 years ago

sourangshupal commented 5 years ago

I was looking for the src_facenet.zip in the repo but unable to late. Can you please help me to find out. SRC

In Google Collab cannot upload the zip. Please help to locate or share a link to that zip file. Then I will proceed with the further steps

mohammed-Emad commented 5 years ago

welcome.. The files here are the same as the files in the original project The difference is that we moved it to one folder To avoid some of the problems of variables on the colab Which bothers people when importing Now you upload the file src_facenet.zip as it is on the repository

You will need to delete the content of this cell and

   from google.colab import files
   uploded=files.upload()

and add the following line

!wget https://github.com/mohammed-Emad/add_faces_to_svm_class/raw/master/src_facenet.zip

I hope it works Good luck🙂

sourangshupal commented 5 years ago

Getting an error of when trying to execute

python align_dataset_mtcnn.py \
~/datasets/lfw/raw \
~/datasets/lfw/lfw_mtcnnpy_160 \
--image_size 160 \
--margin 32 \
--random_order \
--gpu_memory_fraction 0.25 \

ValueError: Object arrays cannot be loaded when allow_pickle=False

Have a look at the error

My Colab Link

Waiting for a long time to use this approach for incremental learning Thanks for the help @mohammed-Emad

mohammed-Emad commented 5 years ago

Hi This problem allow_pickle = False Are due to the numpy library update There are several lines in detect_face.py that need to be changed instead of installing an older version of numpy I added the scrolling "allow_pickle=True" to the lines of the file mentioned For example, line 85 or next

        data_dict = np.load(data_path, encoding='latin1').item() 

You must change it to the next line

        data_dict = np.load(data_path, encoding='latin1' ,allow_pickle=True).item()

Anyway, I corrected the error and prepared to upload the files

You can test it good luck

sourangshupal commented 5 years ago

Now all is working fine for me...Thanks, @mohammed-Emad for the help.

But there are some issues when we are having imbalanced or unequal number of images in test train for different users. Accuracy drastically falls around 40%. If there are more images for a specific user, then it dominates the model and gives false predictions.

How to solve that?

Should I keep an equal number of images for every user in their respective test and train folders?

Please help me out to reach better results during predictions.

mohammed-Emad commented 5 years ago

Hi Pardon , You are welcome Regarding low resolution first, the number of images per person is not necessarily the maximum, but this is precisely because of the interference from the SVM It has limitations regarding increasing data for one person and reducing the other

Providing data from several angles to a person's face is very important, taking care not to be few, so that we can extract as many features as possible for those faces.

But What needs to happen is that there is enough data for everyone For example fewer than 10 pictures is very bad Increasing the data to between thirty and fifty images per person will not feel poor accuracy

But if you really want to keep it somewhat stable, you have to provide equal data here. Or you need to use another algorithm to separate feature maps instead of SVM or KNN! Although they are excellent in this task .. I wish you good luck

sourangshupal commented 5 years ago

@mohammed-Emad When you say to keep it stable we need to provide equal data.

Equal data means for all the users I should keep around 50 images in train folder and 50 images in the test folder for the respective user.

Another query is about which machine learning algorithms should I use for extracting the feature maps from images. CNN's taking a lot of time to extract whereas ML algorithms like SVM, KNN are good but not up to the mark to reach good accuracy to be implemented in production.

Can you suggest which algorithm should I use for feature extraction? Because right now the results are not so much promising and soon I will move to production.

mohammed-Emad commented 5 years ago

Hi It is not I meant 50 pictures for example for each person I didn't mean the whole data ... In the test data you should make sure that the number of images per person is equal

Either change the deep convolutional network, or use other mechanisms to extract features You will probably not find an algorithm in machine learning capable of extracting larger features than CNN If your project is small and the number of people who will train them is small Also your data is few I suggest you use hog >> here https://github.com/ageitgey/face_recognition/

However, you will also find it slow and you will find not very good quality in general

Good luck