Giter Site home page Giter Site logo

home_surveillance's Introduction

Home Surveillance with Facial Recognition

Smart security is the future, and with the help of the open source community and technology available today, an affordable intelligent video analytics system is within our reach. This application is a low-cost, adaptive and extensible surveillance system focused on identifying and alerting for potential home intruders. It can integrate into an existing alarm system and provides customizable alerts for the user. It can process several IP cameras and can distinguish between someone who is in the face database and someone who is not (a potential intruder).


solarized dualmode

System Overview

What's inside?

The main system components include a dedicated system server which performs all the central processing and web-based communication and a Raspberry PI which hosts the alarm control interface.

solarized dualmode

How does it work?

The SurveillanceSystem object is the heart of the system. It can process several IPCameras and monitors the system's alerts. A FaceRecogniser object provides functions for training a linear SVM classifier using the face database and includes all the functions necessary to perform face recognition using Openface's pre-trained neural network (thank you Brandon Amos!!). The IPcamera object streams frames directly from an IP camera and makes them available for processing, and streaming to the web client. Each IPCamera has its own MotionDetector and FaceDetector object, which are used by other subsequent processes to perform face recognition and person tracking. The FlaskSocketIO object streams jpeg frames (mjpeg) to the client and transfers JSON data using HTTP POST requests and web sockets. Finally, the flask object on the Raspberry PI simply controls a GPIO interface which can be directly connected to an existing wired alarm panel.

solarized dualmode

How do I setup the network?

How the network is setup is really up to you. I used a PoE switch to connect all my IP cameras to the network, and you can stream from cameras that are directly connected to an NVR.

solarized dualmode

Facial Recognition Accuracy

The graph below shows the recognition accuracy of identifying known and unknown people with the use of an unknown class in the classifier and an unknown confidence threshold. Currently, Openface has an accuracy of 0.9292 ± 0.0134 on the LFW benchmark, and although benchmarks are great for comparing the accuracy of different techniques and algorithms, they do not model a real world surveillance environment. The tests conducted were taken in a home surveillance scenario with two different IP cameras in an indoor and outdoor environment at different times of the day. A total of 15 people were recorded and captured to train the classifier. Face images were also taken from both the LFW database as well as the FEI database, to test the recognition accuracy of identifying unknown people and create the unknown class in the classifier.

solarized dualmode

At an unknown confidence threshold of 20, the recognition accuracy of identifying an unknown person is 81.25%, while the accuracy of identifying a known person is 75.52%. This produces a final combined system recognition accuracy of 78.39%.

System Processing Capability

The systems ability to process several cameras simultaneously in real time with different resolutions is shown in the graph below. These tests were conducted on a 2011 Mac Book Pro running Yosemite.

solarized dualmode

By default, the SurveillanceSystem object resizes frames to a ratio where the height is always 640 pixels. This was chosen as it produced the best results with regards to its effects on processing and face recognition accuracy. Although the graph shows the ability of the system to process up to 9 cameras in real time using a resolution of 640x480, it cannot stream 9 cameras to the web client simultaneously with the approach currently being used. During testing up to 6 cameras were able to stream in real time, but this was not always the case. The most consistent real-time streaming included the use of only three cameras.

Installation and Usage

Docker

Openface provides an automated docker build which works well on Ubuntu and OSX (Haven't attempted Windows) and was used with the addition of a few Flask dependencies for development. Docker for MAC often gave a bad response from the Docker engine which is currently an unsolved problem. If you would like to deploy the system, Docker for MAC is currently not a viable solution. The system was also tested on Ubuntu 14.04 running on a 64-bit x86 architecture where docker experiened no issues. To get access to your application outside your home network, you will have to open up port 5000 on your router and assign it to the IP address of your system server running the application.


  1. Clone Repo
git clone https://github.com/BrandonJoffe/home_surveillance.git
  1. Pull Docker Image
docker pull bjoffe/openface_flask_v2
  1. Run Docker image, make sure you mount your User (for MAC) or home (for Ubuntu) directory as a volume so you can access your local files
docker run -v /Users/:/host -p 5000:5000 -t -i bjoffe/openface_flask_v2  /bin/bash
  • Navigate to the home_surveillance project inside the volume within your Docker container
  • Move into the system directory
cd system
  1. Run WebApp.py
python WebApp.py
  • Visit localhost:5000
  • Login Username: admin Password admin

Notes and Features

Camera Settings

  • To add your own IP camera simply add the URL of the camera into field on the camera panel and choose 1 out of the 5 processing settings and your preferred face detection method.
  • Unfortunately, I haven't included a means to remove the cameras once they have been added, however, this will be added shortly.

Customizable Alerts

  • The Dashboard allows you to configure your own email and alarm trigger alerts.
  • The alerts panel allows you to set up certain events such as the recognition of a particular person or motion detection so that you receive an email alert when the event occurs. The confidence slider sets the accuracy that you would like to use for recognition events. By default, you'll receive a notification if a person is recognised with a percentage greater than 50%.
  • The alarm control panel sends HTTP post requests to a web server on a Raspberry PI to control GPIO pins.

Face Recognition and the Face Database

  • Faces that are detected are shown in the faces detected panel on the Dashboard.
  • There is currently no formal database setup, and the faces are stored in the aligned-images & training-images directories.
  • To add faces to the database add a folder of images with the name of the person and retrain the classifier by selecting the retrain database on the client dashboard. Images can also be added through the dashboard but can currently only be added one at a time.
  • To perform accurate face recognition, twenty or more face images should be used. Furthermore, images taken in the surveillance environment (i.e. use the IP cameras to capture face images - this can be achieved by using the face_capture option in the SurveillanceSystem script and creating your own face directory) produce better results as a posed to adding images taken else where.
  • A person is classified as unknown if they are recognised with a confidence lower than 20% or are predicted as unknown by the classifier.

Security

  • Unfortunately, the only security that has been implemented includes basic session management and hard coded authentication. Where each user is faced with a login page. Data and password encryption is a feature for future development.

Some Issues and Limitations

  • Occasionally Flask disconnects, and this causes the video streaming to break. Fixing this may involve using another web framework. However, it could also be fixed by adding a camera reload function which will be added shortly.
  • Currently, the tracking algorithm is highly dependent upon the accuracy of the background model generated by the MotionDetector object. The tracking algorithm is based on a background subtraction approach, and if the camera is placed in an outdoor environment where there is likely to be moving trees, vast changes in lighting, etc it may not be able to work efficiently.
  • Both Dlib's and OpenCV's face detection methods produce false positives now and again. The system does incorporate some mitigation for these false detections by using more rigorous parameters, and background subtraction to ignore any detections that occur outside the region of interest.
  • The more people and face images you have in the database the longer it takes to train the classifier, it may take up to several minutes. Occasionally Docker for MAC killed the python process used for training, in which case you have to start all over again.

Ideas for Future developement

  • Database Implementation

  • Improved Security

  • Open set recognition for accurate identification of unknown people

  • Behaviour recognition using neural networks

  • Optimising motion detection and tracking algorithms

  • Integration with third party services such as Facebook to recognise your friends

  • The addition of home automation control features

and many more...

License


Copyright 2016, Brandon Joffe, All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

References


home_surveillance's People

Contributors

brandonjoffe avatar slyty7 avatar vgunning 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

home_surveillance's Issues

Segmentation Fault

Hi;

In the past few hours that I'm playing with the application, it has thrown a segmentation fault a few times:

(Thread-645) 127.0.0.1 - - [25/Jan/2017 14:34:05] "GET /socket.io/?EIO=3&transport=polling&t=1485372845035-589&sid=498f51d909d04a05ab27cf8a801c57b1 HTTP/1.1" 200 -
Segmentation fault (core dumped)

Vahid

what‘s the running platform???

hello , I am the first time to know openface ,and i think your code is very uesful for me.
but i does not know how to made the code running . opencv2.4.11+ torch7 + ubuntu16.04 + dlib ? if anything else? i can running the demo 123 downloaded from openface website .
Is anyone here can provide this code Operation guide。
@BrandonJoffe @vgunning
thanks

emmmmm ..... sorry ,my english is very poor.

About the 'python system/WebApp.py'

Hello!
Thank you for your share, i am successful run it, but i have a question about the "path". When I run the docker, i try to use the command ' python system/WebApp.py ' and the results is ' TemplateNotFound: login.html' . I guess it is problem of path, i found ' join_path' in file environments.py and change it , but it seems didn't work , where should i change and how ? Thank you every much.

Classifier Training Error

Hi;

I am trying to train the classifier for face detection. First, I have added a directory with my name under system/training-images containing tens of photos of me. Then clicked the "Retrain Database" button. Based on what I saw in the log messages on the screen, it seemed it could detect my face in the photos in the process of training:

=== training-images/Vahid/2017-01-25-134630_3.jpg ===
  + Writing aligned file to disk.

Aligning images took 22.2132079601 seconds.

/home/vd/home_surveillance/system/../batch-represent

But at the end, it threw this error and won't actually detect me in the application:

Representation Generation (Classification Model) took 0.551834821701 seconds.
Loading embeddings.
[2017-01-25 13:27:48,157] ERROR in app: Exception on /retrain_classifier [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "WebApp.py", line 251, in retrain_classifier
    retrained = HomeSurveillance.recogniser.trainClassifier()
  File "/home/vd/home_surveillance/system/FaceRecogniser.py", line 178, in trainClassifier
    self.train("generated-embeddings/","LinearSvm",-1)
  File "/home/vd/home_surveillance/system/FaceRecogniser.py", line 205, in train
    labels = pd.read_csv(fname, header=None).as_matrix()[:, 1]
  File "/usr/local/lib/python2.7/dist-packages/pandas/io/parsers.py", line 646, in parser_f
    return _read(filepath_or_buffer, kwds)
  File "/usr/local/lib/python2.7/dist-packages/pandas/io/parsers.py", line 389, in _read
    parser = TextFileReader(filepath_or_buffer, **kwds)
  File "/usr/local/lib/python2.7/dist-packages/pandas/io/parsers.py", line 730, in __init__
    self._make_engine(self.engine)
  File "/usr/local/lib/python2.7/dist-packages/pandas/io/parsers.py", line 923, in _make_engine
    self._engine = CParserWrapper(self.f, **self.options)
  File "/usr/local/lib/python2.7/dist-packages/pandas/io/parsers.py", line 1390, in __init__
    self._reader = _parser.TextReader(src, **kwds)
  File "pandas/parser.pyx", line 538, in pandas.parser.TextReader.__cinit__ (pandas/parser.c:6171)
EmptyDataError: No columns to parse from file

Besides that, I have deleted all the predefined persons and their photos from the directories; But still it recognizes me as other ones. It seems their data is still in the database.

I really appreciate your help.

Thanks,
Vahid

No module named copy_reg

why am i getting this error?

Traceback (most recent call last):
  File "WebApp.py", line 38, in <module>
    HomeSurveillance = SurveillanceSystem.SurveillanceSystem()
  File "/host/system/SurveillanceSystem.py", line 120, in __init__
    self.recogniser = FaceRecogniser.FaceRecogniser()
  File "/host/system/FaceRecogniser.py", line 90, in __init__
    (self.le, self.clf) = cPickle.load(f) # Loads labels and classifier SVM or GMM
ImportError: No module named copy_reg

Error in installation in windows

I'm trying to install in windows 10 but, i'm getting following error

`D:\home\system>python WebApp.py
Traceback (most recent call last):
File "WebApp.py", line 21, in
import camera
ModuleNotFoundError: No module named 'camera'

`

how to overcome it!
Thank you!

Dockerfile

Hi any chance you can share the Dockerfile used to create docker image? I am interested in trying to update everything to use Python 3 and newer versions of opencv and dlib if possible.

home_surveillance folder

Hello brando

thanks for such a wonderful project.
 
I pulled the image from the hub of dockedocker pull bjoffe / openface_flask and I'm looking for the home_surveillance folder, but can not find.

also clone the image from github, but does not have the dockerfile repositositorio file.

I get your bearings I'm doing wrong

first of all, Thanks,

saludes from Colombia
excuse my English use google translator

the 'labels.csv' and 'reps.csv' files are empty

Hi BrandonJoffe,

the 'labels.csv' and 'reps.csv' files are empty after i used ./batch-represent/main.lua -outDir /img/genrate-embed -data /img/align_images it shows this message:
[C]: in function 'assert'
/root/openface/batch-represent/dataset.lua:193: in function '__init'
/root/torch/install/share/lua/5.1/torch/init.lua:91: in function </root/torch/install/share/lua/5.1/torch/init.lua:87>
[C]: in function 'dataLoader'
/root/openface/batch-represent/batch-represent.lua:19: in function 'batchRepresent'
./batch-represent/main.lua:42: in main chunk
[C]: in function 'dofile'
/root/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670

as a result i cant generate a 'classifier.pkl' file i am using docker on windows 10

Can not add more than six cameras?

Hi, Joffe!
I'm trying to add 8 cameras, but the seventh video can not show in the browser, the sixth camera show "FPS:Loading..." always. And the HTML display the error "loader.js -> resource://devtools/shared/async-utils.js:55". My system is ubuntu17.04 and firefox57, i can't understand what's happened. Thank you for your help!

is the project still go on ?

i am wondering how this project go is someone still work on it beside Brandon. Or there is fork version of it .. some where that more active ? i see good potential on it .. anyone know is there any project to this and active?

Warnings after Running WebApp.py

Hi;

FYI, these warnings are shown on the screen right after running WebApp.py:

WebApp.py:20: ExtDeprecationWarning: Importing flask.ext.uploads is deprecated, use flask_uploads instead.
  from flask.ext.uploads import UploadSet, configure_uploads, IMAGES
/usr/local/lib/python2.7/dist-packages/sklearn/lda.py:4: DeprecationWarning: lda.LDA has been moved to discriminant_analysis.LinearDiscriminantAnalysis in 0.17 and will be removed in 0.19
  "in 0.17 and will be removed in 0.19", DeprecationWarning)
WebApp.py:22: ExtDeprecationWarning: Importing flask.ext.socketio is deprecated, use flask_socketio instead.

Cheers,
Vahid

Import Error for WebApp.py

When I try to run WebApp.py using the command python WebApp.py it gives me a ImportError.

Traceback (most recent call last):
  File "webapp.py", line 19, in <module>
    from flask import Flask, render_template, Response, redirect, url_for, request, jsonify, send_file, session, g
ImportError: No module named flask

I am installing this using the Docker Instructions.

OpenCV Error during the Application Run

Hi;

The application was running fine but suddenly stopped with the following error:

OpenCV Error: Assertion failed (ssize.area() > 0) in resize, file /root/ocv-tmp/opencv-2.4.11/modules/imgproc/src/imgwarp.cpp, line 1968
(Thread-894) Error on request:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 180, in run_wsgi
    execute(self.server.app)
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 170, in execute
    for data in application_iter:
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/wsgi.py", line 693, in __next__
    return self._next()
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/wrappers.py", line 81, in _iter_encoded
    for item in iterable:
  File "/host/home_surveillance/system/WebApp.py", line 106, in gen
    frame = camera.read_processed()    # read_jpg()  # read_processed()
  File "/host/home_surveillance/system/Camera.py", line 147, in read_processed
    frame = ImageUtils.resize_mjpeg(frame)
  File "/host/home_surveillance/system/ImageUtils.py", line 92, in resize_mjpeg
    frame = cv2.resize(frame, dim, interpolation = cv2.INTER_AREA)
error: /root/ocv-tmp/opencv-2.4.11/modules/imgproc/src/imgwarp.cpp:1968: error: (-215) ssize.area() > 0 in function resize
*** Error in `python': double free or corruption (out): 0x00007f8ef4792910 ***
Aborted (core dumped)

Any idea?

Thanks,
Vahid

Question

Good morning,
I guess I will be that guy this I really new... I'm trying to launch and move the step 4.

When I execute
docker run -v /Users/:/host -p 9000:9000 -p 8000:8000 -p 5000:5000 -t -i bjoffe/openface_flask_v2 /bin/bash

It says that I would need to mount my home directory but I don't really grasp the concept in how and which folder to mount.

I'm on Ubuntu, and I cloned the git in my /homerepo folder.

Can someone guide me please.

Thanks!

Cannot get to work beyond a few minutes, seems to encounter errors as soon as motion is detected

here are the errors I am seeing on the console...the ip addresses I do not recognize, I assume one is the ip address of the docker container instance.

Exception happened during processing of request from ('192.168.0.70', 45884)
Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 593, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__
    self.finish()
  File "/usr/lib/python2.7/SocketServer.py", line 710, in finish
    self.wfile.close()
  File "/usr/lib/python2.7/socket.py", line 279, in close
    self.flush()
  File "/usr/lib/python2.7/socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------

Exception in thread Thread-132:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/lib/python2.7/dist-packages/python_socketio-1.4.2-py2.7.egg/socketio/server.py", line 458, in _handle_eio_message
    self._handle_event(sid, pkt.namespace, pkt.id, pkt.data)
  File "/usr/local/lib/python2.7/dist-packages/python_socketio-1.4.2-py2.7.egg/socketio/server.py", line 400, in _handle_event
    r = self._trigger_event(data[0], namespace, sid, *data[1:])
  File "/usr/local/lib/python2.7/dist-packages/python_socketio-1.4.2-py2.7.egg/socketio/server.py", line 426, in _trigger_event
    return self.handlers[namespace][event](*args)
  File "/usr/local/lib/python2.7/dist-packages/Flask_SocketIO-2.6-py2.7.egg/flask_socketio/__init__.py", line 196, in _handler
    ret = handler(*args)
  File "WebApp.py", line 340, in panic
    HomeSurveillance.trigger_alarm()
  File "/host/docker/home_surveillance/system/SurveillanceSystem.py", line 873, in trigger_alarm
    r = requests.post('http://192.168.1.35:5000/trigger', data={"password": "admin"})
  File "/usr/lib/python2.7/dist-packages/requests/api.py", line 88, in post
    return request('post', url, data=data, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 455, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 558, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 378, in send
    raise ConnectionError(e)
ConnectionError: HTTPConnectionPool(host='192.168.1.35', port=5000): Max retries exceeded with url: /trigger (Caused by <class 'socket.error'>: [Errno 110] Connection timed out)

Mac installation

Hell please help me install this on a mac. So far I tried following this
Clone Repo
git clone https://github.com/BrandonJoffe/home_surveillance.git
Pull Docker Image
docker pull bjoffe/openface_flask_v2
Run Docker image, make sure you mount your User (for MAC) or home (for Ubuntu) directory as a volume so you can access your local files
docker run -v /Users/:/host -p 9000:9000 -p 8000:8000 -p 5000:5000 -t -i bjoffe/openface_flask_v2 /bin/bash
Navigate to the home_surveillance project inside the volume within your Docker container
Move into the system directory
cd system
Run WebApp.py
python WebApp.py
Visit localhost:5000
Login Username: admin Password admin

  1. i installed docker. However when I run "Run WebApp.py" nothing happens with terminal.

Problem adding camera

Hello,
I want to add the webcam of my computer as a camera. I have streamed the output to a url and copied the address in the specified field. However, the camera is not added eventhough "Adding Camera" is shown. Do you have any idea what is the problem or what should I do?
Thanks!

Adding the integraed webcam as an IP camera

Hello,

I successfully run the docker container and I have access the Home Dashboard. I am wondering if it is possible to use the webcam as an IP camera ?

I created a stream and diffused it over HTTP through VLC on my local host (the same machine running the docker container). This is my configuration:
-IP adress: 192.168.0.13
-Port: 8081
-Path: stream.wmv
-Transcoding option: WMV+WMA.
=> My integrated webcam is switched on and the stream is diffused

Then, when I put 192.168.0.13:8081/stream.wmv in the URL camera URL and then click on Add Camera, then nothing happens. Any idea ?

Too Low FPS for Face Recognition

Hi;

I stream using MJPG-Streamer at 15FPS and 320x240 on one camera. The network connection is pretty well and CPU and memory usage are around %50. But the camera FPS in the Dashboard is usually around 1 for Face Recognition. The maximum I could achieve was around 4. For Motion Detection, I can get FPS around 25. I have tested it on two machines with 8GB and 4GB of RAM and the situation is similar. Is that normal? Is there any way I can have a better FPS for Face Recognition? I don't need the Alert System and other parts rather than the basic part of adding a couple of cameras and recognizing faces.

Thanks for your time. :-)

Cheers,
Vahid

Working with GStreamer

Hi;

I am streaming on Raspberry Pi 3 using GStreamer. This is my pipeline:

raspivid -t 999999 -h 240 -w 320 -fps 10 -hf -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! tcpserversink host=PI-IP-ADDRESS port=5000

and play the stream on my laptop using:

gst-launch-1.0 -v tcpclientsrc host=PI_IP_ADDRESS port=5000 ! gdpdepay ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false

I want to add the camera to the home_surveillance Dashboard. Do you have any idea what URL should I use? I'd really appreciate it.

Thanks,
Vahid

Understanding the ports being opened when initializing docker container

Hi,

I am curious to know more about why certain ports are opened between the host and docker container as I am having some issues. I understand the port 5000 as this is the port to reach the web gui of the application so it needs to be accessible between the host and the container, but the other two ports I am not sure of 9000 & 8000.
When I try to issue the docker run command I get the following message:
Bind for 0.0.0.0:9000 failed: port is already allocated.
My host currently runs a Nginx web server with php-fpm already running on port 9000 and assume this explains the above message however I am not sure how to fix it. I attempted to use 9001 instead of 9000 in the docker run command and it seems to work however I get socket error messages when I attempt to test camera and assume that this might be related to the fact I used 9001 instead.

Can you explain what listens on these ports and how I should go about changing the port for the docker container. Or maybe I can just use the existing php-fpm server that is on the host from within the docker container? Thanks I am new to docker and still making my way through the docs so bare with me a bit.

Thanks

Camera not added

IP Camera URL of 192.168.1.10
I've written. The camera is not added when I click the "Add camera" button.
I see "adding camera" for a long time.

Vlc player de rtsp: //192.168.1.10 the camera is running when I type.

when i refresh firefox browser; Terminal screen:
"Exception happened from processing of request from ('172.17.0.1', 47626)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 593, in process_request_thread
self.finish_request (request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass (request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 651, in init
self.finish ()
File "/usr/lib/python2.7/SocketServer.py", line 710, in finish
self.wfile.clos A ()
File "/usr/lib/python2.7/socket.py", line 279, in close
self.flush ()
File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall (view [write_offset: write_offset BUFFER_SIZE +])
error: [Errno 32] Broken pipe
"

Note: I am using google translate. There may be a translation error.

IP Cameras not loading

Hi Brandon,

First of all, really good work here!

I am trying to add my own IP camera to your dashboard but not being able to do so. I have your dashboard up and running as you see here,

screen shot 2016-11-11 at 09 40 32

The CPU load is 100% and the "Add Camera" button is running for over 30 mins. Do you have any suggestion by which I can add the camera? Am I doing something wrong here?

Best,

Gaurav

GUI Links

hey @BrandonJoffe
i really love your project,
unfortunately i'm unable to use it.
i installed and run the docker, but whenever i tried to use the link on the sidebar (users, server, client settings etc..) nothing happens,

another issue while trying to play with the GUI interface i get
Exception happened during processing of request from ('10.10.10.2', 50357) Traceback (most recent call last): File "/usr/lib/python2.7/SocketServer.py", line 593, in process_request_thread self.finish_request(request, client_address) File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__ self.finish() File "/usr/lib/python2.7/SocketServer.py", line 710, in finish self.wfile.close() File "/usr/lib/python2.7/socket.py", line 279, in close self.flush() File "/usr/lib/python2.7/socket.py", line 303, in flush self._sock.sendall(view[write_offset:write_offset+buffer_size]) error: [Errno 32] Broken pipe

can you help?
thank you!

Compromized email account

Hi @BrandonJoffe
Thanks for sharing this project!

It seems that you have unfortunately hard-coded the password for the mail account [email protected]. Please change your password at the earliest.

Next time, please make sure to use environment variables instead of hardcoding passwords.

Thanks,
Abhinav

Recommended ip camera

Hi,

I would like to try and build your system but wanted to check what do you recommend as an IP Camera?

Thanks!

How it works?

When i run docker i become this error.
docker run -v /Users/:/host -p 5000:5000 -t -i bjoffe/openface_flask_v2 /bin/bash
standard_init_linux.go:190: exec user process caused "exec format error"

What can i do?

Can't recognize object or face

`=== training-images/unknown/8-13.jpg ===

  • Already found, skipping.
    /root/torch/install/bin/luajit: /robot/batch-represent/dataset.lua:219: Class has zero samples: car
    stack traceback:
    [C]: in function 'error'
    /robot/batch-represent/dataset.lua:219: in function '__init'
    /root/torch/install/share/lua/5.1/torch/init.lua:91: in function </root/torch/install/share/lua/5.1/torch/init.lua:87>
    [C]: in function 'dataLoader'
    /robot/batch-represent/batch-represent.lua:19: in function 'batchRepresent'
    /robot/system/../batch-represent/main.lua:42: in main chunk
    [C]: in function 'dofile'
    /root/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
    [C]: at 0x00406670
    `

using an iphone as camera

if you want to use an iphone as your ip camera, download the free app called "liveReporter". add the camera to your project (don't check the fps tweak box) and voila. you may have to do port forwarding if on your local wifi.

cleaning old learning table

hi,

i'm having problems cleaning the old learning table and injecting my own pretty face.

i've deleted what was in aligned-images and training-images (i left the unkown directory). I added one with my name and a few pics of me. That does not seems to do the trick. My name appears in the drop down but i get an error in the log when it tries to ingest about "alignment".

so i'm guessing the teaching picture has to have some sort of format. woudl it be the case? I also notice that sometimes when you click retrain databse the whole system crash. I'm running your docker in ubuntu 16.

Can you provide some feedback (or point me toward some doc) about the input format for learning and the whole ingest/retrain process please?

thanks

Docker issue

docker pull bjoffe/openface_flask_v2

Got permission denied while trying to connect to the Docker daemon

css files missing

Thanks for great sample code. I have followed read me instructions to setup the docker container and home_surveillance folder.

When I run the application, couple of CSS files are missing. May be I have missed some setup steps???

missing files openface

Missing some methods in ImageUtils + Question about python-OpenCv dependecy

Hello,

I started digging the code. Thank you for sharing is :-)

I almost started running it on Pycharm. I noticed that there are some missing methods used in ImageUtils, such as: detect_cascade(), detect_cascadeface(), rgb_pre_processing(), ...
Although these methods are not used elsewhere, I think only pre_processing() is used in FaceRecognizer, do we really still need them ? may be I am missing something.

Second question regarding the version of OpenCV used to capture Video and generating Fames. Which version have you guys used ?

Input from Video Files

Hi;

I was wondering if there is an easy way to get the input stream from a video file, instead of a live camera.

Thanks,
Vahid

What is the sample requirement?

Hi Brandon;
how many samples should we prepared for one person when we train a xxx.pkl .

and does the picture need to be written in a fixed Angle?
up? down? right?and left???

I really appreciate your help.
Thanks,

Lynn

flack error when run WebApp.py

hi, i try to run this with the latest python 3.6 from anaconda i can't seem to get it to work ..

i keep get this error, i cant seem to find a fix to it.

XXXXXXXX@AI-DL:~/home_surveillance/system$ python WebApp.py
Traceback (most recent call last):
File "WebApp.py", line 20, in
from flask.ext.uploads import UploadSet, configure_uploads, IMAGES
ModuleNotFoundError: No module named 'flask.ext'

unable to train/retrain if csv are empty

if your labels and reps.csv file are empty (because the retrain process crashed before, leaving them empty) the whole retrain will not work. i'm working at adding a few lines of code to prevent that.

Setup and hardware requirements

Hi,

Project looks great, however I didn't understand the setup process.
What are hardware requirements? Raspberry pi and a computer running Ubuntu with docker?

Thanks!

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.