Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

speedup #3

Closed
wants to merge 2 commits into from
Closed

speedup #3

wants to merge 2 commits into from

Conversation

randm-prgrmr
Copy link

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

making image a thumbnail before analyzing makes the analysis part of the code run in constant time since all images are now 200x200 instead of 1400x2000 or 3600x4800 or whatever

on the small test images, 10x speedup, on larger 1000x1000 images, 30x+ speedup

using thumbnail smaller than ~200x200 starts affecting results (not passing some tests etc)
@hhatto
Copy link
Owner

hhatto commented Aug 20, 2014

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
Copy link
Owner

hhatto commented Nov 10, 2014

see #4

@hhatto hhatto closed this Nov 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants