當前位置: 首頁>>代碼示例>>Python>>正文


Python PIL.__version__方法代碼示例

本文整理匯總了Python中PIL.__version__方法的典型用法代碼示例。如果您正苦於以下問題:Python PIL.__version__方法的具體用法?Python PIL.__version__怎麽用?Python PIL.__version__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PIL的用法示例。


在下文中一共展示了PIL.__version__方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: about

# 需要導入模塊: import PIL [as 別名]
# 或者: from PIL import __version__ [as 別名]
def about(self, *args):
        dialog = Gtk.AboutDialog(transient_for=self)
        dialog.set_logo_icon_name('io.github.ImEditor')
        dialog.set_program_name('ImEditor')
        dialog.set_version('0.9.4')
        dialog.set_website('https://imeditor.github.io')
        dialog.set_authors(['Nathan Seva', 'Hugo Posnic'])
        gtk_version = '{}.{}.{}'.format(Gtk.get_major_version(),
            Gtk.get_minor_version(), Gtk.get_micro_version())
        comment = '{}\n\n'.format(_("Simple & versatile image editor"))
        comment += 'Gtk: {} Pillow: {}'.format(gtk_version, pil_version)
        dialog.set_comments(comment)
        text = _("Distributed under the GNU GPL(v3) license.\n")
        text += 'https://github.com/ImEditor/ImEditor/blob/master/LICENSE\n'
        dialog.set_license(text)
        dialog.run()
        dialog.destroy() 
開發者ID:ImEditor,項目名稱:ImEditor,代碼行數:19,代碼來源:window.py

示例2: handler

# 需要導入模塊: import PIL [as 別名]
# 或者: from PIL import __version__ [as 別名]
def handler(data, context):
    """Handle request.

    Args:
        data (obj): the request data
        context (Context): an object containing request and configuration details

    Returns:
        (bytes, string): data to return to client, (optional) response content type
    """

    # use the imported library
    print('pillow: {}\n{}'.format(PIL.__version__, dir(_imaging)))
    processed_input = _process_input(data, context)
    response = requests.post(context.rest_uri, data=processed_input)
    return _process_output(response, context) 
開發者ID:aws,項目名稱:sagemaker-tensorflow-serving-container,代碼行數:18,代碼來源:inference.py

示例3: check6_bsddb3

# 需要導入模塊: import PIL [as 別名]
# 或者: from PIL import __version__ [as 別名]
def check6_bsddb3(self):
        '''bsddb3 - Python Bindings for Oracle Berkeley DB

        requires Berkeley DB

        PY_BSDDB3_VER_MIN = (6, 0, 1) # 6.x series at least
        '''
        self.append_text("\n")
        # Start check

        try:
            import bsddb3 as bsddb
            bsddb_str = bsddb.__version__  # Python adaptation layer
            # Underlying DB library
            bsddb_db_str = str(bsddb.db.version()).replace(', ', '.')\
                .replace('(', '').replace(')', '')
        except ImportError:
            bsddb_str = 'not found'
            bsddb_db_str = 'not found'

        result = ("* Berkeley Database library (bsddb3: " + bsddb_db_str +
                  ") (Python-bsddb3 : " + bsddb_str + ")")
        # End check
        self.append_text(result) 
開發者ID:gramps-project,項目名稱:addons-source,代碼行數:26,代碼來源:PrerequisitesCheckerGramplet.py

示例4: check_fontconfig

# 需要導入模塊: import PIL [as 別名]
# 或者: from PIL import __version__ [as 別名]
def check_fontconfig(self):
        ''' The python-fontconfig library is used to support the Genealogical
        Symbols tab of the Preferences.  Without it Genealogical Symbols don't
        work '''
        try:
            import fontconfig
            vers = fontconfig.__version__
            if vers.startswith("0.5."):
                result = ("* python-fontconfig " + vers +
                          " (Success version 0.5.x is installed.)")
            else:
                result = ("* python-fontconfig " + vers +
                          " (Requires version 0.5.x)")
        except ImportError:
            result = "* python-fontconfig Not found, (Requires version 0.5.x)"
        # End check
        self.append_text(result)

    #Optional 
開發者ID:gramps-project,項目名稱:addons-source,代碼行數:21,代碼來源:PrerequisitesCheckerGramplet.py

示例5: check23_pedigreechart

# 需要導入模塊: import PIL [as 別名]
# 或者: from PIL import __version__ [as 別名]
def check23_pedigreechart(self):
        '''PedigreeChart - Can optionally use - NumPy if installed

        https://github.com/gramps-project/addons-source/blob/master/PedigreeChart/PedigreeChart.py
        '''
        self.append_text("\n")
        self.render_text("""<b>03. <a href="https://gramps-project.org/wiki"""
                         """/index.php?title=PedigreeChart">"""
                         """Addon:PedigreeChart</a> :</b> """)
        # Start check

        try:
            import numpy
            numpy_ver = str(numpy.__version__)
            #print("numpy.__version__ :" + numpy_ver )
            # NUMPY_check = True
        except ImportError:
            numpy_ver = "Not found"
            # NUMPY_check = False

        result = "(NumPy : " + numpy_ver + " )"
        # End check
        self.append_text(result)
        #self.append_text("\n") 
開發者ID:gramps-project,項目名稱:addons-source,代碼行數:26,代碼來源:PrerequisitesCheckerGramplet.py

示例6: test_pyroma

# 需要導入模塊: import PIL [as 別名]
# 或者: from PIL import __version__ [as 別名]
def test_pyroma(self):
        # Arrange
        data = pyroma.projectdata.get_data(".")

        # Act
        rating = pyroma.ratings.rate(data)

        # Assert
        if "rc" in __version__:
            # Pyroma needs to chill about RC versions and not kill all our tests.
            self.assertEqual(
                rating,
                (9, ["The package's version number does not comply with PEP-386."]),
            )

        else:
            # Should have a near-perfect score
            self.assertEqual(rating, (9, ["Your package does not have license data."])) 
開發者ID:holzschu,項目名稱:python3_ios,代碼行數:20,代碼來源:test_pyroma.py

示例7: __call__

# 需要導入模塊: import PIL [as 別名]
# 或者: from PIL import __version__ [as 別名]
def __call__(self, imgs, point_meta):
    """
    Args:
      img (PIL.Image): Image to be cropped.
      point_meta : Point_Meta
    Returns:
      PIL.Image: Rotated image.
    """
    point_meta = point_meta.copy()
    if isinstance(imgs, list): is_list = True
    else:                      is_list, imgs = False, [imgs]

    degree = (random.random() - 0.5) * 2 * self.max_rotate_degree
    center = (imgs[0].size[0] / 2, imgs[0].size[1] / 2)
    if PIL.__version__[0] == '4':
      imgs = [ img.rotate(degree, center=center) for img in imgs ]
    else:
      imgs = [ img.rotate(degree) for img in imgs ]

    point_meta.apply_rotate(center, degree)
    point_meta.apply_bound(imgs[0].size[0], imgs[0].size[1])

    if is_list == False: imgs = imgs[0]

    return imgs, point_meta 
開發者ID:D-X-Y,項目名稱:landmark-detection,代碼行數:27,代碼來源:transforms.py

示例8: get_lib_versions

# 需要導入模塊: import PIL [as 別名]
# 或者: from PIL import __version__ [as 別名]
def get_lib_versions():
    versions = {}
    #PIL
    try:
        import PIL
        versions["PIL"] = PIL.__version__
    except ImportError:
        versions["PIL"] = "Not found!"

    #PLY
    try:
        from ply import lex
        versions["PLY"] = lex.__version__
    except ImportError:
        versions["PLY"] = "Not found!"

    return versions 
開發者ID:OpenTTD,項目名稱:nml,代碼行數:19,代碼來源:version_info.py

示例9: get_nml_version

# 需要導入模塊: import PIL [as 別名]
# 或者: from PIL import __version__ [as 別名]
def get_nml_version():
    # First check if this is a git repository, and use that version if available.
    # (unless this is a released tarball, see below)
    try:
        from nml import version_update
        version = version_update.get_git_version()
        if version:
            return version
    except ImportError:
        # version_update is excluded from release tarballs,
        #  so that the predetermined version is always used.
        pass

    # No repository was found. Return the version which was saved upon build.
    try:
        from nml import __version__
        version = __version__.version
    except ImportError:
        version = 'unknown'
    return version 
開發者ID:OpenTTD,項目名稱:nml,代碼行數:22,代碼來源:version_info.py

示例10: prepare_logger

# 需要導入模塊: import PIL [as 別名]
# 或者: from PIL import __version__ [as 別名]
def prepare_logger(xargs):
  args = copy.deepcopy( xargs )
  from log_utils import Logger
  logger = Logger(args.save_dir, args.rand_seed)
  logger.log('Main Function with logger : {:}'.format(logger))
  logger.log('Arguments : -------------------------------')
  for name, value in args._get_kwargs():
    logger.log('{:16} : {:}'.format(name, value))
  logger.log("Python  Version  : {:}".format(sys.version.replace('\n', ' ')))
  logger.log("Pillow  Version  : {:}".format(PIL.__version__))
  logger.log("PyTorch Version  : {:}".format(torch.__version__))
  logger.log("cuDNN   Version  : {:}".format(torch.backends.cudnn.version()))
  logger.log("CUDA available   : {:}".format(torch.cuda.is_available()))
  logger.log("CUDA GPU numbers : {:}".format(torch.cuda.device_count()))
  logger.log("CUDA_VISIBLE_DEVICES : {:}".format(os.environ['CUDA_VISIBLE_DEVICES'] if 'CUDA_VISIBLE_DEVICES' in os.environ else 'None'))
  return logger 
開發者ID:D-X-Y,項目名稱:AutoDL-Projects,代碼行數:18,代碼來源:starts.py

示例11: get_pil_version

# 需要導入模塊: import PIL [as 別名]
# 或者: from PIL import __version__ [as 別名]
def get_pil_version():
    return "\n        Pillow ({})".format(PIL.__version__) 
開發者ID:Res2Net,項目名稱:Res2Net-maskrcnn,代碼行數:4,代碼來源:collect_env.py

示例12: get_config_values

# 需要導入模塊: import PIL [as 別名]
# 或者: from PIL import __version__ [as 別名]
def get_config_values():
    """
    Read the package versions into a dictionary.
    """
    output = OrderedDict()

    output["MONAI"] = monai.__version__
    output["Python"] = sys.version.replace("\n", " ")
    output["Numpy"] = np.version.full_version
    output["Pytorch"] = torch.__version__

    return output 
開發者ID:Project-MONAI,項目名稱:MONAI,代碼行數:14,代碼來源:deviceconfig.py

示例13: get_torch_version_tuple

# 需要導入模塊: import PIL [as 別名]
# 或者: from PIL import __version__ [as 別名]
def get_torch_version_tuple():
    """
    Returns:
        tuple of ints represents the pytorch major/minor version.
    """
    return tuple([int(x) for x in torch.__version__.split(".")[:2]]) 
開發者ID:Project-MONAI,項目名稱:MONAI,代碼行數:8,代碼來源:deviceconfig.py

示例14: check17_pillow

# 需要導入模塊: import PIL [as 別名]
# 或者: from PIL import __version__ [as 別名]
def check17_pillow(self):
        '''PILLOW
        Allows Production of jpg images from non-jpg images in LaTeX documents

        #TODO prculley mentions that : And PIL (Pillow) is also used by the
        main Gramps ([]narrativeweb and []other reports for image cropping)
        as well as [x]editexifmetadata and the
        new [x]latexdoc type addons (genealogytree).

        #TODO add check for PILLOW to "gramps -v"  section

        https://github.com/gramps-project/gramps/blob/maintenance/gramps50/gramps/plugins/docgen/latexdoc.py
        '''
        #self.append_text("\n")
        # Start check

        try:
            import PIL
            # from PIL import Image
            try:
                pil_ver = PIL.__version__
            except Exception:
                try:
                    pil_ver = str(PIL.PILLOW_VERSION)
                except Exception:
                    try:
                        #print(dir(PIL))
                        pil_ver = str(PIL.VERSION)
                    except Exception:
                        pil_ver = "Installed but does not supply version"
        except ImportError:
            pil_ver = "Not found"

        result = "(PILLOW " + pil_ver + ")"
        # End check
        self.append_text(result) 
開發者ID:gramps-project,項目名稱:addons-source,代碼行數:38,代碼來源:PrerequisitesCheckerGramplet.py

示例15: collect_env_info

# 需要導入模塊: import PIL [as 別名]
# 或者: from PIL import __version__ [as 別名]
def collect_env_info():
    """Returns env info as a string.

    Code source: github.com/facebookresearch/maskrcnn-benchmark
    """
    from torch.utils.collect_env import get_pretty_env_info
    env_str = get_pretty_env_info()
    env_str += '\n        Pillow ({})'.format(PIL.__version__)
    return env_str 
開發者ID:KaiyangZhou,項目名稱:deep-person-reid,代碼行數:11,代碼來源:tools.py


注:本文中的PIL.__version__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。