class_docstr: python -m pytorch_toolbelt.datasets.providers.inria_aerial inria_dataset
code: def get_kfold_split_train_df(
      self, num_folds: int = 5
  ) -> pd.DataFrame:
      df = pd.DataFrame.from_dict(
          {"images": self.train_images, "masks": self.train_masks}
      )
      df["location_with_index"] = df["images"].apply(
          lambda x: fs.id_from_fname(x)
      )
      df["location"] = df["location_with_index"].apply(
          lambda x: x.rstrip("0123456789")
      )
      df["rows"] = 5000
      df["cols"] = 5000
      df["fold"] = -1
      kfold = GroupKFold(n_splits=num_folds)
      for fold, (train_index, test_index) in enumerate(
          kfold.split(df, df, groups=df["location"])
      ):
          df.loc[test_index, "fold"] = fold
      return df
  
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 9 for calling the InriaAerialImageDataset obj's underlying member method code with example usage: obj.get_kfold_split_train_df(num_folds) and returns: df