示例#1
0
    def __init__(self):
        """ Initializes the extension """
        super(DockerExtension, self).__init__()
        self.docker_client = docker.from_env()
        self.subscribe(KeywordQueryEvent, KeywordQueryEventListener())
        self.subscribe(ItemEnterEvent, ItemEnterEventListener())

        parser = ArgumentParser()
        parser.add_argument('-c', '--c', action='store', dest='container_id')
        parser.add_argument('-a',
                            '--a',
                            action='store_true',
                            default=False,
                            dest='all_containers')
        parser.add_argument('-i',
                            '--i',
                            action='store_true',
                            default=False,
                            dest='info')

        self.arg_parser = parser

        self.list_containers_view = ListContainersView(self)
        self.container_details_view = ContainerDetailsView(self)
        self.info_view = InfoView(self)
        self.utils_view = UtilsView(self)

        Notify.init("DockerExtension")
示例#2
0
def parse_args(args):
    parser = ArgumentParser()
    parser.add_argument('tests', nargs='+')
    parser.add_argument('-d', '--duration', type=int, default=200,
                        help='Graph over duration hours (default 200)')
    parser.add_argument('-s', '--smoothing', type=int, default=12,
                       help='Rolling average hours (defaults to 12)')
    return parser.parse_args(args)
示例#3
0
def parse_args(args):
    parser = ArgumentParser()
    parser.add_argument('words', nargs='+')
    parser.add_argument('-r',
                        '--release',
                        type=str,
                        default='approved',
                        help='The name or version of the release')
    return parser.parse_args(args)
示例#4
0
def parse_args(args):
    parser = ArgumentParser()
    parser.add_argument('msg', nargs='*', default='')
    parser.add_argument('-m',
                        '--mood',
                        type=str,
                        default='default',
                        help='PixieBoots mood')
    return parser.parse_known_args(args)
def parse_args():
    parser = ArgumentParser(
        description=make_description("download the images"))

    parser.add_images_source_dir_argument()
    parser.add_dataset_dir_argument()
    parser.add_argument(
        "--no-dataset",
        action="store_true",
        help="If given, do not download the dataset (~13GB).",
    )

    return parser.parse_args()
示例#6
0
def make_parser():
    parser = ArgumentParser(description=make_description("training"))

    parser.add_argument(
        "style",
        type=str,
        nargs="*",
        help=
        ("Style images for which the training is performed successively. If "
         "relative path, the image is searched in IMAGES_SOURCE_DIR. Can also be a "
         "valid key from the built-in images. Defaults to all built-in style images."
         ),
    )
    parser.add_images_source_dir_argument()
    parser.add_models_dir_argument()
    parser.add_dataset_dir_argument()
    parser.add_impl_params_and_instance_norm_arguments()
    parser.add_device_argument()

    return parser
示例#7
0
import argparse

import numpy as np
import tensorflow as tf

from queue import Queue

from core.Classifier import *
from core.efficientnet.utils import *

from utils.Utils import *
from utils.Teacher import *
from utils.ArgumentParser import *
from utils.Tensorflow_Utils import *

args = ArgumentParser().parse_args()
args['warmup_iteration'] = int(args['max_iteration'] *
                               0.05)  # warmup iteration = 5%

model_name = '{}-{}-EfficientNet-{}'.format(args['experimenter'], get_today(),
                                            args['option'])

if not args['multi_scale']:
    width_coeff, depth_coeff, resolution, dropout_rate = efficientnet.efficientnet_params(
        'efficientnet-{}'.format(args['option']))
    args['max_image_size'] = resolution

num_gpu = len(args['use_gpu'].split(','))
os.environ["CUDA_VISIBLE_DEVICES"] = args['use_gpu']

args['batch_size'] = args['batch_size_per_gpu'] * num_gpu