From 8b08785a939660d4c2b5bef0a0e6ac17c583ea50 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Fri, 14 May 2021 07:51:05 +0900 Subject: [PATCH] Add download catalog for image classification --- backend/api/views/download/catalog.py | 6 +++++- backend/api/views/download/examples.py | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/backend/api/views/download/catalog.py b/backend/api/views/download/catalog.py index f32243c4..078eb993 100644 --- a/backend/api/views/download/catalog.py +++ b/backend/api/views/download/catalog.py @@ -4,7 +4,8 @@ from typing import Dict, List, Type from pydantic import BaseModel from typing_extensions import Literal -from ...models import DOCUMENT_CLASSIFICATION, SEQ2SEQ, SEQUENCE_LABELING +from ...models import (DOCUMENT_CLASSIFICATION, IMAGE_CLASSIFICATION, SEQ2SEQ, + SEQUENCE_LABELING) from . import examples @@ -82,3 +83,6 @@ Options.register(SEQUENCE_LABELING, JSONL, OptionNone, examples.Offset_JSONL) Options.register(SEQ2SEQ, CSV, OptionDelimiter, examples.Text_CSV) Options.register(SEQ2SEQ, JSON, OptionNone, examples.Text_JSON) Options.register(SEQ2SEQ, JSONL, OptionNone, examples.Text_JSONL) + +# Image Classification +Options.register(IMAGE_CLASSIFICATION, JSONL, OptionNone, examples.CategoryImageClassification) diff --git a/backend/api/views/download/examples.py b/backend/api/views/download/examples.py index 11f51e60..1f0ade34 100644 --- a/backend/api/views/download/examples.py +++ b/backend/api/views/download/examples.py @@ -53,3 +53,12 @@ Offset_JSONL = """ {"text": "Peter Blackburn", "label": [ [0, 15, "PERSON"] ]} {"text": "President Obama", "label": [ [10, 15, "PERSON"] ]} """ + +CategoryImageClassification = """ +[ + { + "filename": "20210514.png", + "label": ["cat"] + } +] +"""