from modules.scene.train_ert import ERTTrainer
from nerfstudio.utils.eval_utils import eval_setup
from pathlib import Path
import time
import gc
import torch
from threading import Thread

def create_nerfstudio_data():
  recon_path = R"D:\Datasets\ert\csi_rear\ert_runs\csi_rear\config.yml"
  config, pipeline, a, b = eval_setup(
              Path(recon_path),
              test_mode="inference",
          )
  # del config
  # del pipeline
  #dm = pipeline.datamanager
  # print(dm.train_dataset)
  

if __name__ == '__main__':
  
  thread = Thread(target=create_nerfstudio_data)
  thread.run()

  # num = gc.collect()
  # print(num)
  torch.cuda.empty_cache()
  while True:
    time.sleep(0.1)