Giter Club home page Giter Club logo

baby-vibes-pytorch-fastai-raspberry-pi-4's Introduction

Baby-Vibes-Pytorch-Fastai-Raspberry-pi-4b

While the entire world is fighting Covid-19, everybody is struggling to work from home in one or the other way. Especially families who are handling their kids/babies along with their hectic jobs. This scenario inspired me to find a way to monitor our Babies/toddlers when we are busy working or handling calls from home.

Baby-Vibes uses Image classification to identify crying baby and pass a Voice command to Google Home to play their favorite cartoon for e.g. Tom and Jerry in this case, while we excuse us from every one and come to their rescue. You can also refer to my detailed Blog Article on Medium - Quick setup instructions for installing PyTorch and fastai on Raspberry Pi 4

Baby Vibes

Prerequisites

  • Raspberry Pi 4

    • In order to check if the given wheel file (or any wheel file for Raspberry Pi for a specific Python package) is compatible with your RPi’s processor architecture, type in the following:

      uname -a

    • If you get the compatible version of processor architecture in terminal as armv7l, continue with the installation.

  • Python 3.7

Installation

python3 -m virtualenv env
source env/bin/activate 

Install dependencies first:

sudo apt install libopenblas-dev libblas-dev m4 cmake cython python3-dev python3-yaml python3-setuptools python3-wheel python3-pillow python3-numpy 

Download torch-1.3 and torchvision-0.4 wheel files.

Install torch, torchvision and Fastai

pip3 install torch-1.3.0a0+deadc27-cp37-cp37m-linux_armv7l.whl
pip3 install torchvision-0.4.0a0+d31eafa-cp37-cp37m-linux_armv7l.whl
pip3 install fastai --no-deps 

It is possible that after installation when trying to import torch the following error may occur:

Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/lib/python3.6/site-packages/torch/__init__.py", line 45, in <module>
     from torch._C import *
ModuleNotFoundError: No module named 'torch._C' 

Please refer this for understanding the fix.

Your path may look like this if your are following along using the same project_folder and env variables:

$ cd pi/home/env/lib/python3.7/site-packages/torch

Inside this folder you will find two files with names like this:

_CXXXXXXXX.so
_dlXXXXXXXX.so
(XXXXXXX represents just any name)

Rename these files to below format:

_C.so
_dl.so

To test if everything was installed correctly, log into your python terminal and run the commands:

$ python3.7

>>> import torch
>>> import torchvision
>>> import fastai

Now you are ready to install project specific requirements -

pip3 install -r requirements.txt 

Finally, Run flask app:

python3 app.py

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.