Exemple #1
0
def dispatch_request(request):
    """An entry point to dispatch legacy requests"""
    if request.method == 'GET' and 'id' in request.GET:
        return render(request, 'engine/annotation.html',
                      {'js_3rdparty': JS_3RDPARTY.get('engine', [])})
    else:
        return redirect('/dashboard/')
Exemple #2
0
def DashboardView(request):
    filter_name = request.GET['search'] if 'search' in request.GET else None
    tasks_query_set = list(
        TaskModel.objects.prefetch_related('segment_set').order_by(
            '-created_date').all())
    if filter_name is not None:
        tasks_query_set = list(
            filter(lambda x: filter_name.lower() in x.name.lower(),
                   tasks_query_set))

    data = []
    for task in tasks_query_set:
        segments = task.get_user_segments(request.user)
        if len(segments) > 0:
            task_info = {}
            MainTaskInfo(task, segments, task_info)
            DetailTaskInfo(request, task, segments, task_info)
            data.append(task_info)

    # pdb.set_trace()
    return render(
        request, 'dashboard/dashboard.html', {
            'data': data,
            'max_upload_size': settings.LOCAL_LOAD_MAX_FILES_SIZE,
            'max_upload_count': settings.LOCAL_LOAD_MAX_FILES_COUNT,
            'js_3rdparty': JS_3RDPARTY.get('dashboard', [])
        })
Exemple #3
0
def dispatch_request(request):
    """An entry point to dispatch legacy requests"""
    if request.method == 'GET' and 'id' in request.GET:
        return render(request, 'engine/annotation.html', {
            'css_3rdparty': CSS_3RDPARTY.get('engine', []),
            'js_3rdparty': JS_3RDPARTY.get('engine', []),
            'status_list': [str(i) for i in StatusChoice]
        })
    else:
        return redirect('/dashboard/')
Exemple #4
0
def dispatch_request(request):
    """An entry point to dispatch legacy requests"""
    if request.method == 'GET' and 'id' in request.GET:
        job = models.Job.objects.get(id=request.GET['id'])
        segment = job.segment
        if job.get_deltatime() == 'False' and not request.user.is_superuser:
            return HttpResponseBadRequest("This job is being edited")
        if segment.check_user_access(request.user):
            return render(request, 'engine/annotation.html',
                          {'js_3rdparty': JS_3RDPARTY.get('engine', [])})
        else:
            return HttpResponseBadRequest("Permission denied")
    else:
        return redirect('/dashboard/')
Exemple #5
0
def dispatch_request(request):
    """An entry point to dispatch legacy requests"""
    if request.method == 'GET' and 'id' in request.GET:
        job = models.Job.objects.get(id=request.GET['id'])
        segment = job.segment
        if job.get_deltatime() == 'False' and not request.user.is_superuser:
            return HttpResponseBadRequest("This job is being edited")
        if segment.check_user_access(request.user):          
            return render(request, 'engine/annotation.html', {
                'js_3rdparty': JS_3RDPARTY.get('engine', [])
            })
        else:
            return HttpResponseBadRequest("Permission denied")
    else:
        return redirect('/dashboard/')
Exemple #6
0
def dispatch_request(request):
    """An entry point to dispatch legacy requests"""
    if 'dashboard' in request.path or (request.path == '/'
                                       and 'id' not in request.GET):
        return RedirectView.as_view(url=settings.UI_URL,
                                    permanent=True,
                                    query_string=True)(request)
    elif request.method == 'GET' and 'id' in request.GET and request.path == '/':
        return render(
            request, 'engine/annotation.html', {
                'css_3rdparty': CSS_3RDPARTY.get('engine', []),
                'js_3rdparty': JS_3RDPARTY.get('engine', []),
                'status_list': [str(i) for i in StatusChoice],
                'ui_url': settings.UI_URL
            })
    else:
        return HttpResponseNotFound()
Exemple #7
0
def DashboardView(request):
    query_name = request.GET['search'] if 'search' in request.GET else None
    query_job = int(
        request.GET['jid']
    ) if 'jid' in request.GET and request.GET['jid'].isdigit() else None
    task_list = None

    if query_job is not None and JobModel.objects.filter(
            pk=query_job).exists():
        task_list = [
            JobModel.objects.select_related('segment__task').get(
                pk=query_job).segment.task
        ]
    else:
        task_list = list(
            TaskModel.objects.prefetch_related(
                'segment_set__job_set').order_by('-created_date').all())
        if query_name is not None:
            task_list = list(
                filter(lambda x: query_name.lower() in x.name.lower(),
                       task_list))

    task_list = list(
        filter(lambda task: request.user.has_perm('engine.task.access', task),
               task_list))

    return render(
        request, 'dashboard/dashboard.html', {
            'data':
            task_list,
            'max_upload_size':
            settings.LOCAL_LOAD_MAX_FILES_SIZE,
            'max_upload_count':
            settings.LOCAL_LOAD_MAX_FILES_COUNT,
            'base_url':
            "{0}://{1}/".format(request.scheme, request.get_host()),
            'share_path':
            os.getenv('CVAT_SHARE_URL', default=r'${cvat_root}/share'),
            'js_3rdparty':
            JS_3RDPARTY.get('dashboard', []),
        })
Exemple #8
0
def DashboardView(request):
    filter_name = request.GET['search'] if 'search' in request.GET else None
    tasks_query_set = list(TaskModel.objects.prefetch_related('segment_set').order_by('-created_date').all())
    if filter_name is not None:
        tasks_query_set = list(filter(lambda x: filter_name.lower() in x.name.lower(), tasks_query_set))

    data = []
    for task in tasks_query_set:
        segments = task.get_user_segments(request.user)
        if len(segments) >0:
            task_info = {}
            MainTaskInfo(task, segments, task_info)
            DetailTaskInfo(request, task, segments, task_info)
            data.append(task_info)

    # pdb.set_trace()
    return render(request, 'dashboard/dashboard.html', {
        'data': data,
        'max_upload_size': settings.LOCAL_LOAD_MAX_FILES_SIZE,
        'max_upload_count': settings.LOCAL_LOAD_MAX_FILES_COUNT,
        'js_3rdparty': JS_3RDPARTY.get('dashboard', [])
    })
Exemple #9
0
from cvat.settings.base import JS_3RDPARTY

JS_3RDPARTY['dashboard'] = JS_3RDPARTY.get('dashboard', []) + ['documentation/js/shortcuts.js']
Exemple #10
0
def DashboardView(request):
    query_name = request.GET['search'] if 'search' in request.GET else None
    query_job = int(
        request.GET['jid']
    ) if 'jid' in request.GET and request.GET['jid'].isdigit() else None
    task_list = None
    projects = []

    if (request.user.has_perm('dashboard.views.isAdmin')):
        projects = list(Projects.objects.all().values_list('pk', flat=True))
    else:
        projectsQuery = Projects_Users.objects.filter(
            user__username=request.user).select_related('project')
        for project in projectsQuery:
            projects.append(project.project.pk)

    if query_job is not None and JobModel.objects.filter(
            pk=query_job).exists():
        task_list = [
            JobModel.objects.select_related('segment__task').filter(
                segment__task__project__pk__in=projects).get(
                    pk=query_job).segment.task
        ]
    else:
        task_list = list(
            TaskModel.objects.filter(
                project__pk__in=projects).prefetch_related(
                    'segment_set__job_set').order_by('-created_date').all())
        if query_name is not None:
            task_list = list(
                filter(lambda x: query_name.lower() in x.name.lower(),
                       task_list))

    task_list = list(
        filter(lambda task: request.user.has_perm('engine.task.access', task),
               task_list))

    comments_task_ids = list(Comments.objects.all().values_list('task__id',
                                                                flat=True))

    open_tasks = list()
    pending_tasks = list()
    closed_tasks = list()

    for task in task_list:
        # For each task, check if it has comments.
        task.has_comments = task.id in comments_task_ids

        # Add the "priority" attribute to the python object if its project has_score == false
        if not task.project.has_score:
            task.priority = convert_priority_to_string(task.score)

        # Count tasks by tabs
        if (task.status == 'annotation'):
            open_tasks.append(task)
        if (task.status == 'validation'):
            pending_tasks.append(task)
        if (task.status == 'completed'):
            closed_tasks.append(task)
    return render(
        request, 'dashboard/dashboard.html', {
            'data':
            task_list,
            'open_data':
            open_tasks,
            'pending_data':
            pending_tasks,
            'closed_data':
            closed_tasks,
            'open_tasks':
            len(open_tasks),
            'pending_tasks':
            len(pending_tasks),
            'closed_tasks':
            len(closed_tasks),
            'max_upload_size':
            settings.LOCAL_LOAD_MAX_FILES_SIZE,
            'max_upload_count':
            settings.LOCAL_LOAD_MAX_FILES_COUNT,
            'base_url':
            "{0}://{1}/".format(
                'https' if os.environ.get('SECURE_SITE') == 'True' else 'http',
                request.get_host()),
            'share_path':
            os.getenv('CVAT_SHARE_URL', default=r'${cvat_root}/share'),
            'js_3rdparty':
            JS_3RDPARTY.get('dashboard', []),
        })
Exemple #11
0
from cvat.settings.base import JS_3RDPARTY

JS_3RDPARTY['dashboard'] = JS_3RDPARTY.get(
    'dashboard', []) + ['documentation/js/shortcuts.js']
Exemple #12
0
# Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: MIT

from cvat.settings.base import JS_3RDPARTY

JS_3RDPARTY['dashboard'] = JS_3RDPARTY.get(
    'dashboard', []) + ['auto_segmentation/js/dashboardPlugin.js']
Exemple #13
0
# Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: MIT

from cvat.settings.base import JS_3RDPARTY

JS_3RDPARTY['dashboard'] = JS_3RDPARTY.get(
    'dashboard', []) + ['tf_annotation/js/tf_annotation.js']
Exemple #14
0
# Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: MIT

from cvat.settings.base import JS_3RDPARTY

JS_3RDPARTY['dashboard'] = JS_3RDPARTY.get('dashboard', []) + ['log_viewer/js/shortcuts.js']
Exemple #15
0
# Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: MIT

from cvat.settings.base import JS_3RDPARTY

JS_3RDPARTY['dashboard'] = JS_3RDPARTY.get('dashboard', []) + ['git/js/dashboardPlugin.js']
Exemple #16
0
def DashboardView(request):
    return render(
        request, 'dashboard/dashboard.html', {
            'js_3rdparty': JS_3RDPARTY.get('dashboard', []),
            'css_3rdparty': CSS_3RDPARTY.get('dashboard', []),
        })
Exemple #17
0
from cvat.settings.base import JS_3RDPARTY

JS_3RDPARTY['dashboard'] = JS_3RDPARTY.get('dashboard', []) + ['tf_annotation/js/tf_annotation.js']
Exemple #18
0
# Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: MIT

from cvat.settings.base import JS_3RDPARTY

JS_3RDPARTY['engine'] = JS_3RDPARTY.get('engine', []) + ['dashboard/js/enginePlugin.js']
Exemple #19
0
# Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: MIT

from cvat.settings.base import JS_3RDPARTY

default_app_config = 'cvat.apps.reid.apps.ReidConfig'

JS_3RDPARTY['engine'] = JS_3RDPARTY.get('engine', []) + ['reid/js/enginePlugin.js']
Exemple #20
0
# Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: MIT

from cvat.settings.base import JS_3RDPARTY

JS_3RDPARTY['engine'] = JS_3RDPARTY.get(
    'engine', []) + ['dextr_segmentation/js/enginePlugin.js']