Changeset 16390


Ignore:
Timestamp:
Jul 25, 2016, 11:39:40 AM (3 years ago)
Author:
dferreira
Message:

Text categorization changed

Location:
internals/2016/aptoideimagesdetector/trunk/Source Code/Illustration2Vector/illustration2vec-master
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • internals/2016/aptoideimagesdetector/trunk/Source Code/Illustration2Vector/illustration2vec-master/analyse_image.py

    r16326 r16390  
    11# Diogo Ferreira
    22# Aptoide, 2016
    3 # This script analyses a list of images, printing the output safe/explicit.
     3# This script analyses a list of images, printing the output safe/explicit and its percentage.
    44# As argument passed in the command line sould be the name of all files wanted to analyse.
    55# For example, python analyse_image.py aptoide_images/nude/1.jpg
    66
    7 
    8 import i2v
     7try:
     8        import Illustration2Vector.illustration2vec_master.i2v
     9except:
     10        import i2v
    911from PIL import Image
    1012import os
     
    2123   
    2224        if list[0]['explicit']>list[0]['safe']:
    23                 print "explicit"
     25                return ('explicit',list[0]['explicit']) # Explicit
    2426        else:
    25                 print "safe"
     27                return ('safe',list[0]['safe']) # Safe
    2628
    2729if __name__ == "__main__":
  • internals/2016/aptoideimagesdetector/trunk/Source Code/Illustration2Vector/illustration2vec-master/i2v/__init__.py

    r16289 r16390  
    1 from i2v.base import Illustration2VecBase
     1try:
     2        from Illustration2Vector.illustration2vec_master.i2v.base import Illustration2VecBase
     3except:
     4        from i2v.base import Illustration2VecBase
    25
    36caffe_available = False
     
    58
    69try:
    7     from i2v.caffe_i2v import CaffeI2V, make_i2v_with_caffe
     10    from Illustration2Vector.illustration2vec_master.i2v.caffe_i2v import CaffeI2V, make_i2v_with_caffe
    811    caffe_available = True
    912except ImportError:
     
    1114
    1215try:
     16    from Illustration2Vector.illustration2vec_master.i2v.chainer_i2v import ChainerI2V, make_i2v_with_chainer
     17    chainer_available = True
     18except ImportError:
    1319    from i2v.chainer_i2v import ChainerI2V, make_i2v_with_chainer
    1420    chainer_available = True
    15 except ImportError:
    16     pass
    1721
    1822if not any([caffe_available, chainer_available]):
Note: See TracChangeset for help on using the changeset viewer.