Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

Possible problem with ball diameter #92

Open
HelloElwin opened this issue Jun 28, 2023 · 0 comments
Open

Possible problem with ball diameter #92

HelloElwin opened this issue Jun 28, 2023 · 0 comments

Comments

@HelloElwin
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant