Commit 93847a07 authored by oscar's avatar oscar

提交时间的打印

parent 8e23ce03
...@@ -11,11 +11,14 @@ from scipy.spatial.transform import Rotation as R ...@@ -11,11 +11,14 @@ from scipy.spatial.transform import Rotation as R
import cv2 import cv2
from scipy.spatial import Delaunay from scipy.spatial import Delaunay
import scipy import scipy
import time
if __name__ == '__main__': if __name__ == '__main__':
ticks = time.time()
str_time = time.strftime("%Y-%m-%d_%H:%M:%S", time.localtime())
ticks2 = time.time()
delay = ticks2 - ticks
str = "10_1/pcd/1629734723.170913000.pcd" str = "10_1/pcd/1629734723.170913000.pcd"
print(str.split('/')) print(str.split('/'))
str1 = str.split('/')[-1] str1 = str.split('/')[-1]
......
...@@ -20,6 +20,7 @@ from utils.compute_yaw import compute_yaw,car_yaw_cal ...@@ -20,6 +20,7 @@ from utils.compute_yaw import compute_yaw,car_yaw_cal
from seg_ww_ground import ground_segmentation from seg_ww_ground import ground_segmentation
import threading import threading
import time
def compute_pitch(A,B,C): def compute_pitch(A,B,C):
origin_direction = [0,0,1] origin_direction = [0,0,1]
...@@ -736,7 +737,7 @@ if __name__ == '__main__': ...@@ -736,7 +737,7 @@ if __name__ == '__main__':
# generate_root_path = "/media/sf_shared/5-3/" # generate_root_path = "/media/sf_shared/5-3/"
origin_root_path = "/host/home/sata2/datasets/N19_annotations/" #读取数据的总目录 origin_root_path = "/host/home/sata2/datasets/N19_annotations/" #读取数据的总目录
base_root_path = "/host/home/sata2/oscar/jfxmap_python/script/generate/" base_root_path = "/host/home/sata2/oscar/jfxmap_python/script/generate/"
generate_root_path = "/host/home/sata2/oscar/jfxmap_python/script/generate/" generate_root_path = "/host/home/sata2/datasets/N19_annotations/generate/"
# generate_car_yaw_cal_angle = 79.89299572540227 # generate_car_yaw_cal_angle = 79.89299572540227
# p_dir = "/home/oscar/ros/git/jfxmap_python/jfxmap/" # p_dir = "/home/oscar/ros/git/jfxmap_python/jfxmap/"
p_dir = "/host/home/sata2/oscar/jfxmap_python/jfxmap/" p_dir = "/host/home/sata2/oscar/jfxmap_python/jfxmap/"
...@@ -748,6 +749,12 @@ if __name__ == '__main__': ...@@ -748,6 +749,12 @@ if __name__ == '__main__':
generate_root_path = "/media/sf_shared/generate/" generate_root_path = "/media/sf_shared/generate/"
p_dir = "/home/oscar/ros/git/jfxmap_python/jfxmap/" p_dir = "/home/oscar/ros/git/jfxmap_python/jfxmap/"
str_time = time.strftime("%Y-%m-%d_%H:%M:%S", time.localtime())
base_root_path = os.path.join(base_root_path, str_time)
os.mkdir(base_root_path)
start_t = time.time()
time_record = []
f_path = "./maps/qichecheng/mapconfig.json" f_path = "./maps/qichecheng/mapconfig.json"
ret = init_jfxmap(p_dir,f_path) ret = init_jfxmap(p_dir,f_path)
print(ret) print(ret)
...@@ -782,6 +789,7 @@ if __name__ == '__main__': ...@@ -782,6 +789,7 @@ if __name__ == '__main__':
dir_pcd_list[dir].append(anno) dir_pcd_list[dir].append(anno)
for dir_g in dirs_g: for dir_g in dirs_g:
begin_t = time.time()
base_dir_path = os.path.join(base_root_path,dir_g) base_dir_path = os.path.join(base_root_path,dir_g)
pcd_list = glob.glob(os.path.join(base_dir_path,"*.pcd")) pcd_list = glob.glob(os.path.join(base_dir_path,"*.pcd"))
if len(pcd_list) <= 0 : if len(pcd_list) <= 0 :
...@@ -878,7 +886,16 @@ if __name__ == '__main__': ...@@ -878,7 +886,16 @@ if __name__ == '__main__':
with open(count_jsn_path,'w') as file_o: with open(count_jsn_path,'w') as file_o:
json.dump(cloud_box_count,file_o,cls=NumpyEncoder,indent=4) json.dump(cloud_box_count,file_o,cls=NumpyEncoder,indent=4)
delay_t = time.time() - begin_t
record_t = { "folder": dir_g,"time":delay_t}
time_record.append(record_t)
totel_t = time.time() - start_t
totel_info = {"totel_time": totel_t}
time_record.append(totel_info)
totel_time_file = os.path.join(base_root_path,"totel_time.json")
with open(totel_time_file,'w') as file_o:
json.dump(time_record,file_o,cls=NumpyEncoder,indent=4)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment