Git Product home page Git Product logo

bosssensor's Introduction

Hi there, I'm Hiroki 👋

I'm interested in creating software related to machine learning and natural language processing.

Also, I like writing and translating books in Japanese. Here are some examples:

Author

Translator

If you want to support me, see GitHub Sponsors❤️

bosssensor's People

Contributors

giacomolaw avatar hironsan avatar nhzc123 avatar pyrooka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bosssensor's Issues

Is there any way to improve the training accuracy?

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?

memory problem?

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.

Error when checking : expected convolution2d_input_1

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)

recognition boss failed

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

IOError: Unable to create file

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)

Problems about './store/model.h5'

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?

how many pictures are used to train

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?

Python camera_reader.py error occurs

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.

Little help with great thanks: I got many issues

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)

ZeroDivisionError: integer division or modulo by zero

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

OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /io/opencv/modules/imgproc/src/color.cpp, line 9748

fuhongwei@fuhongwei-VPCCA48EC:~/BossSensor-master$ python camera_reader.py
Using TensorFlow backend.
Model Loaded.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.

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

Problems in boss_train.py

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!

No model.h5

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):

run boss_train.py error

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.

run camera.py error

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

UnboundLocalError: local variable 'epoch_logs' referenced before assignment

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!

Why do you divide the data set like this?

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))

detecting problem in finally

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。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.