RADIal
RADIal copied to clipboard
A question about the label file
Hi all, can someone help me to figure out the following questions? Thank you in advance!
- There's a 'labels_CVPR.csv' file(24180 rows) in the raw data and there's a 'labels.csv' file(10662 rows) in the ready-to-use data. Can someone tell me the difference between them? I think 'labels.csv' file corresponds to the 8252 labeled frames, but I can't figure out the other one.
- In 'loader/example_dataset.ipynb', when drawing the radar point cloud and lidar point cloud, it multiplies '-1' as following, but the corresponding label doesn't multiply '-1' in drawing, does some know what is this for?
plt.plot(-radar_pc[:,1],radar_pc[:,0],'.')
plt.plot(-laser_pc[:,1],laser_pc[:,0],'.')
Hi there,
Have u had the idea that what "labels_CVPR.csv" provides?
I have been using this label file to draw the correspondense of label information and raw data information. However, the results seems unmatched. My code is showed below:
# radar decoder
RSP = RadarSignalProcessing('/data/RADIal/SignalProcessing/CalibrationTable.npy',method='RA',device='cpu') #,lib='PyTorch')
coordTF = CoordTransform(carte_reso)
# --------------
# traverse label file to create dataset index file
# --------------
import pandas as pd
target_label_path = root_datapath+'/labels_CVPR.csv'
df = pd.read_csv(target_label_path, skipinitialspace=True)
# 按照 'numSample' 列分组,并将每个组转换为一个数据框,然后将这些数据框放入一个列表中, by GPT
# 0 numSample 1 x1_pix 2 y1_pix 3 x2_pix 4 y2_pix 5 laser_X_m 6 laser_Y_m 7 radar_X_m
# 8 radar_Y_m 9 radar_R_m 10 radar_A_deg 11 radar_D_mps 12 radar_P_db
# 13 dataset 14 index 15 Annotation 16 Difficult
# 按照数据集文件夹分类
dataset_infos = [group for _, group in df.groupby('dataset')]
for info in dataset_infos:
# 取到不同的文件夹
dirs = info['dataset'].values
label_numSamples = list(set(info['numSample'].values))
label_index = list(set(info['index'].values))
targets = info.values[...,9:11] # 9: radar range, 10: radar angle
targets_infos = [group.values[:,:13].astype(np.float) for _, group in info.groupby('numSample')]
# 判断读到的dataset都是来自同一个文件名的,且标注信息中不存在无效信息
if len(set(dirs)) != 1 or -1 in info['x1_pix'].values:
logger.info("xxxxxxxxxxxxxxxxx_{}_xxxxxxxxxxxxxxxxxxxxx".format(cnt))
logger.error("skip this data pack: "+dir)
logger.info("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
continue
else:
dir = dirs[0]
logger.info("###############_{}_#################".format(cnt))
logger.info("reading this data pack: "+dir)
logger.info("#####################################")
# Check if the directory name contains 'RECORD'
if 'RECORD' in dir:
# Construct the path to the target data
root = root_datapath
data_target_path = os.path.join(root, dir)
# Create a SyncReader object for the data
if os.path.exists(data_target_path):
db = SyncReader(data_target_path)
else:
logger.error(f"Path {data_target_path} does not exist.")
continue
db.print_info()
# Create an iterator on the dataset
# ite = iter(db)
cnt_dataset = 0
logger.info("reading folder: {}".format(data_target_path))
# Iterate through the entire dataset
for i in label_index:
try:
# data=next(ite)
data = db.GetSensorData(i)
except:
logger.error(f"Failed to read {str(cnt)}th data from {data_target_path}.")
continue
The correspondense result video are showed in this URL
A shortcut shows as:
The red dot and blue dot are labeling radar and LiDAR position of object from label_CVPR.csv. From the video we can see that the labeling does not match with raw data. Why is this happend? Is there any error in my code or I have the wrong understanding of the label file?