Unverified Commit 3b9549c9 authored by jihan.yang's avatar jihan.yang Committed by GitHub
Browse files

fixbug: modify global gt database when applying data aug

parent a4c3ccf5
import pickle import pickle
import os import os
import copy
import numpy as np import numpy as np
import SharedArray import SharedArray
import torch.distributed as dist import torch.distributed as dist
...@@ -155,13 +156,14 @@ class DataBaseSampler(object): ...@@ -155,13 +156,14 @@ class DataBaseSampler(object):
obj_points_list = [] obj_points_list = []
if self.use_shared_memory: if self.use_shared_memory:
gt_database_data = SharedArray.attach(f"shm://{self.gt_database_data_key}") gt_database_data = SharedArray.attach(f"shm://{self.gt_database_data_key}")
gt_database_data.setflags(write=0)
else: else:
gt_database_data = None gt_database_data = None
for idx, info in enumerate(total_valid_sampled_dict): for idx, info in enumerate(total_valid_sampled_dict):
if self.use_shared_memory: if self.use_shared_memory:
start_offset, end_offset = info['global_data_offset'] start_offset, end_offset = info['global_data_offset']
obj_points = gt_database_data[start_offset:end_offset] obj_points = copy.deepcopy(gt_database_data[start_offset:end_offset])
else: else:
file_path = self.root_path / info['path'] file_path = self.root_path / info['path']
obj_points = np.fromfile(str(file_path), dtype=np.float32).reshape( obj_points = np.fromfile(str(file_path), dtype=np.float32).reshape(
......
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