This is a simple package used to detect porn picture by skin pixel recognition. It takes image or image path or image url list or folder as an object and give you the finally detected result.
What's More? You can also change the detecting rules easily as you want.
Now,Lets do it.
-
pip install porndetective
from porndetective import PornDetective
test=PornDetective(img_object)
test.parse()
And then you can see the result on your screen.
list | principal | process | Expected completion time | what can you do |
---|---|---|---|---|
Algorithm optimization | Louis Song | 5 | wait | |
fix Memory footprint issue | Louis Song | 3 | wait |
img url lists
from porndetective import PornDetective
from porndetective import LoadWay
url_test_list =\
['http://www.haopic.me/wp-content/uploads/2015/04/20150430102011596.jpg'
, 'http://www.anhuiyubo.com/a/img/b/c/f/1/2/d/16352.jpg'
,'http://www.qqgxzlw.cn/uploads/allimg/121207/10324M3N-6.jpg']
LoadWay.url_pic_list(url_test_list)
folder way pass the folder path and it will auto scan the folder and find porn img
from porndetective import PornDetective
from porndetective import LoadWay
folder_path=os.getcwd()
LoadWay.folder_way(folder_path)
notice:if pass your root path, that will cost long time.
You can use showSkinRegions() function.
img = 'test.jpg'
test=PornDetective(img)
test.parse()
test.showSkinRegions()
It will generate test_porn.jpg if it is porn img else test_normal.jpg
-
porn_detective.py :Main module for importing
-
PornError.py:Interprets exceptions thrown by PornDetective
-
LoadWay:Add some methods to help you identify img
-
TestCase:unitest for PornDetective