コード例 #1
0
class Command(BaseCommand):
    def __init__(self, *args, **kwargs):
        self.datasets = Datasets()
        super(Command, self).__init__(*args, **kwargs)

    def handle(self, *args, **options):
        result = self.datasets.all()
        print(json.dumps(result, indent=4))
コード例 #2
0
class Command(BaseCommand):
    def __init__(self, *args, **kwargs):
        self.datasets = Datasets()
        self.train = Train()
        super(Command, self).__init__(*args, **kwargs)

    def add_arguments(self, parser):
        parser.add_argument('--path', dest='path', nargs='?', type=str)
        parser.add_argument('--name', dest='name', nargs='?', type=str)

    def handle(self, *args, **options):
        path = options.get('path')
        name = options.get('name')
        try:
            self.datasets.path_upload(path=path, name=name)
        except:
            pass

        print('end')
コード例 #3
0
class Command(BaseCommand):
    def __init__(self, *args, **kwargs):
        self.datasets = Datasets()
        super(Command, self).__init__(*args, **kwargs)

    def add_arguments(self, parser):
        parser.add_argument('datasets', nargs='?', type=str)

    def handle(self, *args, **options):
        datasets_id = options.get('datasets')
        result = self.datasets.get_feedback(datasets_id=datasets_id)
        print(json_dumps(result))
コード例 #4
0
class Command(BaseCommand):
    def __init__(self, *args, **kwargs):
        self.datasets = Datasets()
        super(Command, self).__init__(*args, **kwargs)

    def add_arguments(self, parser):
        parser.add_argument('--path', dest='path', nargs='?', type=str)
        parser.add_argument('--datasets', dest='datasets', nargs='?', type=str)

    def handle(self, *args, **options):
        path = options.get('path')
        datasets = options.get('datasets')
        result = self.datasets.put(datasets_id=datasets, path=path)
        print(json_dumps(result))
コード例 #5
0
class Command(BaseCommand):
    def __init__(self, *args, **kwargs):
        self.datasets = Datasets()
        super(Command, self).__init__(*args, **kwargs)

    def add_arguments(self, parser):
        parser.add_argument('--path', dest='path', nargs='?', type=str)
        parser.add_argument('--name', dest='name', nargs='?', type=str)

    def handle(self, *args, **options):
        path = options.get('path')
        name = options.get('name')
        if os.path.isfile(path):
            result = self.datasets.upload(path=path, name=name)
            print(json_dumps(result))
        else:
            print('File does not exist')
コード例 #6
0
class Command(BaseCommand):
    def __init__(self, *args, **kwargs):
        self.datasets = Datasets()
        super(Command, self).__init__(*args, **kwargs)

    def add_arguments(self, parser):
        parser.add_argument('--path', dest='path', nargs='?', type=str)
        parser.add_argument('--label', dest='label', nargs='?', type=str)
        parser.add_argument('--model', dest='model', nargs='?', type=str)

    def handle(self, *args, **options):
        path = options.get('path')
        label = options.get('label')
        model = options.get('model')
        if os.path.isfile(path):
            result = self.datasets.feedback(path=path,
                                            label=label,
                                            model_id=model)
            print(json_dumps(result))
        else:
            print('File does not exist')
コード例 #7
0
 def __init__(self, *args, **kwargs):
     self.datasets = Datasets()
     super(Command, self).__init__(*args, **kwargs)