From 70af0596a8f387b61c9011c80fba21ffce8044ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=9A=A9=EC=88=98?= Date: Wed, 25 Sep 2024 11:24:57 +0900 Subject: [PATCH] Feat: Data Init SQL --- .../repository/ProgressCacheRepository.java | 2 +- .../progress/service/ProgressService.java | 2 +- backend/src/main/resources/sql/dml/init.sql | 86 +++++++++++++++++++ 3 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 backend/src/main/resources/sql/dml/init.sql diff --git a/backend/src/main/java/com/worlabel/domain/progress/repository/ProgressCacheRepository.java b/backend/src/main/java/com/worlabel/domain/progress/repository/ProgressCacheRepository.java index ddebcd9..4dd07e6 100644 --- a/backend/src/main/java/com/worlabel/domain/progress/repository/ProgressCacheRepository.java +++ b/backend/src/main/java/com/worlabel/domain/progress/repository/ProgressCacheRepository.java @@ -16,7 +16,7 @@ public class ProgressCacheRepository { /** * 현재 오토레이블링중인지 확인하는 메서드 */ - public boolean predictCheck(final int projectId) { + public boolean predictProgress(final int projectId) { String key = CacheKey.autoLabelingProgressKey(); Boolean isProgress = redisTemplate.opsForSet().isMember(key, projectId); return Boolean.TRUE.equals(isProgress); diff --git a/backend/src/main/java/com/worlabel/domain/progress/service/ProgressService.java b/backend/src/main/java/com/worlabel/domain/progress/service/ProgressService.java index aab44ef..020f164 100644 --- a/backend/src/main/java/com/worlabel/domain/progress/service/ProgressService.java +++ b/backend/src/main/java/com/worlabel/domain/progress/service/ProgressService.java @@ -15,7 +15,7 @@ public class ProgressService { private final ProgressCacheRepository progressCacheRepository; public void predictCheck(final int projectId){ - if(progressCacheRepository.predictCheck(projectId)){ + if(progressCacheRepository.predictProgress(projectId)){ throw new CustomException(ErrorCode.AI_IN_PROGRESS); } } diff --git a/backend/src/main/resources/sql/dml/init.sql b/backend/src/main/resources/sql/dml/init.sql new file mode 100644 index 0000000..04949e0 --- /dev/null +++ b/backend/src/main/resources/sql/dml/init.sql @@ -0,0 +1,86 @@ +# YOLO8 DEFAULT 모델 삽입 +INSERT INTO ai_model(model_id, version, name) +VALUES (1, 0, "yolo8-detection"); + +# 80개의 라벨 카테고리 삽입 +INSERT INTO label_category(model_id, label_category_name, ai_category_id) +VALUES (1, 'person', 0), + (1, 'bicycle', 1), + (1, 'car', 2), + (1, 'motorcycle', 3), + (1, 'airplane', 4), + (1, 'bus', 5), + (1, 'train', 6), + (1, 'truck', 7), + (1, 'boat', 8), + (1, 'traffic light', 9), + (1, 'fire hydrant', 10), + (1, 'stop sign', 11), + (1, 'parking meter', 12), + (1, 'bench', 13), + (1, 'bird', 14), + (1, 'cat', 15), + (1, 'dog', 16), + (1, 'horse', 17), + (1, 'sheep', 18), + (1, 'cow', 19), + (1, 'elephant', 20), + (1, 'bear', 21), + (1, 'zebra', 22), + (1, 'giraffe', 23), + (1, 'backpack', 24), + (1, 'umbrella', 25), + (1, 'handbag', 26), + (1, 'tie', 27), + (1, 'suitcase', 28), + (1, 'frisbee', 29), + (1, 'skis', 30), + (1, 'snowboard', 31), + (1, 'sports ball', 32), + (1, 'kite', 33), + (1, 'baseball bat', 34), + (1, 'baseball glove', 35), + (1, 'skateboard', 36), + (1, 'surfboard', 37), + (1, 'tennis racket', 38), + (1, 'bottle', 39), + (1, 'wine glass', 40), + (1, 'cup', 41), + (1, 'fork', 42), + (1, 'knife', 43), + (1, 'spoon', 44), + (1, 'bowl', 45), + (1, 'banana', 46), + (1, 'apple', 47), + (1, 'sandwich', 48), + (1, 'orange', 49), + (1, 'broccoli', 50), + (1, 'carrot', 51), + (1, 'hot dog', 52), + (1, 'pizza', 53), + (1, 'donut', 54), + (1, 'cake', 55), + (1, 'chair', 56), + (1, 'couch', 57), + (1, 'potted plant', 58), + (1, 'bed', 59), + (1, 'dining table', 60), + (1, 'toilet', 61), + (1, 'tv', 62), + (1, 'laptop', 63), + (1, 'mouse', 64), + (1, 'remote', 65), + (1, 'keyboard', 66), + (1, 'cell phone', 67), + (1, 'microwave', 68), + (1, 'oven', 69), + (1, 'toaster', 70), + (1, 'sink', 71), + (1, 'refrigerator', 72), + (1, 'book', 73), + (1, 'clock', 74), + (1, 'vase', 75), + (1, 'scissors', 76), + (1, 'teddy bear', 77), + (1, 'hair drier', 78), + (1, 'toothbrush', 79);