Hiroki Nakayama
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with
11 additions and
9 deletions
-
Dockerfile
-
backend/Dockerfile.dev
-
backend/Dockerfile.prod
-
backend/api/models.py
-
backend/api/tasks.py
-
backend/api/views/label.py
|
|
@ -1,4 +1,4 @@ |
|
|
|
ARG PYTHON_VERSION="3.9.6-slim-buster" |
|
|
|
ARG PYTHON_VERSION="3.8.12-slim-buster" |
|
|
|
ARG NODE_VERSION="16.5-alpine3.14" |
|
|
|
FROM node:${NODE_VERSION} AS frontend-builder |
|
|
|
|
|
|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
ARG PYTHON_VERSION="3.9.6-slim-buster" |
|
|
|
ARG PYTHON_VERSION="3.8.12-slim-buster" |
|
|
|
FROM python:${PYTHON_VERSION} |
|
|
|
|
|
|
|
RUN apt-get update \ |
|
|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
ARG PYTHON_VERSION="3.9.6-slim-buster" |
|
|
|
ARG PYTHON_VERSION="3.8.12-slim-buster" |
|
|
|
FROM python:${PYTHON_VERSION} |
|
|
|
|
|
|
|
CMD ["python3"] |
|
|
|
|
|
@ -1,8 +1,6 @@ |
|
|
|
import string |
|
|
|
from typing import Literal |
|
|
|
|
|
|
|
from django import db |
|
|
|
|
|
|
|
from auto_labeling_pipeline.models import RequestModelFactory |
|
|
|
from django.contrib.auth.models import User |
|
|
|
from django.core.exceptions import ValidationError |
|
|
|
|
|
@ -1,6 +1,6 @@ |
|
|
|
import itertools |
|
|
|
|
|
|
|
from celery import shared_task |
|
|
|
from celery import shared_task |
|
|
|
from celery.utils.log import get_task_logger |
|
|
|
from django.conf import settings |
|
|
|
from django.contrib.auth import get_user_model |
|
|
@ -15,6 +15,8 @@ from .views.upload.factory import (get_data_class, get_dataset_class, |
|
|
|
from .views.upload.utils import append_field |
|
|
|
|
|
|
|
logger = get_task_logger(__name__) |
|
|
|
|
|
|
|
|
|
|
|
class Buffer: |
|
|
|
|
|
|
|
def __init__(self, buffer_size=settings.IMPORT_BATCH_SIZE): |
|
|
|
|
|
@ -15,12 +15,14 @@ from ..models import Label, Project |
|
|
|
from ..permissions import IsInProjectReadOnlyOrAdmin, IsProjectAdmin |
|
|
|
from ..serializers import LabelSerializer |
|
|
|
|
|
|
|
|
|
|
|
def camel_to_snake(name): |
|
|
|
name = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name) |
|
|
|
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', name).lower() |
|
|
|
name = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name) |
|
|
|
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', name).lower() |
|
|
|
|
|
|
|
|
|
|
|
def camel_to_snake_dict(d): |
|
|
|
return {camel_to_snake(k): v for k,v in d.items()} |
|
|
|
return {camel_to_snake(k): v for k, v in d.items()} |
|
|
|
|
|
|
|
|
|
|
|
class LabelList(generics.ListCreateAPIView): |
|
|
|