Changeset 16399


Ignore:
Timestamp:
Jul 25, 2016, 5:01:10 PM (4 years ago)
Author:
dferreira
Message:

Analyse Images updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • internals/2016/aptoideimagesdetector/trunk/Source Code/Illustration2Vector/illustration2vec_master/analyse_image.py

    r16390 r16399  
    1818def analyse_explicit(illust2vec, image_dir):
    1919
    20         img = Image.open(os.path.join(image_dir))
     20        try:
     21                img = Image.open(os.path.join(image_dir))
     22        except:
     23                print "Could not parse image"
     24                return (('explicit',0.5), ('safe',0.5))
    2125
    2226        list = illust2vec.estimate_specific_tags([img], ["explicit", "safe"])
    2327   
    24         if list[0]['explicit']>list[0]['safe']:
    25                 return ('explicit',list[0]['explicit']) # Explicit
    26         else:
    27                 return ('safe',list[0]['safe']) # Safe
     28        return (('explicit',list[0]['explicit']), ('safe',list[0]['safe']))
    2829
    2930if __name__ == "__main__":
Note: See TracChangeset for help on using the changeset viewer.