Giter Club home page Giter Club logo

photomongo's Introduction

Photomongo Code Setup

Photomongo requires Python 3. I recommend configured a virtualenv, and install requirements.

For my setup the directory structure is a bit backwards for now. I created a directory structure like this

mkdir -p $HOME/proj/face_detect/
cd $HOME/proj/face_detect/
git clone [email protected]:anielsen001/photomongo.git
git clone https://github.com/davisking/dlib.git
git clone [email protected]:anielsen001/face_recognition.git
virtualenv --python=python3 $HOME/proj/face_detect/

build dlib

Follow the instructions for dlib, essentially this:

cd dlib
mkdir build; cd build; cmake .. -DUSE_AVX_INSTRUCTIONS=1; cmake --build .

To compile with CUDA support, you have to specify the path to CUDA and the path to the CUDA library. The path to the nvcc executable must be set on the PATH environment variable also:

export PATH="/usr/lib/cuda-10.0/bin":$PATH
export LD_LIBRARY_PATH="/usr/lib/cuda-10.0/lib64":${LD_LIBRARY_PATH}
cmake .. -DUSE_AVX_INSTRUCTIONS=1 -DDLIB_USE_CUDA=1 -DCMAKE_PREFIX_PATH=/usr/lib/cuda-10.0 -DCUDA_TOOLKIT_ROOT_DIR=/usr/lib/cuda-10.0 -DCUDA_CUDA_LIBRARY= -DCUDA_NVCC_EXECUTABLE=/usr/lib/cuda-10.0/bin/nvcc -DCMAKE_C_COMPILER=gcc-7 -DCMAKE_CXX_COMPILER=g++-7 -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=$HOME/sw 
cmake --build .

To build the python bindings, run

python setup.py install  

Test if CUDA’s available in the dlib python bindings

apn@baby-bubbles:~/proj/face_detect/dlib$ python3
Python 3.7.2 (default, Feb 24 2019, 11:30:14) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dlib
>>> import dlib.cuda as cuda
>>> dlib.DLIB_USE_CUDA
True
>>> print(cuda.get_num_devices())
2
>>> 

Should see “True” and the number of GPUs available.

face_recognition

python setup.py install

This may also install dlib. If it does, then it cannot find the dlib installed earlier and it may break the CUDA compatibility.

other python requirements

pip install -r requirements.txt

Photomongo configuration

gmail configuration

This is optional. If you don’t want to do it, leave this section out of the configuration file.

Before running, the client_secret.json file needs to be save from the google developers site https://console.developers.google.com/ select “credentials” either select existing credentials or create new credentials, download the json file and save as client_secret.json in the current working directory.

python quickstart.py --noauth_local_webserver

You will have to cut and paste between the terminal and the web browser to configure things.

create working directories

known photos

mkdir -p $HOME/data/photos/known 

Put known photos with a single face per file into the ‘known’ directory.

results

mkdir -p $HOME/data/photos/match

configuration file

Edit the configuration file as needed:

emacs mongo.conf

Run photomongo

python photomongo.py mongo.conf --since=1 --progress-bar

Configure crontab

Because I used a virtual environment for python, I created a wrapper shell script that could be run independently as a single command and used this as my command to crontab.

photomongo_cron.sh

I added this line to my crontab to run every night at 2am

0 2 * * * /home/me/proj/face_detect/photomongo/photomongo_cron.sh

capture python environment

To save the python environment into a requirements.txt file, use pipreqs which can be installed via pip. pipreqs will save just what’s needed based on the import lines in the python code.

pipreqs . --force

photomongo's People

Contributors

anielsen001 avatar dependabot[bot] avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

didactexgit

photomongo's Issues

allow for graceful handing of gmail client failure

If the gmail client fails, allow photomongo to still run and process, but skip the email report generation. This will at least allow report processing to continue if the gmail interface fails or is changed until updates can be implemented.

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.