MCPcopy Index your code
hub / github.com/llSourcell/YOLO_Object_Detection / cliHandler

Function cliHandler

darkflow/cli.py:5–37  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

3from .net.build import TFNet
4
5def cliHandler(args):
6 FLAGS = argHandler()
7 FLAGS.setDefaults()
8 FLAGS.parseArgs(args)
9
10 # make sure all necessary dirs exist
11 def _get_dir(dirs):
12 for d in dirs:
13 this = os.path.abspath(os.path.join(os.path.curdir, d))
14 if not os.path.exists(this): os.makedirs(this)
15 _get_dir([FLAGS.imgdir, FLAGS.binary, FLAGS.backup,
16 os.path.join(FLAGS.imgdir,'out'), FLAGS.summary])
17
18 # fix FLAGS.load to appropriate type
19 try: FLAGS.load = int(FLAGS.load)
20 except: pass
21
22 tfnet = TFNet(FLAGS)
23
24 if FLAGS.demo:
25 tfnet.camera()
26 exit('Demo stopped, exit.')
27
28 if FLAGS.train:
29 print('Enter training ...'); tfnet.train()
30 if not FLAGS.savepb:
31 exit('Training finished, exit.')
32
33 if FLAGS.savepb:
34 print('Rebuild a constant version ...')
35 tfnet.savepb(); exit('Done')
36
37 tfnet.predict()

Callers 1

executeCLIFunction · 0.90

Calls 6

savepbMethod · 0.95
argHandlerClass · 0.85
_get_dirFunction · 0.85
TFNetClass · 0.85
setDefaultsMethod · 0.80
parseArgsMethod · 0.80

Tested by 1

executeCLIFunction · 0.72