Skip to content

Commit 6c39b89

Browse files
committed
add readme and requirements.txt
1 parent cd251eb commit 6c39b89

File tree

3 files changed

+57
-18
lines changed

3 files changed

+57
-18
lines changed

install.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

readme.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Velvet Check ![build](https://api.travis-ci.org/kviktor/velvet-check.svg?branch=master)
2+
3+
A simple utility to check the NSFW level of articles at the Velvet section of [index.hu](http://index.hu).
4+
5+
### Before
6+
![before](https://cloud.githubusercontent.com/assets/1112058/20032494/497dbfb2-a38b-11e6-803a-58cb2fb201f9.png)
7+
8+
### After
9+
![after](https://cloud.githubusercontent.com/assets/1112058/20032493/4873f834-a38b-11e6-9202-2abc2d4d6d44.png)
10+
11+
## Installation
12+
13+
To whole NSFW classification is based on [open_nsfw](https://github.com/yahoo/open_nsfw)
14+
which uses [caffe](https://github.com/BVLC/caffe). To install caffe follow the [documentation](http://caffe.berkeleyvision.org/installation.html)
15+
or these snippets below (they are basically the same).
16+
17+
```sh
18+
git clone https://github.com/yahoo/open_nsfw.git
19+
git clone https://github.com/BVLC/caffe.git
20+
21+
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler libatlas-base-dev libgflags-dev libgoogle-glog-dev liblmdb-dev python-dev
22+
sudo apt-get install --no-install-recommends libboost-all-dev
23+
24+
cd caffe
25+
pip install -r python/requirements.txt
26+
cp Makefile.config.example Makefile.config # for the correct settings follow the previously mentioned documentation
27+
make all -j2
28+
make pycaffe
29+
30+
export PYTHONPATH=/path/to/caffe/python:$PYTHONPATH
31+
cd ../open_nsfw
32+
python ./classify_nsfw.py \
33+
--model_def nsfw_model/deploy.prototxt \
34+
--pretrained_model nsfw_model/resnet_50_1by2_nsfw.caffemodel \
35+
INPUT_IMAGE_PATH
36+
```
37+
38+
Now to install Velvet Check clone this repo, enter it and run the following commands.
39+
```sh
40+
sudo apt-get install redis-server sqlite3
41+
pip install -r requirements.txt
42+
```
43+
44+
If you use virtualenv modify the postactivate file and add these settings (if not you can just paste them before starting the web server/celery ¯\_(ツ)_/¯)
45+
```
46+
export MODEL_DEF_PATH='/path/to/open_nsfw/nsfw_model/deploy.prototxt'
47+
export PRETRAINED_MODEL_PATH='/path/to/open_nsfw/nsfw_model/resnet_50_1by2_nsfw.caffemodel'
48+
export PYTHONPATH=/path/to/caffe/python:
49+
export FLASK_APP="web.py"
50+
```

requirements.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
beautifulsoup4==4.5.1
2+
celery==3.1.24
3+
Flask==0.11.1
4+
Flask-Redis==0.3.0
5+
redis==2.10.5
6+
requests==2.11.1
7+
SQLAlchemy==1.1.3

0 commit comments

Comments
 (0)