debug: 添加推理时缩放,加大采数以及推理时物块的放置范围
This commit is contained in:
@@ -103,10 +103,14 @@ def prepare_observation(obs: Dict, camera_names: list) -> Dict:
|
|||||||
Returns:
|
Returns:
|
||||||
agent 格式的观测字典
|
agent 格式的观测字典
|
||||||
"""
|
"""
|
||||||
|
import cv2
|
||||||
|
|
||||||
# 转换图像: numpy -> tensor, HWC -> CHW
|
# 转换图像: numpy -> tensor, HWC -> CHW
|
||||||
images = {}
|
images = {}
|
||||||
for cam_name in camera_names:
|
for cam_name in camera_names:
|
||||||
img = obs['images'][cam_name]
|
img = obs['images'][cam_name]
|
||||||
|
# Resize 到 224x224(与训练时一致)
|
||||||
|
img = cv2.resize(img, (224, 224), interpolation=cv2.INTER_LINEAR)
|
||||||
img = rearrange(img, 'h w c -> c h w')
|
img = rearrange(img, 'h w c -> c h w')
|
||||||
img = torch.from_numpy(img / 255.0).float()
|
img = torch.from_numpy(img / 255.0).float()
|
||||||
images[cam_name] = img
|
images[cam_name] = img
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ def sample_insertion_pose():
|
|||||||
|
|
||||||
def sample_transfer_pose():
|
def sample_transfer_pose():
|
||||||
# Box
|
# Box
|
||||||
x_range = [0.0, 0.05]
|
x_range = [-0.05, 0.05]
|
||||||
y_range = [0.95, 1.05]
|
y_range = [0.90, 1.05]
|
||||||
z_range = [0.47, 0.47]
|
z_range = [0.47, 0.47]
|
||||||
|
|
||||||
ranges = np.vstack([x_range, y_range, z_range])
|
ranges = np.vstack([x_range, y_range, z_range])
|
||||||
|
|||||||
Reference in New Issue
Block a user