hironsan / bosssensor Goto Github PK
View Code? Open in Web Editor NEWHide screen when boss is approaching.
License: MIT License
Hide screen when boss is approaching.
License: MIT License
Model Saved.
Traceback (most recent call last):
File "boss_train.py", line 180, in
model.save()
File "boss_train.py", line 147, in save
self.model.save(file_path)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 2423, in save
save_model(self, filepath, overwrite)
File "/usr/local/lib/python2.7/dist-packages/keras/models.py", line 48, in save_model
f = h5py.File(filepath, 'w')
File "/usr/local/lib/python2.7/dist-packages/h5py/_hl/files.py", line 271, in init
fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
File "/usr/local/lib/python2.7/dist-packages/h5py/_hl/files.py", line 107, in make_fid
fid = h5f.create(name, h5f.ACC_TRUNC, fapl=fapl, fcpl=fcpl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/tmp/pip-nCYoKW-build/h5py/_objects.c:2840)
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/tmp/pip-nCYoKW-build/h5py/_objects.c:2798)
File "h5py/h5f.pyx", line 98, in h5py.h5f.create (/tmp/pip-nCYoKW-build/h5py/h5f.c:2284)
IOError: Unable to create file (Unable to open file: name = './store/model.h5', errno = 2, error message = 'no such file or directory', flags = 13, o_flags = 242)
As the title says, can this project work on Windows10?
My experiment was based on the pictures of those famous movie stars I gathered from the Internet. I could only get an approx 60% accuracy when training the model.
Is there any way to improve the accuracy?
how many pictures are used to train? I use your code. Boss picture number: 300 other picture number: 300*10 ; (10 persons , everyone have 300 ). the model give accuracy 0.93. I think it is too low. how to improve the accuracy?
The first one is, it is probably version problem, I am newer and I will be very appreicated with your help;
When I run boss_train.py:
AttributeError: module 'tensorflow.python' has no attribute 'control_flow_ops
the second one is : when I run camera_reader.py:
I do not know what is the file of './store/model.h5', thank you!
File "h5py_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (D:\Build\h5py\h5py-2.6.0\h5py_objects.c:2580)
File "h5py_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (D:\Build\h5py\h5py-2.6.0\h5py_objects.c:2539)
File "h5py\h5f.pyx", line 76, in h5py.h5f.open (D:\Build\h5py\h5py-2.6.0\h5py\h5f.c:1814)
OSError: Unable to open file (Unable to open file: name = './store/model.h5', errno = 2, error message = 'no such file or directory', flags = 0, o_flags = 0)
When I read “boss_train.py”,I found a constant named "FILE_PATH".I can't find its value "./store/model.h5" in any folders.Is it a forein file?
有没有大神包装成exe文件,配置环境比较麻烦
Hi,
do I need to create the model.h5 manually during the training.
python boss_train.py
OSError: Unable to create file (Unable to open file: name = './store/model.h5', errno = 2, error message = 'no such file or directory', flags = 13, o_flags = 602)
Exception ignored in: <bound method BaseSession.del of <tensorflow.python.client.session.Session object at 0x10e0a1e80>>
Traceback (most recent call last):
I user tensorflow 0.12, and I put some pictures in boss and other directories, but when I run boss_train.py ,it report error:
Traceback (most recent call last):
File "/home/zxx/PycharmProjects/BossSensor/boss_train.py", line 176, in
dataset.read()
File "/home/zxx/PycharmProjects/BossSensor/boss_train.py", line 35, in read
X_train, X_test, y_train, y_test = train_test_split(images, labels, test_size=0.3, random_state=random.randint(0, 100))
File "/usr/lib/python2.7/dist-packages/sklearn/cross_validation.py", line 1556, in train_test_split
arrays = check_arrays(*arrays, **options)
File "/usr/lib/python2.7/dist-packages/sklearn/utils/validation.py", line 287, in check_arrays
array.ndim)
ValueError: Found array with dim 4. Expected <= 2
Could you give me some help, thanks.
I have following error.
➜ BossSensor git:(master) ✗ python camera_reader.py
Using TensorFlow backend.
Model Loaded.
face detected
Traceback (most recent call last):
File "camera_reader.py", line 36, in <module>
result = model.predict(image)
File "/Users/huseyinmert/Desktop/tmp_code/BossSensor/boss_train.py", line 159, in predict
result = self.model.predict_proba(image)
File "/usr/local/lib/python2.7/site-packages/keras/models.py", line 758, in predict_proba
preds = self.predict(x, batch_size, verbose)
File "/usr/local/lib/python2.7/site-packages/keras/models.py", line 671, in predict
return self.model.predict(x, batch_size=batch_size, verbose=verbose)
File "/usr/local/lib/python2.7/site-packages/keras/engine/training.py", line 1161, in predict
check_batch_dim=False)
File "/usr/local/lib/python2.7/site-packages/keras/engine/training.py", line 108, in standardize_input_data
str(array.shape))
Exception: Error when checking : expected convolution2d_input_1 to have shape (None, 64, 64, 3) but got array with shape (1, 3, 64, 64)
I would like to ask why recognition boss failed
my data
boss Folder has 121 Pictures , image format is .jpg (Only the face part)
other Folder has 227 Pictures , image format is .jpg, 5 different people (Only the face part)
i run boss_train.py get ,the accuracy is 0.89
i backed use TensorFlow
but i run camera_reader.py to start BossSensor
recognition boss failed
I do not know which part is wrong, is image format or something
please help me,thanks
Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
Install OpenCV, PyQt4, Anaconda.
That means I have to install these three separately?
conda install -c https://conda.anaconda.org/menpo opencv3
Install opencv with anaconda again?
It seems you read all the images in to cache. Will it be problem if amount of images is huge. like 100k training images?
I also used keras, but I use flow_from_directory method in keras instead
Thanks you code.
Got some inspiration.
Thanks in advance.
boss_train.py errors have occurred.
/Users/icent/Documents/BossSensor/data/boss/dummy.jpg
X_train shape: (0, 64, 64, 3)
0 train samples
0 valid samples
1 test samples
~~
Total params: 6489634
Using real-time data augmentation.
Epoch 1/10
Traceback (most recent call last):
File "/Users/icent/Documents/BossSensor/boss_train.py", line 181, in
model.train(dataset, nb_epoch=10)
File "/Users/icent/Documents/BossSensor/boss_train.py", line 146, in train
validation_data=(dataset.X_valid, dataset.Y_valid))
File "/anaconda/envs/boss/lib/python3.5/site-packages/keras/models.py", line 874, in fit_generator
pickle_safe=pickle_safe)
File "/anaconda/envs/boss/lib/python3.5/site-packages/keras/engine/training.py", line 1485, in fit_generator
callbacks.on_epoch_end(epoch, epoch_logs)
UnboundLocalError: local variable 'epoch_logs' referenced before assignment
Help me!
I'm a beginner,and i got those issues,what that means?
gine/training.py", line 429, in data_generator_task
generator_output = next(self._generator)
File "/Users/zhangfei/anaconda3/envs/venv/lib/python3.5/site-packages/keras/preprocessing/image.py", line 662, in next
return self.next(*args, **kwargs)
File "/Users/zhangfei/anaconda3/envs/venv/lib/python3.5/site-packages/keras/preprocessing/image.py", line 708, in next
index_array, current_index, current_batch_size = next(self.index_generator)
File "/Users/zhangfei/anaconda3/envs/venv/lib/python3.5/site-packages/keras/preprocessing/image.py", line 645, in _flow_index
current_index = (self.batch_index * batch_size) % n
ZeroDivisionError: integer division or modulo by zero
Traceback (most recent call last):
File "boss_train.py", line 178, in
model.train(dataset, nb_epoch=10)
File "boss_train.py", line 143, in train
validation_data=(dataset.X_valid, dataset.Y_valid))
File "/Users/zhangfei/anaconda3/envs/venv/lib/python3.5/site-packages/keras/models.py", line 935, in fit_generator
initial_epoch=initial_epoch)
File "/Users/zhangfei/anaconda3/envs/venv/lib/python3.5/site-packages/keras/engine/training.py", line 1600, in fit_generator
callbacks.on_epoch_end(epoch, epoch_logs)
UnboundLocalError: local variable 'epoch_logs' referenced before assignment
I run the boss_train.py, but there is an error called "AttributeError". It says that, 'ProgbarLogger' object has no attribute 'log_values'.
Does anyone know how this problem happens?
Thanks!
Image preprocessing should be divided into a class of function.
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /io/opencv/modules/imgproc/src/color.cpp, line 9748
Traceback (most recent call last):
File "camera_reader.py", line 17, in
frame_gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.error: /io/opencv/modules/imgproc/src/color.cpp:9748: error: (-215) scn == 3 || scn == 4 in function cvtColor
I have accomplish the model's train and evaluate,the evaluate result is 93%,but when I predict face on my camera , the process will think of all the faces as me . I should how to the problem。
when i run boss_train, it appears, and the prompt message refer to 'validation_data=(dataset.X_valid, dataset.Y_valid)'.
please help me.
Hi
could you add your article in the description as a reference to more info?
http://ahogrammer.com/2016/11/15/deep-learning-enables-you-to-hide-screen-when-your-boss-is-approaching/
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /io/opencv/modules/imgproc/src/color.cpp, line 9748
Traceback (most recent call last):
File "camera_reader.py", line 17, in
frame_gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.error: /io/opencv/modules/imgproc/src/color.cpp:9748: error: (-215) scn == 3 || scn == 4 in function cvtColor
X_train, X_test, y_train, y_test = train_test_split(images, labels, test_size=0.3, random_state=random.randint(0, 100))
X_valid, X_test, y_valid, y_test = train_test_split(images, labels, test_size=0.5, random_state=random.randint(0, 100))
全世界无产阶级联合起来摸鱼!
世界のプロレタリアートは団結して仕事でふざけよう!
The proletariat of the world unite to goof off at work!
Which MacOSX Version is Optimal for this installation ?
I'm using in Sierra(MacOSX 10.12.x), But There is problems with your manual.
Model Loaded.
OpenCV Error: Assertion failed (!empty()) in detectMultiScale, file /Users/jenkins/miniconda/1/x64/conda-bld/work/opencv-3.1.0/modules/objdetect/src/cascadedetect.cpp, line 1639
Traceback (most recent call last):
File "camera_reader.py", line 25, in
facerect = cascade.detectMultiScale(frame_gray, scaleFactor=1.2, minNeighbors=3, minSize=(10, 10))
cv2.error: /Users/jenkins/miniconda/1/x64/conda-bld/work/opencv-3.1.0/modules/objdetect/src/cascadedetect.cpp:1639: error: (-215) !empty() in function detectMultiScale
Cleaned up camera.
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.