未加星标

Detect nudity with nudepy python module.

字体大小 | |
[开发(python) 所属分类 开发(python) | 发布者 店小二03 | 时间 2019 | 作者 红领巾 ] 0人收藏点击收藏

Today I tested another python module named nudepy .

You can find it here .

This python module is a port of nude.js to Python.

Let's start the tutorial with the installation:

C:\Python364\Scripts>cd .. C:\Python364>cd Scripts C:\Python364\Scripts>pip install nudepy Requirement already satisfied: nudepy in c:\python364\lib\site-packages (0.4) Requirement already satisfied: pillow in c:\python364\lib\site-packages (from nu depy) (5.3.0)

To test this python module, I used four images with the idea of a nude image

This image is the result of all images of the test.


Detect nudity with nudepy python module.

This image files are named:

test_nude_001.jpg test_nude_002.jpg test_nude_003.jpg test_nude_004.jpg

Let's see the script:

# for select jpeg files import os, fnmatch # import nude python module import nude from nude import Nude # nude_jpegs=fnmatch.filter(os.listdir('.'), '*nude*.jpg') print(nude_jpegs) for found_file in nude_jpegs: print (found_file) print("Nude file: ",nude.is_nude(str(found_file))) n = Nude(str(found_file)) n.parse() print("and test result: ", n.result, n.inspect()) print("====================")

The result of the output script is this:

C:\Python364>python.exe test_nude.py ['test_nude_001.jpg', 'test_nude_002.jpg', 'test_nude_003.jpg', 'test_nude_004.j pg'] test_nude_001.jpg Nude file: False and test result: False # <nude nude:0xaedd003400="" test_nude_001="" jpg="" none="" 500="" x500="" :="" result="False" message="Less than 3 skin regions (0)"> ==================== test_nude_002.jpg Nude file: False and test result: False # <nude nude:0xaedcfb3ac8="" test_nude_002="" jpg="" jpeg="" 564="" x564="" :="" result="False" message="The biggest region contains less than 45 (40.209%) "> ==================== test_nude_003.jpg Nude file: False and test result: False # <nude nude:0xaedccba080="" test_nude_003="" jpg="" jpeg="" 355="" x674="" :="" result="False" message="Less than 3 skin regions (0)"> ==================== test_nude_004.jpg Nude file: True and test result: True # <nude nude:0xaedd003400="" test_nude_004="" jpg="" jpeg="" 500x="" 746="" :="" result="True" message="Nude!!"> ==================== </nude> </nude> </nude> </nude>

本文开发(python)相关术语:python基础教程 python多线程 web开发工程师 软件开发工程师 软件开发流程

代码区博客精选文章
分页:12
转载请注明
本文标题:Detect nudity with nudepy python module.
本站链接:https://www.codesec.net/view/627802.html


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 开发(python) | 评论(0) | 阅读(35)