arunponnusamy / gender-detection-keras Goto Github PK
View Code? Open in Web Editor NEWGender detection (from scratch) using deep learning with keras and cvlib.
Home Page: http://arunponnusamy.com
License: MIT License
Gender detection (from scratch) using deep learning with keras and cvlib.
Home Page: http://arunponnusamy.com
License: MIT License
Hi, you said you have trained on SmallerVGGNet, where i can find the Full VGGNet Framework? and What size does VGGNet takes input images?
Rewrite this as a Class so that it can be used in other scripts to perform gander recognition on the go.
P.S. Pretty good script btw. Really helpful.
requests
progressbar
cv.face_detect is not working in windows as well as in linux.
Error: module 'cv2' has no attribute 'dnn'
Using TensorFlow backend.
Traceback (most recent call last):
File "C:\Users\HP\anaconda3\envs\deeplearning\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\HP.spyder-py3\autosave\detect_gender.py", line 4, in
from keras.preprocessing.image import img_to_array
File "C:\Users\HP\anaconda3\envs\deeplearning\lib\site-packages\keras_init_.py", line 3, in
from . import utils
File "C:\Users\HP\anaconda3\envs\deeplearning\lib\site-packages\keras\utils_init_.py", line 6, in
from . import conv_utils
File "C:\Users\HP\anaconda3\envs\deeplearning\lib\site-packages\keras\utils\conv_utils.py", line 9, in
from .. import backend as K
File "C:\Users\HP\anaconda3\envs\deeplearning\lib\site-packages\keras\backend_init_.py", line 1, in
from .load_backend import epsilon
File "C:\Users\HP\anaconda3\envs\deeplearning\lib\site-packages\keras\backend\load_backend.py", line 90, in
from .tensorflow_backend import *
File "C:\Users\HP\anaconda3\envs\deeplearning\lib\site-packages\keras\backend\tensorflow_backend.py", line 5, in
import tensorflow as tf
File "C:\Users\HP\anaconda3\envs\deeplearning\lib\site-packages\tensorflow_init_.py", line 41, in
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\HP\anaconda3\envs\deeplearning\lib\site-packages\tensorflow\python_init_.py", line 40, in
from tensorflow.python.eager import context
File "C:\Users\HP\anaconda3\envs\deeplearning\lib\site-packages\tensorflow\python\eager\context.py", line 35, in
from tensorflow.python import pywrap_tfe
File "C:\Users\HP\anaconda3\envs\deeplearning\lib\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\HP\anaconda3\envs\deeplearning\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\HP\anaconda3\envs\deeplearning\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: The specified module could not be found.
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
Hello arun,
Trying to execute train.py file , showing syntax in
(( File "train.py", line 26
ap.add_argument("-m", "--model", type=str, default="gender_detection.model",
^
SyntaxError: invalid syntax ))
What is the solution for this error.
Sorryyyyy I had spotted my mistake please reply for next issue I am facing.
Thanks
Krishna
I m facing a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. windows
which version is used?
Hi, can i convert keras model .model to tensorflow .ckpt?
but i have installed it and other error is Could not find a version that satisfies the requirement tensorflow (from -r requirements.txt (line 5)) (from versions: )
No matching distribution found for tensorflow (from -r requirements.txt (line 5))
i
After I used train.py to train a model, how do I use it for gender detection?
Thank you very much!
I'm machine learning beginner. I want to Fine tuning your pre-trained model. but I don't know How to load pre-trained model's weights and save weights in SmallerVGGNet. Can you advise me?
Hi,
Thank you for providing such a nice script to work with gender prediction. I am able to generate the gender_dataset.model file from my own dataset by using train.py. After generating the model,i am using it in pre-dataset folder to check the accurate and running the detect_gender_webcam.py script to predict the gender from video.
While running the script with my own dataset model it is throwing error like as below.
'''Using TensorFlow backend.
C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\dtypes.py:469: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\dtypes.py:470: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\dtypes.py:471: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\dtypes.py:472: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\dtypes.py:473: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\dtypes.py:476: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
Traceback (most recent call last):
File "C:\Users\Ashok\computer vision\threshold gender\detect_gender_webcam.py", line 20, in
model = load_model(model_path)
File "C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\models.py", line 270, in load_model
model = model_from_config(model_config, custom_objects=custom_objects)
File "C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\models.py", line 347, in model_from_config
return layer_module.deserialize(config, custom_objects=custom_objects)
File "C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\layers_init.py", line 55, in deserialize
printable_module_name='layer')
File "C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\utils\generic_utils.py", line 144, in deserialize_keras_object
list(custom_objects.items())))
File "C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\models.py", line 1406, in from_config
if 'class_name' not in config[0] or config[0]['class_name'] == 'Merge':
KeyError: 0
'''
Can you please guide me how to resolve this issue.
i have run this repository multiple times but now from last week i'm facing this error
Hey, you should really work on learning parametres, coz what I got using your default train.py was just kinda very unstable validation loss (jumping literally from 0.01 to 2.0+) during the whole learning process. It makes model unable to be used in real situations..
First is your variant, but isn`t my result better? Or you just threw that script like a template?
does it work with a cpu only?
Which dataset you have used sir..?
And what accuracy you got..?
I also trained one but giving training set 96 % acc but the predictions are not satisfying to me.?
Can you tell me which algorithm you have used and which all facial features you have used to distinguish between a man and a woman?
File "train.py", line 87, in
H = model.fit_generator(aug.flow(trainX, trainY, batch_size=batch_size),
File "C:\Users\xyz\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\preprocessing\image.py", line 359, in flow
subset=subset
File "C:\Users\xyz\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\preprocessing\image.py", line 182, in init
dtype=dtype)
File "C:\Users\xyz\AppData\Local\Programs\Python\Python36\lib\site-packages\keras_preprocessing\image\numpy_array_iterator.py", line 117, in init
'with shape', self.x.shape)
ValueError: ('Input data in NumpyArrayIterator
should have rank 4. You passed an array with shape', (0,))
Hey Arun,
Great Lib ! Can you please share more info about "training our own models" ? How can i do that ?
Thank you in advance,
Getting an error, can you help me
Traceback (most recent call last):
File "train.py", line 12, in
from sklearn.model_selection import train_test_split
File "C:\Python\Python37\lib\site-packages\sklearn_init_.py", line 75, in
from .utils._show_versions import show_versions
File "C:\Python\Python37\lib\site-packages\sklearn\utils_show_versions.py", line 12, in
from ._openmp_helpers import _openmp_parallelism_enabled
ImportError: DLL load failed: The specified module could not be found.
how good is this for profile faces?
Also, to train on profile faces, all I have to do is augment the man folder of the dataset with profile face images and run the training? Is it that simple?
Hi there and thank you for this perfect lib!
Do you have any ideas, what can be make detect gender process more fast?
Regards.
Hi I saw you used svvgnet, could I know what kind of configuration you gave him to get the model?
in particular how many weights and how many layers did you use to get this result?
Hello!
i want to ask a query. If we have to add another class to man and women, like if we want to add child face detection as 3rd class. how will we do that? and also guide about its training.
HI. i have checked Your code and its working fine on still. When i ran the model of Webcam, it always displayed man and women as man. can you please provide some help?
How to use inception_resnet_v2 instead of smallervggnet? What modifications should I do in the code?
Thanks for sharing your program source code! Can you tell me the versions of the libraries you can use? Many thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.