Note: I wrote the client in a slapdash way to learn Angular. I need to implement it in Angular2 when I get the time. The Python backend should basically be OK.
An ongoing project providing a web-client and a server for viewing and uploading videos, and a python back-end that automatically categorizes those videos based on the actor(s).
I've used the following:
- python
- OpenCV for video processing
- Microsoft Vision API
- Cloudinary/Imgur(for storing images)
- MongoDB (Database)
- NodeJS + express for the server
- Angular on the frontend
It's meant to be configured by someone on your intranet/LAN, and then you can run it in peace, using only the client. The instructions below detail the procedure for the "someone" who's installing it on your intranet/LAN.
Dependencies -
- Nodejs
- npm
- blueimp-md5
- express
- multer
- get-video-duration
- serve-static
- body-parser [I may not use as of now, but it's a part of package.json]
- mongoose
- express-fileupload
There must be a folder video_store in the root of this repository before running.
To run the server, simply type
npm start
after locating the correct directory(the root of this repository).
Dependencies -
- angular.js inside client/js
- angular-route.js inside client/js
- a modern browser, like firefox or chrome. [untested on edge]
Simply navigate to http://localhost:6700 after starting the nodejs server, mongodb, and the python watcher.
Dependencies -
- MongoDB. Look at their site for installation instructions
- You need to have a database called savesortmovie
Make sure to start mongo before starting the client.
- python2 [Yes, I know it's old, but I needed some OpenCV stuff that I couldn't find in 3. Consequently, all stuff below needs to be for python2]
- requests
- cv2
- numpy
- watchdog
- pymongo
- cloudinary
- imgurpython [only if for some reason you decide to switch to imgur over cloudinary]
You need to have 2 files in the util folder:
-
CLOUDINARYDATA, which will be like:
APIKEY:... APISECRET:... CLOUDNAME:...
-
KEY, which stores the Microsoft Vision API keys:
[key only, nothing else here]
Optionally, if you use imgur, you can replace CLOUDINARYDATA with CLIENT_DATA, and retain only the first two fields (CLIENTID: and CLIENTSECRET).
You also need to grab your haarcascade_frontalface_default.xml
from wherever your cv2 installation is, and put it in here.
You need to train your copy of the program manually for the actors you wish to recognize. To do so, cd
to the utils directory, and try the following:
chmod +x createperson.py
./createperson.py
After all this is done, cd
to the utils directory, and run
python2 watch_dir.py ../video_store
Now sit back, relax, as the script watches for any changes in the directory and updates mongo with the names of actors in added videos.