From 27f8ce7846d1b6437d3775c44ce57c088edb3dec Mon Sep 17 00:00:00 2001 From: Gduret <guillaume.duret@ec-lyon.fr> Date: Thu, 2 Mar 2023 18:23:33 +0100 Subject: [PATCH] add high quality --- compute_features.py | 3 +-- main.py | 18 +++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/compute_features.py b/compute_features.py index 8033155..7367d1e 100644 --- a/compute_features.py +++ b/compute_features.py @@ -18,6 +18,7 @@ def process_compute(data_name, camera, camera_resized, new_size, Nb_camera, Worl [1.0000000, 0.0000000, 0.0000000]]) list_count_categories = {} + for i in range(World_begin, World_begin + Nb_world): # worlds catergories_instance_array_id_to_cat, catergories_instance_array_cat_to_id, catergories_label_to_id = compute_categories_id(data_name, i) @@ -86,9 +87,7 @@ def process_compute(data_name, camera, camera_resized, new_size, Nb_camera, Worl f.write(json.dumps(feeds, indent=4)) if (Nb_instance == 1): - for k in range(len(data_3D_pose)): - if data_3D_pose[k]['id'] == catergories_occ_array[categories][0]: rpy = data_3D_pose[k]['pose']['rpy'] rot = convert2(rpy) diff --git a/main.py b/main.py index 5b3349a..70878ad 100644 --- a/main.py +++ b/main.py @@ -50,7 +50,7 @@ if __name__ == '__main__': Nb_instance = 1 occ_target = 0.5 dataset_src = "/media/gduret/DATA/dataset/s2rg/Fruits_all_medium/data" - choice = "low" # depth of rgb resolution datas + choice = "high" # depth of rgb resolution datas data_options = {"high": "ground_truth_rgb", "low": "ground_truth_depth"} dataset_type = data_options[choice] @@ -64,17 +64,21 @@ if __name__ == '__main__': camera = np.matrix([[1386.4138492513919, 0.0, 960.5], [0.0, 1386.4138492513919, 540.5], [0.0, 0.0, 1.0]]) - else: + # (640/1920 = 1 / 3), (480/1080 = 4 / 9) + trans = np.matrix([[1 / 3, 0.0, 0.0], + [0.0, (4 / 9), 0.0], + [0.0, 0.0, 1.0]]) + elif choice == 'low': camera = np.matrix([[1086.5054444841007, 0.0, 640.5], [0.0, 1086.5054444841007, 360.5], [0.0, 0.0, 1.0]]) + # + trans = np.matrix([[0.5, 0.0, 0.0], + [0.0, (2 / 3), 0.0], + [0.0, 0.0, 1.0]]) new_size = (640, 480) - trans = np.matrix([[0.5, 0.0, 0.0], - [0.0, (2 / 3), 0.0], - [0.0, 0.0, 1.0]]) - new_camera = trans @ camera np.savetxt(f'{dataset_name}/Generated/camera_{choice}.txt', camera) @@ -107,5 +111,5 @@ if __name__ == '__main__': bbox = get_3D_bbox(ext) np.savetxt(f'{dataset_name}/Generated/{categories}/{categories}_bbox_3d.txt', bbox) # save - process_compute(dataset_name, camera, new_camera, new_size, Nb_camera, args.World_begin, args.Nb_worlds, list_categories, occ_target, False) + process_compute(dataset_name, camera, new_camera, new_size, Nb_camera, args.World_begin, args.Nb_worlds, list_categories, occ_target, True) -- GitLab