volvo-cars / FB-SSEM-dataset

The FB-SSEM dataset is a synthetic datasetconsisting of surround-view fisheye camera images and BEV maps from simulated sequences of ego car motion
Creative Commons Attribution Share Alike 4.0 International
33 stars 7 forks source link

How to get BEV camera config data? #9

Open Light-- opened 4 months ago

Light-- commented 4 months ago

LIke this in the dataset ( xxxx.txt ):

BEVCamera, 7.467841, 40.13262, 2.768845, 90, 0.9908196, 0

ektas0330 commented 4 months ago

The BEV camera config represents the 3D rotation and translation of the BEV camera used to capture the ground truth BEV in the FB-SSEM dataset. Generally, there is no BEV camera in the real world, so there won't be any BEV camera config for your case.

Note that testing the F2BEV model does not require a BEV camera config; the seq_len parameter in the code for testing F2BEV (e.g., line 46 in test_f2bev_attn_st_height.py) is always set to 1, which ensures that a BEV camera config is not required.

Light-- commented 4 months ago

ektas0330

Thanks for your reply. I use my own fisheye images for inference, organize the folder and files like the FB-SSEM-dataset, and already set sql_len to 1, but it still go to read the camera config, more specifically, the bev camera confg (lines[5])

The process will be: construct test_data -> build UnityImageDataset -> call read_config_for_bevposrot() -> read bev cam config

   def read_config_for_bevposrot(self,configdir,filename):
        with open(os.path.join(configdir, filename)) as f:
            lines = f.readlines()
        # will read bev cam config and report error here
        bpos = [float(lines[5].split(',')[1]),float(lines[5].split(',')[2]),float(lines[5].split(',')[3])] 
        brot = [float(lines[5].split(',')[4]),float(lines[5].split(',')[5]),float(lines[5].split(',')[6])]
        return [bpos,brot]

error :

Traceback (most recent call last):
  File "test_f2bev_attn_st_height.py", line 155, in <module>
    test_temporal(test_dataloader,seq_len,model,loss,all_images)
  File "test_f2bev_attn_st_height.py", line 99, in test_temporal
    for batch_idx, (dataseq, targetseq) in enumerate(tqdm(test_dataloader)):
  File "/home/data2/conda/envs/f2bev/lib/python3.7/site-packages/tqdm/std.py", line 1195, in __iter__
    for obj in iterable:
  File "/home/data2/conda/envs/f2bev/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 628, in __next__
    data = self._next_data()
  File "/home/data2/conda/envs/f2bev/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 671, in _next_data
    data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
  File "/home/data2/conda/envs/f2bev/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 58, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/data2/conda/envs/f2bev/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 58, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/traindata/FB-SSEM-dataset/F2BEV_code/F2BEV/test_loader_single_task.py", line 171, in __getitem__
    [bpos,brot] = self.read_config_for_bevposrot(config_dir,image_list[cidx].split('.')[0]+'.txt')
  File "/home/traindata/FB-SSEM-dataset/F2BEV_code/F2BEV/test_loader_single_task.py", line 114, in read_config_for_bevposrot
    bpos = [float(lines[5].split(',')[1]),float(lines[5].split(',')[2]),float(lines[5].split(',')[3])]
IndexError: list index out of range