Пример #1
0
from flask_restplus import fields

from lost.api.api import api

mia_anno = api.model('MIA Annotation', {
    'image': fields.Raw(),
})
Пример #2
0
from flask_restplus import fields

from lost.api.api import api

group = api.model(
    'Group', {
        'idx':
        fields.Integer(readOnly=True,
                       description='The identifier of the group.'),
        'name':
        fields.String(required=True, description='The name of the group.')
    })

group_list = api.model('GroupList', {
    'groups': fields.List(fields.Nested(group)),
})
Пример #3
0
image = api.model(
    'Image', {
        'id':
        fields.Integer(readOnly=True,
                       description='The identifier of the image.'),
        'url':
        fields.String(readOnly=True, description='The url of the image.'),
        'number':
        fields.Integer(
            readOnly=True,
            description='Number of the current image in that annotation task.'
        ),
        'amount':
        fields.Integer(
            readOnly=True,
            description='Number of total images in that annotation task.'),
        'isFirst':
        fields.Boolean(
            readOnly=True,
            description=
            'Weather the image is the first one of the annotation process.'),
        'isLast':
        fields.Boolean(
            readOnly=True,
            description=
            'Weather the image is the last one of the annotation process.'),
        'isLast':
        fields.Boolean(
            readOnly=True,
            description=
            'Weather the image is the last one of the annotation process.'),
        'labelIds':
        fields.List(fields.Integer(readOnly=True, description='Label id.'),
                    description='All label ids which belongs to this image.'),
        'isJunk':
        fields.Boolean(
            readOnly=True,
            description='Indicates if the image was marked as Junk.'),
        'annoTime':
        fields.Float(readOnly=True, description='Annotation time in seconds')
    })
Пример #4
0
from flask_restplus import fields

from lost.api.api import api
from lost.api.group.api_definition import group

label_leaf = api.model(
    'Label Leaf', {
        'id':
        fields.Integer(readOnly=True,
                       description='The identifier of the label leaf.'),
        'name':
        fields.String(description='The name of the label leaf.'),
        'description':
        fields.String(description='The description of the label leaf.'),
        'abbreviation':
        fields.String(description='The abbreviation of the label leaf.'),
        'leaf_id':
        fields.String(description='An external leaf id for this label.'),
        'group':
        fields.Nested(group, description='The group  this label belongs to.'),
        'is_root':
        fields.Boolean(
            description='Weather this label is the first label in a tree.'),
    })

label_tree = api.model(
    'Label Tree', {
        'id':
        fields.Integer(readOnly=True,
                       description='The identifier of the label tree.'),
        'name':
Пример #5
0
from flask_restx import fields

from lost.api.api import api
from lost.api.group.api_definition import group

user_role = api.model('User Role', {
    'idx': fields.Integer(readOnly=True, description='The identifier of the Role'),
    'name': fields.String(description='Name of the Role')
})
user = api.model('User', {
    'idx': fields.Integer(readOnly=True, description='The identifier of the user'),
    'is_active': fields.Boolean(description="Online Status of the user"),
    'user_name': fields.String(required=True, description='User name'),
    'email': fields.String(required=True, description='User email'),
    'email_confirmed_at': fields.DateTime(description='Confirmation date of email'),
    'first_name': fields.String(required=True, description='User first name'),
    'last_name': fields.String(required=True, description='User last name'),
    'confidence_level': fields.Integer(description='Confidence level of user'),
    'photo_path': fields.String(description='Path to user avatar'),
    'new_password': fields.String(required=True, description='User password'),
    'groups': fields.List(fields.Nested(group)), 
    'roles': fields.List(fields.Nested(user_role)),
    'is_external': fields.Boolean(description="User inherited from external user managament"), 
    # 'choosen_anno_task': fields.Raw()
})

user_login = api.model('UserLogin', {
    # 'email': fields.String(description='User email'),
    'user_name': fields.String(description='User name'),
    'password': fields.String(required=True, description='User password')
})
Пример #6
0
from flask_restplus import fields
from lost.api.api import api

worker = api.model(
    'Worker', {
        'idx':
        fields.Integer(readOnly=True,
                       description='The identifier of the worker'),
        'env_name':
        fields.String(description="Worker environments"),
        'worker_name':
        fields.String(description='Worker name'),
        'timestamp':
        fields.DateTime(description='Worker last activity'),
        'register_timestamp':
        fields.DateTime(description='Worker register date'),
        'resources':
        fields.String(description='Worker resources'),
        'in_progress':
        fields.String(description='Worker jobs'),
    })

worker_list = api.model('WorkerList', {
    'workers': fields.List(fields.Nested(worker)),
})
Пример #7
0
from flask_restx import fields
from lost.api.api import api

config = api.model(
    'Config', {
        'defaultValue':
        fields.String(description='TODO', attribute='default_value'),
        'description':
        fields.String(description='TODO'),
        'idx':
        fields.Integer(readOnly=True, description='TODO'),
        'key':
        fields.String(description='TODO'),
        'config':
        fields.String(description="TODO"),
        'timestamp':
        fields.Integer(description='TODO'),
        'userId':
        fields.Integer(readOnly=True, description='TODO', attribute='user_id'),
        'value':
        fields.String(description='TODO'),
    })
Пример #8
0
from flask_restplus import fields
from lost.api.api import api

template_element = api.model(
    'Template element', {
        'peN': fields.Integer(description="Number of element."),
        'peOut': fields.List(fields.Integer, description='Elements output.'),
        'datasource': fields.Raw(),
        'script': fields.Raw(),
        'annoTask': fields.Raw(),
        'loop': fields.Raw(),
        'dataExport': fields.Raw(),
    })
template = api.model(
    'Template',
    {
        'id':
        fields.Integer(readOnly=True,
                       description="The identifier of the pipeline template."),
        'description':
        fields.String(readOnly=True,
                      description="The description of the pipeline template."),
        'author':
        fields.String(readOnly=True,
                      description="The author of the pipeline template."),
        'namespace':
        fields.String(readOnly=True,
                      description="The namespace of the pipeline template."),
        'name':
        fields.String(readOnly=True,
                      description="The name of the pipeline template."),