class_docstr: python -m pytorch_toolbelt.datasets.providers.inria_aerial inria_dataset
code: def read_tiff(
      cls,
      image_fname: str,
      crop_coords: Optional[
          Tuple[Tuple[int, int], Tuple[int, int]]
      ] = None,
  ) -> np.ndarray:
      import rasterio
      from rasterio.windows import Window
  
      window = None
      if crop_coords is not None:
          (row_start, row_stop), (col_start, col_stop) = crop_coords
          window = Window.from_slices(
              (row_start, row_stop), (col_start, col_stop)
          )
  
      if not os.path.isfile(image_fname):
          raise FileNotFoundError(image_fname)
  
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore", category=rasterio.errors.NotGeoreferencedWarning
          )
  
          with rasterio.open(image_fname) as f:
              image = f.read(window=window)
              image = np.moveaxis(image, 0, -1)  # CHW->HWC
              if image.shape[2] == 1:
                  image = np.squeeze(image, axis=2)
              return image
  
imports: import os
  import subprocess
  import warnings
  from pathlib import Path
  from typing import Union, Optional, Tuple
  import hashlib
  import numpy
  import pandas
  import torch
  import zipfile
  from sklearn.model_selection import GroupKFold
  from pytorch_toolbelt.utils import fs
label_desc: Use image node_id 4 for calling the InriaAerialImageDataset obj's underlying member method code with example usage: obj.read_tiff(cls, image_fname, crop_coords) and returns: image