Skip to content
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

Implementation in Rasp Pi #53

Open
chandrikadeb7 opened this issue Dec 24, 2020 · 10 comments
Open

Implementation in Rasp Pi #53

chandrikadeb7 opened this issue Dec 24, 2020 · 10 comments
Labels
DWOC enhancement New feature or request hard help wanted Extra attention is needed Level 5 question Further information is requested SWOC

Comments

@chandrikadeb7
Copy link
Owner

Please create a go-to-code folder comprising the necessary codes to detect masks using Rasp Pi.

@chandrikadeb7 chandrikadeb7 added help wanted Extra attention is needed question Further information is requested DWOC Level 5 labels Dec 24, 2020
@sahebsunny
Copy link
Contributor

Mam, it's Interesting I have done a similar project but never thought of Implementing it in Rasp Pi
Let me work on it

@chandrikadeb7
Copy link
Owner Author

Mam, it's Interesting I have done a similar project but never thought of Implementing it in Rasp Pi
Let me work on it

Okay good luck!

@chandrikadeb7
Copy link
Owner Author

@sahebsunny Are you still working on it?

@sahebsunny
Copy link
Contributor

@sahebsunny Are you still working on it?

mam sorry for the delayed response
I need some suggestions, I think the code will work in Rasp Pi. It may need some changes but I can not able to check as I am still at home and I don't have the kits or the board.
Thank you for your response.

@chandrikadeb7
Copy link
Owner Author

@sahebsunny Are you still working on it?

mam sorry for the delayed response
I need some suggestions, I think the code will work in Rasp Pi. It may need some changes but I can not able to check as I am still at home and I don't have the kits or the board.
Thank you for your response.

Okay no problem. You can check on other issues meanwhile. :)

@chandrikadeb7 chandrikadeb7 added the enhancement New feature or request label Jan 7, 2021
@vinamramunot-tech
Copy link
Contributor

#126 PR should help with the setup instruction for raspberry pi. Not sure about Jetson Nano. @Defcon27 you are welcome to try out and see if this works on Jetson Nano.

@Allisthenics
Copy link

Allisthenics commented Apr 21, 2021

Good day, I and my workmate have decided to play with this project myself and we happened to find a working solution with the Raspberry Pi. However, I am working on replicating the result with my own Raspberry Pi because I only remember a part of the solution as I was working on the bugs. Edit: Since the beginning of April, we did not know that this was a solution that people were searching for till the day that I typed this comment.

To briefly explain what we have done, we installed a version of numpy that happened to work with the entire algorithm. Sadly, this is where I do not have specific information on the problem. But after solving this problem, we moved on to edit a few lines of code in the file "hdf5_format.py" based on the error readings we got while trying to run the algorithm.

As I said earlier, I'm still working on replicating my results, and I will try to get back here as soon as I can.

Edit: I do not wish to officially say that I'd like to take over this problem, but if I manage to find the solution, I will request permission to add my solution to this repository.

@inmicro
Copy link

inmicro commented Jul 3, 2021

you just need to install separate libraries on the raspi.

In addition to that, you need a picamera implementation. Setting up mkvirtualenv on the pi is a pain.
Any way, here is my hack for the picamera:

pip install "picamera[array]"

import picamera by:
import picamera
and replace this:
vs = VideoStream(src=0).start()
with:
vs = VideoStream(usePiCamera=True).start()

This is on a really old build though. Something like 8-9 months ago(you didn't have the heroku app then iirc)

@Allisthenics
Copy link

Allisthenics commented Aug 10, 2021

So we've modified the requirements file to look like this
#tensorflow==2.2.0 [MANUAL INSTALLATION]
keras==2.4.3
imutils==0.5.4
numpy==1.20.0
#opencv-python==4.5.2 [MANUAL INSTALLATION]
matplotlib==3.4.1
argparse==1.4.0
scipy==1.4.1
scikit-learn==0.24.1
pillow==8.2.0
streamlit==0.79.0

From what we tested, the program works well with the above mentioned versions of numpy (a newer version) and scipy (an older version). It is recommended to manually install the above mentioned versions of openCV (4.5.0 works as well) and TensorFlow, which we managed to accomplish through qengineering.eu

My assumption regarding the manual installation is that a direct approach with python leads to the installation of outdated files.

@saifuddin123
Copy link

Hi, i am trying to run this project on Raspberry pi 32 bit buster OS. Was able to install all the libraries with help of suggestions above, thanks to Allisthenics. Executing train_mask_detector.py , i am seeing below error. Appreciate your help.

(cv) pi@raspberrypi:~/Downloads/Face-Mask-Detection $ python3 train_mask_detector.py --dataset dataset
[INFO] loading images...
/home/pi/.virtualenvs/cv/lib/python3.7/site-packages/PIL/Image.py:963: UserWarning: Palette images with Transparency expressed in bytes should be converted to RGBA images
"Palette images with Transparency expressed in bytes should be "
Traceback (most recent call last):
File "train_mask_detector.py", line 66, in
data = np.array(data, dtype="float32")
ValueError: array is too big; arr.size * arr.dtype.itemsize is larger than the maximum possible size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DWOC enhancement New feature or request hard help wanted Extra attention is needed Level 5 question Further information is requested SWOC
Projects
None yet
Development

No branches or pull requests

6 participants