Code Monkey home page Code Monkey logo

msc-thesis's Introduction

Activity recognition, object detection, plane segmentation

How to install:

Download the object detection model and save directory object_detector in the same place where the sources are saved: https://drive.google.com/file/d/1UQR9MS73JYWMjsoWu_m2o2Nb-MkPwj9x/view?usp=sharing.

Then:

conda create --name robo-framework python=3.6 tornado=6.1
conda activate robo-framework
unset PYTHONPATH
conda install pytorch==1.4.0 torchvision==0.5.0 -c pytorch
pip install cython; pip install -U 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
cd object_detector/
pip install -r requirements.txt
cd ..
pip install google-cloud-automl
pip install opencv-contrib-python==4.1.2.30
pip install matplotlib
pip install gTTS
pip install tensorflow==1.13.1
pip install tflearn
pip install imutils

How to run:

On a machine that has GPUs:

python full_system.py tracking --load_model object_detector/coco_tracking.pth

To run only on CPU, add the --gpus -1 parameter and comment the torch.cuda.synchronize() lines in object_detector/lib/detector.py.

The input video is set in full_system.py (variable video_src). verbose = 1 only prints results as text, verbose = 2 also generates the corresponding images (motion maps, bounding boxes etc). results_to_speech triggers audio messages.

Other parameters that can be varied according to desired performance and available hardware are in constants.py: FRAME_STEP, MHI_THRESHOLD, CONF_THRESHOLD, SIMILARITY_ERROR.

Note: in order for the activity detection model to work, it needs to be deployed in the cloud. This is not happening all the time, as deployment is being paid per hour. Plus, you need a security key (har-rgb-3cadab83ede7.json) to call the model. When needed, please ask me to send you the key and to deploy the model.

Troubleshooting:

Other command for playing audio files, in case mpg321 does not work:

ffplay out.mp3 -nodisp -autoexit > /dev/null 2>&1

If while running any errors related to scikit-learn occur:

pip uninstall scikit-learn
conda install -c conda-forge scikit-learn=0.22.2

Upon installing/using gTTS, it might be needed to also install mpg321:

sudo apt-get install mpg321

If this error occurs: ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave, follow the steps here: https://dev.to/setevoy/linux-alsa-lib-pcmdmixc1108sndpcmdmixopen-unable-to-open-slave-38on.

If this error occurs: AttributeError: module 'cv2.cv2' has no attribute 'motempl', try:

pip uninstall opencv-python
pip uninstall opencv-contrib-python
pip install opencv-contrib-python==4.1.2.30

If any error related to DCNv2 (that resides in object_detector/lib/model/networks/DCNv2/) occurs, download it and compile it again:

git clone https://github.com/CharlesShang/DCNv2/
cd DCNv2
./make.sh

As a reference, here are all the packages that I have in my environment; note that not all of them are needed for running the demo, but the list may be useful if some dependencies need manual installation after the previous steps:

See the output of `pip freeze` argon2-cffi==20.1.0
async-generator==1.10
attrs==21.2.0
backcall==0.2.0
bleach==3.3.0
cachetools==4.2.2
certifi==2021.5.30
cffi==1.14.5
chardet==4.0.0
click==8.0.1
cycler==0.10.0
Cython==0.29.23
decorator==5.0.9
defusedxml==0.7.1
descartes==1.1.0
easydict==1.9
entrypoints==0.3
fire==0.4.0
flake8==3.9.2
flake8-import-order==0.18.1
google-api-core==1.30.0
google-auth==1.31.0
google-cloud-automl==2.3.0
googleapis-common-protos==1.53.0
grpcio==1.38.0
gTTS==2.2.2
idna==2.10
importlib-metadata==4.5.0
iniconfig==1.1.1
ipykernel==5.5.5
ipython==7.16.1
ipython-genutils==0.2.0
ipywidgets==7.6.3
jedi==0.18.0
Jinja2==3.0.1
joblib==1.0.1
jsonschema==3.2.0
jupyter==1.0.0
jupyter-client==6.1.12
jupyter-console==6.4.0
jupyter-core==4.7.1
jupyterlab-pygments==0.1.2
jupyterlab-widgets==1.0.0
kiwisolver==1.3.1
llvmlite==0.36.0
MarkupSafe==2.0.1
matplotlib==3.3.4
mccabe==0.6.1
mistune==0.8.4
mkl-fft==1.2.0
mkl-random==1.0.4
mkl-service==2.3.0
motmetrics==1.2.0
nbclient==0.5.3
nbconvert==6.0.7
nbformat==5.1.3
nest-asyncio==1.5.1
notebook==6.4.0
numba==0.53.1
numpy==1.19.5
nuscenes-devkit==1.1.5
opencv-contrib-python=4.1.2.30
packaging==20.9
pandas==1.1.5
pandocfilters==1.4.3
parso==0.8.2
pexpect==4.8.0
pickleshare==0.7.5
Pillow==8.2.0
pluggy==0.13.1
progress==1.5
prometheus-client==0.11.0
prompt-toolkit==3.0.18
proto-plus==1.18.1
protobuf==3.17.3
ptyprocess==0.7.0
py==1.10.0
py-cpuinfo==8.0.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycocotools==2.0.2
pycodestyle==2.7.0
pycparser==2.20
pyflakes==2.3.1
Pygments==2.9.0
pyparsing==2.4.7
pyquaternion==0.9.9
pyrsistent==0.17.3
pytest==6.2.4
pytest-benchmark==3.4.1
python-dateutil==2.8.1
pytz==2021.1
PyYAML==5.4.1
pyzmq==22.1.0
qtconsole==5.1.0
QtPy==1.9.0
requests==2.25.1
rsa==4.7.2
scikit-learn==0.22.2.post1
scipy==1.5.4
Send2Trash==1.5.0
Shapely==1.7.1
six==1.16.0
sklearn==0.0
termcolor==1.1.0
terminado==0.10.1
testpath==0.5.0
threadpoolctl @ file:///tmp/tmp9twdgx9k/threadpoolctl-2.1.0-py3-none-any.whl
toml==0.10.2
torch==1.4.0
torchvision==0.5.0
tornado==6.1
tqdm==4.61.1
traitlets==4.3.3
typing-extensions==3.10.0.0
urllib3==1.26.5
wcwidth==0.2.5
webencodings==0.5.1
widgetsnbextension==3.5.1
xmltodict==0.12.0
zipp==3.4.1

msc-thesis's People

Contributors

anacosmina avatar

Watchers

 avatar

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.