Skip to content
Snippets Groups Projects
Commit 8e3536c6 authored by Mahmoud Ahmed Ali's avatar Mahmoud Ahmed Ali
Browse files

Add prepare dataset file

parent 3ad58c36
No related branches found
No related tags found
No related merge requests found
import shutil
def reform_data(src, data_name, data_option):
k = 0
for i in range(1, 1000):
g = 0
for j in range(1, 6):
count = (k*5) + g
if data_option == "ground_truth_rgb":
src_img = f"{src}/{i}/grabber_{j}/color/image/0_0.png"
dst_img = f"{data_name}/RGB/{count}.png"
else:
src_img = f"{src}/{i}/grabber_{j}/depth/image/0_0.png"
dst_img = f"{data_name}/RGB/{count}.png"
shutil.copy(src_img, dst_img)
src_mask = f"{src}/{i}/grabber_{j}/{data_option}/semantic_map/0_0.png"
dst_mask = f"{data_name}/Mask/{count}.png"
shutil.copy(src_mask, dst_mask)
src_path_pose = f"{src}/{i}/grabber_{j}/{data_option}/3d_pose/0_0.json"
dst_path_pose = f"{data_name}/Pose/{count}.json"
shutil.copy(src_path_pose, dst_path_pose)
src_depth = f"{src}/{i}/grabber_{j}/depth/depth_map/0_0.tiff"
dst_depth = f"{data_name}/Depth/{count}.tiff"
shutil.copy(src_depth, dst_depth)
src_bbox = f"{src}/{i}/grabber_{j}/{data_option}/2d_detection/0_0.json"
dst_bbox = f"{data_name}/Bbox_2d/{count}.json"
shutil.copy(src_bbox, dst_bbox)
g += 1
k += 1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment