Compare commits
2 Commits
c55a398b6d
...
64b22fd0f4
Author | SHA1 | Date | |
---|---|---|---|
64b22fd0f4 | |||
b18c1591b7 |
@ -7,12 +7,21 @@ runner:
|
|||||||
name: debug
|
name: debug
|
||||||
root_dir: experiments
|
root_dir: experiments
|
||||||
generate:
|
generate:
|
||||||
|
<<<<<<< HEAD
|
||||||
|
port: 5002
|
||||||
|
from: 600
|
||||||
|
to: -1 # -1 means all
|
||||||
|
object_dir: /media/hofee/data/data/object_meshes_part1
|
||||||
|
table_model_path: "/media/hofee/data/data/others/table.obj"
|
||||||
|
output_dir: /media/hofee/repository/data_part_1
|
||||||
|
=======
|
||||||
port: 5000
|
port: 5000
|
||||||
from: 0
|
from: 0
|
||||||
to: -1 # -1 means all
|
to: -1 # -1 means all
|
||||||
object_dir: H:\\AI\\Datasets\\object_meshes_part2
|
object_dir: H:\\AI\\Datasets\\object_meshes_part2
|
||||||
table_model_path: "H:\\AI\\Datasets\\table.obj"
|
table_model_path: "H:\\AI\\Datasets\\table.obj"
|
||||||
output_dir: C:\\Document\\Datasets\\nbv_rec_part2
|
output_dir: C:\\Document\\Datasets\\nbv_rec_part2
|
||||||
|
>>>>>>> c55a398b6d5c347497b528bdd460e26ffdd184e8
|
||||||
binocular_vision: true
|
binocular_vision: true
|
||||||
plane_size: 10
|
plane_size: 10
|
||||||
max_views: 512
|
max_views: 512
|
||||||
|
@ -91,8 +91,8 @@ def get_scan_points_indices(scan_points, mask, display_table_mask_label, cam_int
|
|||||||
def save_scene_data(root, scene, scene_idx=0, scene_total=1,file_type="txt"):
|
def save_scene_data(root, scene, scene_idx=0, scene_total=1,file_type="txt"):
|
||||||
|
|
||||||
''' configuration '''
|
''' configuration '''
|
||||||
target_mask_label = (0, 255, 0, 255)
|
target_mask_label = (0, 255, 0)
|
||||||
display_table_mask_label=(0, 0, 255, 255)
|
display_table_mask_label=(0, 0, 255)
|
||||||
random_downsample_N = 32768
|
random_downsample_N = 32768
|
||||||
voxel_size=0.003
|
voxel_size=0.003
|
||||||
filter_degree = 75
|
filter_degree = 75
|
||||||
@ -163,7 +163,7 @@ def save_scene_data(root, scene, scene_idx=0, scene_total=1,file_type="txt"):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
#root = "/media/hofee/repository/new_data_with_normal"
|
#root = "/media/hofee/repository/new_data_with_normal"
|
||||||
root = r"C:\\Document\\Local Project\\nbv_rec\\nbv_reconstruction\\temp"
|
root = r"/media/hofee/repository/data_part_1"
|
||||||
# list_path = r"/media/hofee/repository/full_list.txt"
|
# list_path = r"/media/hofee/repository/full_list.txt"
|
||||||
# scene_list = []
|
# scene_list = []
|
||||||
|
|
||||||
@ -172,8 +172,7 @@ if __name__ == "__main__":
|
|||||||
# scene_list.append(line.strip())
|
# scene_list.append(line.strip())
|
||||||
scene_list = os.listdir(root)
|
scene_list = os.listdir(root)
|
||||||
from_idx = 0 # 1000
|
from_idx = 0 # 1000
|
||||||
to_idx = 1 # 1500
|
to_idx = 600 # 1500
|
||||||
print(scene_list)
|
|
||||||
|
|
||||||
|
|
||||||
cnt = 0
|
cnt = 0
|
||||||
@ -181,6 +180,10 @@ if __name__ == "__main__":
|
|||||||
total = to_idx - from_idx
|
total = to_idx - from_idx
|
||||||
for scene in scene_list[from_idx:to_idx]:
|
for scene in scene_list[from_idx:to_idx]:
|
||||||
start = time.time()
|
start = time.time()
|
||||||
|
if os.path.exists(os.path.join(root, scene, "scan_points.txt")):
|
||||||
|
print(f"Scene {scene} has been processed")
|
||||||
|
cnt+=1
|
||||||
|
continue
|
||||||
save_scene_data(root, scene, cnt, total, file_type="npy")
|
save_scene_data(root, scene, cnt, total, file_type="npy")
|
||||||
cnt+=1
|
cnt+=1
|
||||||
end = time.time()
|
end = time.time()
|
||||||
|
@ -9,7 +9,7 @@ class ViewGenerator(Runner):
|
|||||||
self.config_path = config_path
|
self.config_path = config_path
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
result = subprocess.run(['blender', '-b', '-P', '../blender/run_blender.py', '--', self.config_path])
|
result = subprocess.run(['/home/hofee/blender-4.0.2-linux-x64/blender', '-b', '-P', '../blender/run_blender.py', '--', self.config_path])
|
||||||
print()
|
print()
|
||||||
|
|
||||||
def create_experiment(self, backup_name=None):
|
def create_experiment(self, backup_name=None):
|
||||||
|
@ -22,8 +22,10 @@ class DataLoadUtil:
|
|||||||
float_channels = ['R', 'G', 'B']
|
float_channels = ['R', 'G', 'B']
|
||||||
img_data = []
|
img_data = []
|
||||||
for channel in float_channels:
|
for channel in float_channels:
|
||||||
channel_data = exr_file.channel(channel, Imath.PixelType(Imath.PixelType.FLOAT))
|
channel_data = exr_file.channel(channel)
|
||||||
img_data.append(np.frombuffer(channel_data, dtype=np.float32).reshape((height, width)))
|
img_data.append(np.frombuffer(channel_data, dtype=np.float16).reshape((height, width)))
|
||||||
|
|
||||||
|
# 将各通道组合成一个 (height, width, 3) 的 RGB 图像
|
||||||
img = np.stack(img_data, axis=-1)
|
img = np.stack(img_data, axis=-1)
|
||||||
return img
|
return img
|
||||||
|
|
||||||
@ -132,8 +134,8 @@ class DataLoadUtil:
|
|||||||
if binocular and not left_only:
|
if binocular and not left_only:
|
||||||
|
|
||||||
def clean_mask(mask_image):
|
def clean_mask(mask_image):
|
||||||
green = [0, 255, 0, 255]
|
green = [0, 255, 0]
|
||||||
red = [255, 0, 0, 255]
|
red = [255, 0, 0]
|
||||||
threshold = 2
|
threshold = 2
|
||||||
mask_image = np.where(
|
mask_image = np.where(
|
||||||
np.abs(mask_image - green) <= threshold, green, mask_image
|
np.abs(mask_image - green) <= threshold, green, mask_image
|
||||||
|
Loading…
x
Reference in New Issue
Block a user