hhatto / nude.py

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

Slow performance overall #19

Closed Tatsh closed 5 years ago

Tatsh commented 7 years ago

Performance is kind of random. A 1.9 MiB image of my cat takes about 2 minutes to process (which is really unusable in the context of a web server handling POST data). I profiled this run:

   783201   44.737    0.000   44.739    0.000 .../site-packages/nude.py:147(_add_merge)
     4906   19.164    0.004   19.164    0.004 /usr/lib64/python2.7/copy.py:113(_copy_with_constructor)
        1   18.591   18.591  105.226  105.226 .../site-packages/nude.py:80(parse)
        1   17.738   17.738   36.937   36.937 .../site-packages/nude.py:181(_merge)
 12192768    2.073    0.000    2.073    0.000 {skin_classifier.skin_classifier}
 12192768    1.819    0.000    3.892    0.000 .../site-packages/nude.py:279(_classify_skin)

This is sorted by total time.