Spaces:
Build error
Build error
Commit
·
715fc3c
1
Parent(s):
e7fd469
sampling blocks and bowls with matching colors
Browse files
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 |
-
|
77 |
-
|
|
|
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 |
|