import gin
import cv2
from envs import active_vision_dataset_env
from envs import task_env

VIS_MODE = 'vis'
HUMAN_MODE = 'human'
BENCHMARK_MODE = 'benchmark'
GRAPH_MODE = 'graph'
EVAL_MODE = 'eval'

flags.DEFINE_enum(
    'mode', VIS_MODE,
    [VIS_MODE, HUMAN_MODE, BENCHMARK_MODE, GRAPH_MODE, EVAL_MODE],
    'mode of the execution')
flags.DEFINE_integer('benchmark_iter', 1000,
                     'number of iterations for benchmarking')
flags.DEFINE_string('eval_folder', '', 'the path to the eval folder')
flags.DEFINE_string('output_folder', '',
                    'the path to which the images and gifs are written')
flags.DEFINE_multi_string('gin_config', [],
                          'List of paths to a gin config files for the env.')
flags.DEFINE_multi_string('gin_params', [],
                          'Newline separated list of Gin parameter bindings.')

mt = task_env.ModalityTypes
FLAGS = flags.FLAGS


def benchmark(env, targets):
    """Benchmarks the speed of sequence generation by env.
Esempio n. 2
0
from twitter.common import http
from twitter.common.exceptions import ExceptionalThread
from twitter.common.http.diagnostics import DiagnosticsEndpoints
from twitter.common.zookeeper import kazoo_client
from twitter.common.zookeeper.serverset import serverset

import metrics

FLAGS = flags.FLAGS

flags.DEFINE_string('zk', 'localhost:2181/',
                    'Zookeeper ensemble (comma-delimited, optionally '
                    'followed by /chroot path)')
flags.DEFINE_string('domain', 'zk.example.com',
                    'Serve records for this DNS domain.')
flags.DEFINE_integer('port', 8080, 'HTTP listen port.')
flags.DEFINE_string('listen', '0.0.0.0',
                    'IP address to listen for http connections.')

flags.DEFINE_integer('ttl', 60, 'TTL for normal records.')
flags.DEFINE_integer('soa_ttl', 300, 'TTL for SOA record itself.')
flags.DEFINE_string('soa_nameserver', '',
                    'Authoritative nameserver for the SOA record. '
                    'Uses the system hostname if left blank.')
flags.DEFINE_string('soa_email', '',
                    'Email address field for the SOA record. '
                    'Autogenerated if left blank.')
flags.DEFINE_integer('soa_refresh', 1200,
                     'Refresh field for the SOA record.')
flags.DEFINE_integer('soa_retry', 180,
                     'Retry field for the SOA record.')