jackyliang42 commited on
Commit
715fc3c
·
1 Parent(s): e7fd469

sampling blocks and bowls with matching colors

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -73,8 +73,9 @@ class DemoRunner:
73
  self._model_name = model_name
74
 
75
  self._env = PickPlaceEnv(render=True, high_res=True, high_frame_rate=False)
76
- block_list = np.random.choice(ALL_BLOCKS, size=n_blocks, replace=False).tolist()
77
- bowl_list = np.random.choice(ALL_BOWLS, size=n_bowls, replace=False).tolist()
 
78
  obj_list = block_list + bowl_list
79
  self._env.reset(obj_list)
80
 
 
73
  self._model_name = model_name
74
 
75
  self._env = PickPlaceEnv(render=True, high_res=True, high_frame_rate=False)
76
+ list_idxs = np.random.choice(len(ALL_BLOCKS), size=max(n_blocks, n_bowls), replace=False)
77
+ block_list = [ALL_BLOCKS[i] for i in list_idxs[:n_blocks]]
78
+ bowl_list = [ALL_BOWLS[i] for i in list_idxs[:n_bowls]]
79
  obj_list = block_list + bowl_list
80
  self._env.reset(obj_list)
81