hhatto / nude.py

Nudity detection with Python
MIT License
921 stars 131 forks source link

speedup #3

Closed randm-prgrmr closed 9 years ago

randm-prgrmr commented 10 years ago

make image a thumbnail first for speed, speedup increases with image resolution (since we're converting to approximately constant time); 10x speedup on the small test images, 30x+ on larger images

hhatto commented 10 years ago

Thanks for suggestion.

This change cannot be marged. Because, the result has changed although speed is quick by this change. I think that resizing should be performed by the side which uses nude.py.

original

$ python testnude.py
(False, u"#<nude.Nude:0x105527110('./images/damita.jpg' 'JPEG' '500x375'): result=False message='Total skin parcentage lower than 15 (7.692%)'>")
(False, u"#<nude.Nude:0x10586f990('./images/damita2.jpg' 'JPEG' '500x375'): result=False message='Total skin parcentage lower than 15 (10.047%)'>")
(False, u"#<nude.Nude:0x105527110('./images/test6.jpg' 'JPEG' '500x375'): result=False message='Less than 3 skin regions (1)'>")
(True, u"#<nude.Nude:0x10586fc10('./images/test2.jpg' 'JPEG' '500x375'): result=True message='Nude!!'>")

your PR

$ python testnude.py
(False, u"#<nude.Nude:0x10ef29110('./images/damita.jpg' 'JPEG' '200x150'): result=False message='Less than 3 skin regions (1)'>")
(False, u"#<nude.Nude:0x10f272fd0('./images/damita2.jpg' 'JPEG' '200x150'): result=False message='Total skin parcentage lower than 15 (9.420%)'>")
(False, u"#<nude.Nude:0x10ef29110('./images/test6.jpg' 'JPEG' '200x150'): result=False message='Less than 3 skin regions (2)'>")
(True, u"#<nude.Nude:0x10f272f90('./images/test2.jpg' 'JPEG' '200x150'): result=True message='Nude!!'>")

sorry, my broken english.

hhatto commented 9 years ago

see #4