04_01.float

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<style type="text/css">
		.a{width: 200px;height: 200px;background: red;float: left;}
			.a1{width: 150px;height: 150px;background: yellow;}
		.b{width: 300px;height: 300px;background: blue;}
			.b1{width: 250px;height: 220px;background: green;}
		
	</style>
</head>
<body>
	<div class="a">diva
		<div class="a1">diva1</div>
	</div>
	<div class="b">
		divb
		<div class="b1">divb1</div>
	</div>
	div.a浮动之后,提高半个层级(比同级div.b高,但是和div.b内的所有文字是同级的)
</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个Python脚本,可以将KITTI raw data格式中的3D目标框单个tracklet_labels.xml文件和打开对应frame_list.txt文件对应点云列表解析为paddle3D训练格式多个txt: ```python import os import xml.etree.ElementTree as ET from tqdm import tqdm # 读取frame_list.txt文件 def get_frame_list(txt_path): frame_list = [] with open(txt_path, 'r') as f: for line in f: frame_list.append(line.strip()) return frame_list # 解析tracklet_labels.xml文件 def parse_xml(xml_path): tree = ET.parse(xml_path) root = tree.getroot() objects = [] for tracklet in root.findall('tracklet'): object_dict = {} object_dict['frame'] = int(tracklet.attrib['frame']) object_dict['id'] = int(tracklet.attrib['id']) for item in tracklet: if item.tag == 'objectType': object_dict['class'] = item.text elif item.tag == 'h': object_dict['h'] = float(item.text) elif item.tag == 'w': object_dict['w'] = float(item.text) elif item.tag == 'l': object_dict['l'] = float(item.text) elif item.tag == 't': object_dict['tx'] = float(item.attrib['x']) object_dict['ty'] = float(item.attrib['y']) object_dict['tz'] = float(item.attrib['z']) elif item.tag == 'poses': object_dict['ry'] = float(item.attrib['r_y']) objects.append(object_dict) return objects # 将解析后的结果写入txt文件 def write_txt(objects, txt_path): with open(txt_path, 'w') as f: for obj in objects: line = '{} {} {} {} {} {} {} {} {}\n'.format(obj['frame'], obj['tx'], obj['ty'], obj['tz'], obj['l'], obj['w'], obj['h'], obj['ry'], obj['class']) f.write(line) if __name__ == '__main__': data_dir = '/path/to/kitti/raw/data' output_dir = '/path/to/paddle3D/training/data' sequences = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10'] for seq in sequences: # 获取当前序列的目录路径 seq_dir = os.path.join(data_dir, 'sequences', seq) # 获取当前序列的点云列表 frame_list = get_frame_list(os.path.join(seq_dir, 'image_2', 'frame_list.txt')) # 遍历当前序列的每一帧,解析对应的xml文件并将结果写入txt文件 for frame in tqdm(frame_list): frame_idx = int(frame.split('.')[0]) xml_path = os.path.join(seq_dir, 'label_02', '{}.xml'.format(str(frame_idx).zfill(6))) objects = parse_xml(xml_path) txt_path = os.path.join(output_dir, 'training', seq, 'txt', '{}.txt'.format(str(frame_idx).zfill(6))) write_txt(objects, txt_path) ``` 请根据实际情况修改`data_dir`和`output_dir`变量,以及序列列表`sequences`。此外,还需要安装`xml.etree.ElementTree`、`tqdm`等Python库。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值