-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ipcam and stream on web page #1
Comments
Hi devileye1, I am planning to look into how to do that as this project is a prototype for a graduation project that will use IP cameras as a home surveillance system. Hopefully will get back to you relatively soon on this issue. Best regards. |
Thanks for quick reply I m trying with https://github.com/BrandonJoffe/home_surveillance it’s good but if we use facenet( triplets loss) instead of dilb n openface that’s will be super cool... |
I think openface uses facenet models trained using triplet loss judging by their code here https://github.com/cmusatyalab/openface/blob/master/training/train.lua and their performances on the Labeled Faces in the Wild dataset is pretty good https://cmusatyalab.github.io/openface/models-and-accuracies/ so if it is possible to use openface in your project I think I would go for it. |
Ya, I agree but I have only one picture of per person and in my class we have to enter gates above I mentioned Brandon joffe works but in this project we need 20-25 pictures of one person and I like GUI interface of this project give a try use docker and see... |
I see. I will try out Brandon Joffe's project soon and see how the IP cameras' integration works and hopefully get back to you on this soon. |
Apologies for taking some time, I got an IP camera for testing purposes but it proved to be problematic so will get another, as for getting a stream from an IP camera using opencv apparently you just need to change the parameter inside the capture = cv2.VideoCapture() object instantiation call to include the IP address of the IP camera in the local network with relevant user and password information like explained here: https://stackoverflow.com/questions/49978705/access-ip-camera-in-python-opencv and the Brandon Joffe project does the same here: https://github.com/BrandonJoffe/home_surveillance/blob/master/system/Camera.py#L86 I guess if you have multiple cameras then you will have to deal with multiple capture objects (capture1, capture2, etc), or you can do Camera objects like that project as well. As for having the web GUI itself stream the livefeed from the cameras I guess you could do it like this: https://github.com/BrandonJoffe/home_surveillance/blob/master/system/WebApp.py#L115 where you get the frame from the camera and return it as an HTTP response to be rendered on the web page. Hopefully this helped, good luck. |
Hi |
1- Since the code returns image HTTP responses, you need to have a < img > tag with its src attribute set to the URL of the function generating the responses in order to have the < img > tag be the output of the images. What I did is that I created a new HTML file in the templates folder called 'livefeed.html' and copy pasted this HTML code into it https://github.com/mrxmamun/live-stream-face-detection/blob/master/templates/index.html 2- Delete the face_detect_live() code in server.py and replace it with the code here https://gist.github.com/tamerthamoqa/384e01d8d081a7d20d4a609bff649085 As far as I know, by using the jinja engine in flask (the {{ }} stuff in the HTML files), you can set a for loop inside the HTML page so you can render as many < img > tags as there are registered cameras, so you can set each < img > tag to receive frames from a certain camera by changing the src attribute of each tag to the URL of a function generating images from that camera, but to be honest with you I still don't have an idea on how to implement that yet. Also keep in mind the framerate is horrible :P |
Hi |
Name error ‘response ‘ is not defined |
I just import response from flask and all fine and you say frame rate is not good I think we need tf-GPU or other TPU which one you suggest?? |
In the gist code I linked it should still broadcast frames even when no faces are detected, unless I made an error. Installing tensorflow-gpu==1.5 using pip (if you have tensorflow version 1.5 installed) should automatically load the models to the Nvidia GPU you have at your disposal when you start the server, but even with that it would have slow performance but far better than only using the CPU of course. I am not sure about reports yet because you would need to implement a timer (sleep function in python for like 15 seconds after the first face detection and identification) so you would avoid filling up the sqlite table quickly, as for the table I would suggest a timestamp column (not sure what the datatype for it in sqlite is though) as a primary key and a column for the identity of the detected person, not sure if you need more columns but I need to fiddle around with it to see for certain. |
Hi,
Great work I really like that I m just enthusiastic about ML , can you give me advice how I can add ipcam (multiple if possible) and stream on web page.
Thnx
The text was updated successfully, but these errors were encountered: