class_docstr: Original S3DIS dataset. Each area is loaded individually and can be processed using a pre_collate transform. 
  This transform can be used for example to fuse the area into a single space and split it into 
  spheres or smaller regions. If no fusion is applied, each element in the dataset is a single room by default.
  
  http://buildingparser.stanford.edu/dataset.html
  
  Parameters
  ----------
  root: str
      path to the directory where the data will be saved
  test_area: int
      number between 1 and 6 that denotes the area used for testing
  split: str
      can be one of train, trainval, val or test
  pre_collate_transform:
      Transforms to be applied before the data is assembled into samples (apply fusing here for example)
  keep_instance: bool
      set to True if you wish to keep instance data
  pre_transform
  transform
  pre_filter
class_docstr_tok: ["Original","S3DIS","dataset",".","Each","area","is","loaded","individually","and","can","be","processed","using","a","pre_collate","transform",".","This","transform","can","be","used","for","example","to","fuse","the","area","into","a","single","space","and","split","it","into","spheres","or","smaller","regions",".","If","no","fusion","is","applied",",","each","element","in","the","dataset","is","a","single","room","by","default",".","http",":","\/\/buildingparser.stanford.edu\/dataset.html","Parameters","--","--","--","--","--","root",":","str","path","to","the","directory","where","the","data","will","be","saved","test_area",":","int","number","between","1","and","6","that","denotes","the","area","used","for","testing","split",":","str","can","be","one","of","train",",","trainval",",","val","or","test","pre_collate_transform",":","Transforms","to","be","applied","before","the","data","is","assembled","into","samples","(","apply","fusing","here","for","example",")","keep_instance",":","bool","set","to","True","if","you","wish","to","keep","instance","data","pre_transform","transform","pre_filter"]
code: def process(self):
      if not os.path.exists(self.pre_processed_path):
          train_areas = [
              f for f in self.folders if str(self.test_area) not in f
          ]
          test_areas = [
              f for f in self.folders if str(self.test_area) in f
          ]
  
          train_files = [
              (f, room_name, osp.join(self.raw_dir, f, room_name))
              for f in train_areas
              for room_name in os.listdir(osp.join(self.raw_dir, f))
              if os.path.isdir(osp.join(self.raw_dir, f, room_name))
          ]
  
          test_files = [
              (f, room_name, osp.join(self.raw_dir, f, room_name))
              for f in test_areas
              for room_name in os.listdir(osp.join(self.raw_dir, f))
              if os.path.isdir(osp.join(self.raw_dir, f, room_name))
          ]
  
          # Gather data per area
          data_list = [[] for _ in range(6)]
          if self.debug:
              areas = np.zeros(7)
          for area, room_name, file_path in tq(
              train_files + test_files
          ):
              if self.debug:
                  area_idx = int(area.split("_")[-1])
                  if areas[area_idx] == 5:
                      continue
                  else:
                      print(area_idx)
                      areas[area_idx] += 1
  
              area_num = int(area[-1]) - 1
              if self.debug:
                  read_s3dis_format(
                      file_path,
                      room_name,
                      label_out=True,
                      verbose=self.verbose,
                      debug=self.debug,
                  )
                  continue
              else:
                  (
                      xyz,
                      rgb,
                      semantic_labels,
                      instance_labels,
                      room_label,
                  ) = read_s3dis_format(
                      file_path,
                      room_name,
                      label_out=True,
                      verbose=self.verbose,
                      debug=self.debug,
                  )
  
                  rgb_norm = rgb.float() / 255.0
                  data = Data(pos=xyz, y=semantic_labels, rgb=rgb_norm)
                  if room_name in VALIDATION_ROOMS:
                      data.validation_set = True
                  else:
                      data.validation_set = False
  
                  if self.keep_instance:
                      data.instance_labels = instance_labels
  
                  if (
                      self.pre_filter is not None
                      and not self.pre_filter(data)
                  ):
                      continue
  
                  data_list[area_num].append(data)
  
          raw_areas = cT.PointCloudFusion()(data_list)
          for i, area in enumerate(raw_areas):
              torch.save(area, self.raw_areas_paths[i])
  
          for area_datas in data_list:
              # Apply pre_transform
              if self.pre_transform is not None:
                  for data in area_datas:
                      data = self.pre_transform(data)
          torch.save(data_list, self.pre_processed_path)
      else:
          data_list = torch.load(self.pre_processed_path)
  
      if self.debug:
          return
  
      train_data_list = {}
      val_data_list = {}
      trainval_data_list = {}
      for i in range(6):
          if i != self.test_area - 1:
              train_data_list[i] = []
              val_data_list[i] = []
              for data in data_list[i]:
                  validation_set = data.validation_set
                  del data.validation_set
                  if validation_set:
                      val_data_list[i].append(data)
                  else:
                      train_data_list[i].append(data)
              trainval_data_list[i] = (
                  val_data_list[i] + train_data_list[i]
              )
  
      train_data_list = list(train_data_list.values())
      val_data_list = list(val_data_list.values())
      trainval_data_list = list(trainval_data_list.values())
      test_data_list = data_list[self.test_area - 1]
  
      if self.pre_collate_transform:
          log.info("pre_collate_transform ...")
          log.info(self.pre_collate_transform)
          train_data_list = self.pre_collate_transform(train_data_list)
          val_data_list = self.pre_collate_transform(val_data_list)
          test_data_list = self.pre_collate_transform(test_data_list)
          trainval_data_list = self.pre_collate_transform(
              trainval_data_list
          )
  
      self._save_data(
          train_data_list,
          val_data_list,
          test_data_list,
          trainval_data_list,
      )
  
imports: import os
  import os.path
  from itertools import repeat, product
  import numpy
  import h5py
  import torch
  import random
  import glob
  from plyfile import PlyData, PlyElement
  from torch_geometric.data import InMemoryDataset, Data, extract_zip, Dataset
  from torch_geometric.data.dataset import files_exist
  from torch_geometric.data import DataLoader
  from torch_geometric.datasets import S3DIS
  import torch_geometric.transforms
  import logging
  from sklearn.neighbors import NearestNeighbors, KDTree
  from tqdm.auto import tqdm
  import csv
  import pandas
  import pickle
  import gdown
  import shutil
  from torch_points3d.datasets.samplers import BalancedRandomSampler
  import torch_points3d.core.data_transform
  from torch_points3d.datasets.base_dataset import BaseDataset
label_desc: Use image node_id 10 for calling the S3DISOriginalFused obj's underlying member method code with example usage: obj.process() without return types