docstr: Static method for converting image objects or image-like objects to an image File value object.
  
  This way you can upload `Matplotlib` figures, `Seaborn` figures, `PIL` images, `NumPy` arrays, as static images.
  
  Args:
      image: Image-like object to be converted.
          Supported are `PyTorch` tensors, `TensorFlow/Keras` tensors, `NumPy` arrays, `PIL` images,
          `Matplotlib` figures and `Seaborn` figures.
  
  Returns:
      ``File``: value object with converted image
  
  Examples:
      >>> import neptune
      >>> from neptune.types import File
      >>> run = neptune.init_run()
  
      Convert NumPy array to File value object and upload it
  
      >>> run["train/prediction_example"].upload(File.as_image(numpy_array))
  
      Convert PIL image to File value object and upload it
  
      >>> pil_file = File.as_image(pil_image)
      >>> run["dataset/data_sample/img1"].upload(pil_file)
  
      You can upload PIL image without explicit conversion
  
      >>> run["dataset/data_sample/img2"].upload(pil_image)
  
  You may also want to check `as_image docs page`_.
  
  .. _as_image docs page:
     https://docs.neptune.ai/api/field_types#as_image
docstr_tok: ["Static","method","for","converting","image","objects","or","image-like","objects","to","an","image","File","value","object",".","This","way","you","can","upload","`","Matplotlib","`","figures",",","`","Seaborn","`","figures",",","`","PIL","`","images",",","`","NumPy","`","arrays",",","as","static","images",".","Args",":","image",":","Image-like","object","to","be","converted",".","Supported","are","`","PyTorch","`","tensors",",","`","TensorFlow\/Keras","`","tensors",",","`","NumPy","`","arrays",",","`","PIL","`","images",",","`","Matplotlib","`","figures","and","`","Seaborn","`","figures",".","Returns",":","``","File","``",":","value","object","with","converted","image","Examples",":",">",">",">","import","neptune",">",">",">","from","neptune.types","import","File",">",">",">","run","=","neptune.init_run","(",")","Convert","NumPy","array","to","File","value","object","and","upload","it",">",">",">","run","[","``","train\/prediction_example","''","]",".upload","(","File.as_image","(","numpy_array",")",")","Convert","PIL","image","to","File","value","object","and","upload","it",">",">",">","pil_file","=","File.as_image","(","pil_image",")",">",">",">","run","[","``","dataset\/data_sample\/img1","''","]",".upload","(","pil_file",")","You","can","upload","PIL","image","without","explicit","conversion",">",">",">","run","[","``","dataset\/data_sample\/img2","''","]",".upload","(","pil_image",")","You","may","also","want","to","check","`","as_image","docs","page","`","_",".","..","_as_image","docs","page",":","https",":","\/\/docs.neptune.ai\/api\/field_types","#","as_image"]
code: def as_image(image) -> "File":
      """Static method for converting image objects or image-like objects to an image File value object.
  
      This way you can upload `Matplotlib` figures, `Seaborn` figures, `PIL` images, `NumPy` arrays, as static images.
  
      Args:
          image: Image-like object to be converted.
              Supported are `PyTorch` tensors, `TensorFlow/Keras` tensors, `NumPy` arrays, `PIL` images,
              `Matplotlib` figures and `Seaborn` figures.
  
      Returns:
          ``File``: value object with converted image
  
      Examples:
          >>> import neptune
          >>> from neptune.types import File
          >>> run = neptune.init_run()
  
          Convert NumPy array to File value object and upload it
  
          >>> run["train/prediction_example"].upload(File.as_image(numpy_array))
  
          Convert PIL image to File value object and upload it
  
          >>> pil_file = File.as_image(pil_image)
          >>> run["dataset/data_sample/img1"].upload(pil_file)
  
          You can upload PIL image without explicit conversion
  
          >>> run["dataset/data_sample/img2"].upload(pil_image)
  
      You may also want to check `as_image docs page`_.
  
      .. _as_image docs page:
         https://docs.neptune.ai/api/field_types#as_image
      """
      content_bytes = get_image_content(image)
      return File.from_content(
          content_bytes if content_bytes is not None else b"",
          extension="png",
      )
  
imports: from io import IOBase
  from typing import TYPE_CHECKING, Optional, TypeVar, Union
  from neptune.internal.types.file_types import FileComposite, InMemoryComposite, LocalFileComposite, StreamComposite
  from neptune.internal.utils import verify_type
  from neptune.internal.utils.images import get_html_content, get_image_content, get_pickle_content, is_altair_chart, is_bokeh_figure, is_matplotlib_figure, is_numpy_array, is_pandas_dataframe, is_pil_image, is_plotly_figure, is_seaborn_figure
  from neptune.types.atoms.atom import Atom
label_desc: Use image node_id 12 for calling the File obj's underlying member method code with example usage: obj.as_image(image) and returns: File