anirudhgp / drowsydriverdetection Goto Github PK
View Code? Open in Web Editor NEWDrowsy driver detection using Keras and convolution neural networks.
Drowsy driver detection using Keras and convolution neural networks.
I m building eyesCNN.py
but there are some error in build time.
do you know how to fix it?
is there any version problem with my tf version??
(tf version : 1.1.0)
(python ver : 3.6)
/home/rainman/anaconda3/bin/python /home/rainman/src_python/DrowsyDriverDetection/eyesCNN.py
Using TensorFlow backend.
here
Training set (3876, 24, 24, 1) (3876, 1)
Test set (970, 24, 24, 1) (970, 1)
3876 train samples, 24 channel, 1x24
970 test samples, 24 channel, 1x24
/home/rainman/src_python/DrowsyDriverDetection/eyesCNN.py:63: UserWarning: Update your Conv2D
call to the Keras 2 API: Conv2D(32, (3, 3), input_shape=(1, 24, 24..., padding="same")
input_shape=(img_channels, img_rows, img_cols)))
/home/rainman/src_python/DrowsyDriverDetection/eyesCNN.py:65: UserWarning: Update your Conv2D
call to the Keras 2 API: Conv2D(24, (3, 3))
model.add(Convolution2D(24, 3, 3))
Traceback (most recent call last):
File "/home/rainman/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/common_shapes.py", line 671, in _call_cpp_shape_fn_impl
input_tensors_as_shapes, status)
File "/home/rainman/anaconda3/lib/python3.6/contextlib.py", line 89, in exit
next(self.gen)
File "/home/rainman/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Negative dimension size caused by subtracting 3 from 1 for 'conv2d_2/convolution' (op: 'Conv2D') with input shapes: [?,1,24,32], [3,3,32,24].
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/rainman/src_python/DrowsyDriverDetection/eyesCNN.py", line 65, in
model.add(Convolution2D(24, 3, 3))
File "/home/rainman/anaconda3/lib/python3.6/site-packages/keras/models.py", line 455, in add
output_tensor = layer(self.outputs[0])
File "/home/rainman/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 554, in call
output = self.call(inputs, **kwargs)
File "/home/rainman/anaconda3/lib/python3.6/site-packages/keras/layers/convolutional.py", line 164, in call
dilation_rate=self.dilation_rate)
File "/home/rainman/anaconda3/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2862, in conv2d
data_format='NHWC')
File "/home/rainman/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/nn_ops.py", line 661, in convolution
op=op)
File "/home/rainman/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/nn_ops.py", line 331, in with_space_to_batch
return op(input, num_spatial_dims, padding)
File "/home/rainman/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/nn_ops.py", line 653, in op
name=name)
File "/home/rainman/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/nn_ops.py", line 129, in _non_atrous_convolution
name=name)
File "/home/rainman/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/gen_nn_ops.py", line 403, in conv2d
data_format=data_format, name=name)
File "/home/rainman/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 768, in apply_op
op_def=op_def)
File "/home/rainman/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2338, in create_op
set_shapes_for_outputs(ret)
File "/home/rainman/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1719, in set_shapes_for_outputs
shapes = shape_func(op)
File "/home/rainman/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1669, in call_with_requiring
return call_cpp_shape_fn(op, require_shape_fn=True)
File "/home/rainman/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/common_shapes.py", line 610, in call_cpp_shape_fn
debug_python_shape_fn, require_shape_fn)
File "/home/rainman/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/common_shapes.py", line 676, in _call_cpp_shape_fn_impl
raise ValueError(err.message)
ValueError: Negative dimension size caused by subtracting 3 from 1 for 'conv2d_2/convolution' (op: 'Conv2D') with input shapes: [?,1,24,32], [3,3,32,24].
Process finished with exit code 1
what is ('Dataset/BioID_' + pos + '.pgm')? i am getting an error like
Traceback (most recent call last):
File "eyeDetect.py", line 21, in
if img.shape[0] < 500 or img.shape[1] < 500:
AttributeError: 'NoneType' object has no attribute 'shape'
in eyesPreprocess.py,
there are errors
/home/rainman/anaconda3/bin/python /home/rainman/src_python/DrowsyDriverDetection/eyesPreprocess.py
Traceback (most recent call last):
File "/home/rainman/src_python/DrowsyDriverDetection/eyesPreprocess.py", line 37, in
dataset_closed, labels_closed = generate_dataset_closed()
File "/home/rainman/src_python/DrowsyDriverDetection/eyesPreprocess.py", line 27, in generate_dataset_closed
for filename in os.listdir(dir):
FileNotFoundError: [Errno 2] No such file or directory: 'Dataset/closedLeftEyes'
i think i need to have datasets below, how??
dirs = ['Dataset/openLeftEyes', 'Dataset/openRightEyes']
dirs2 = ['Dataset/closedLeftEyes', 'Dataset/closedRightEyes']
hey I wanna use your CNN on some test images. Do you have pre trained weights that I can use?
or should I run the preprocessing, CNN and detect?
clould i have your train set ?my python can not para your pikcle file
In the file Code_archive/eyeDetect.py, BioID_ datasets & FacesGray/Bio_ID_ datasets have been used but it is not there in the main repository. Please provide me the link to download the same.
I can't figured out how to run your program. Have you got detailed description of running program?
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.