facebookresearch / phyre

PHYRE is a benchmark for physical reasoning.
https://phyre.ai
Apache License 2.0
431 stars 64 forks source link

Possible problem with ball diameter #92

Open HelloElwin opened 1 year ago

HelloElwin commented 1 year ago

An action with diameter one ([0.45, 0.78, 1]) does not seem to result in placing a red ball with diameter one. The following code is an example and the simulation result is attached. How can I place a larger ball or is there a ball size limit in PHYRE?

import math
import phyre
import matplotlib.pyplot as plt

fold_id = 0 
eval_setup = 'ball_within_template'
train_tasks, dev_tasks, test_tasks = phyre.get_fold(eval_setup, fold_id)
action_tier = phyre.eval_setup_to_action_tier(eval_setup)
simulator = phyre.initialize_simulator(['00005:174'], action_tier)

initial_featurized_objects = simulator.initial_featurized_objects[0]
initial_scene = simulator.initial_scenes[0]
simulation = simulator.simulate_action(0, [0.45, 0.78, 1], need_images=True, need_featurized_objects=True)

num_across = 5
height = int(math.ceil(len(simulation.images) / num_across))
fig, axs = plt.subplots(height, num_across, figsize=(20, 15))
fig.tight_layout()
plt.subplots_adjust(hspace=0.2, wspace=0.2)
for i, (ax, image) in enumerate(zip(axs.flatten(), simulation.images)):
    img = phyre.observations_to_float_rgb(image)
    ax.imshow(img)
    ax.title.set_text(f'Timestep {i}')
    ax.get_xaxis().set_ticks([])
    ax.get_yaxis().set_ticks([])
plt.savefig(f'error.jpg')

error