forked from StanfordVL/BehaviorChallenge2021
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimple_agent.py
More file actions
32 lines (25 loc) · 772 Bytes
/
simple_agent.py
File metadata and controls
32 lines (25 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import numpy as np
ACTION_DIM = 26
IMG_WIDTH = 128
IMG_HEIGHT = 128
PROPRIOCEPTION_DIM = 20
class RandomAgent:
def __init__(self):
pass
def reset(self):
pass
def act(self, observations):
action = np.random.uniform(low=-1, high=1, size=(ACTION_DIM,))
return action
if __name__ == "__main__":
obs = {
"rgb": np.ones((IMG_HEIGHT, IMG_WIDTH, 3)),
"depth": np.ones((IMG_HEIGHT, IMG_WIDTH, 1)),
"seg": np.ones((IMG_HEIGHT, IMG_WIDTH, 1)),
"ins_seg": np.ones((IMG_HEIGHT, IMG_WIDTH, 1)),
"highlight": np.ones((IMG_HEIGHT, IMG_WIDTH, 1)),
"proprioception": np.ones((PROPRIOCEPTION_DIM,)),
}
agent = RandomAgent()
action = agent.act(obs)
print("action", action)