-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
37 lines (29 loc) · 1.22 KB
/
main.py
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
33
34
35
36
37
import sys
import argparse
from src.Simulation import Simulation
from src.TrainPerception import TrainPerception
from src.TrainCommunication import make_chatbot_learning
def runSimulation():
sim = Simulation()
def trainPerception(regenerate):
t = TrainPerception(regenerate)
t.train()
def trainCommunication(regenerate):
#print("af")
make_chatbot_learning()
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="IML projet to test some ai feature and human / robot interaction.\nWe using qiBullet and machine learning.")
subparsers = parser.add_subparsers(help='commands')
# A training command
train_parser = subparsers.add_parser('train', help='Train model')
train_parser.add_argument("model", action="store", choices=('communication', 'perception'), nargs='+')
train_parser.add_argument("-g", "--regenerate", action="store_true", help="remove the previous dataset and regenerate a new one")
args = parser.parse_args()
#print(args)
if "model" in args:
if ("perception" in args.model):
trainPerception(args.regenerate)
elif("communication" in args.model):
trainCommunication(args.regenerate)
else:
runSimulation()