Skip to content

Commit

Permalink
feat: 임시 라벨 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
redcarrot1 committed Jan 12, 2024
1 parent e661f74 commit b296375
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ protected void handleBinaryMessage(WebSocketSession session, BinaryMessage messa
String responseMessage = "";
try {
List<Inference> inferences = socketClient.inferenceImage(bytes);
System.out.println("Inference 변환 성공");
List<InferenceTranslate> inferenceTranslates = inferenceService.convertInference(inferences);
System.out.println("Translate 성공");
responseMessage = JsonUtil.toJsonFormat(inferenceTranslates);
System.out.println("json 변환 성공");
} catch (Exception e) {
System.err.println("추론 실패");
responseMessage = "[]";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public enum Label {
beverage_vending_machine("음료 자판기", "Beverage vending machine"),
trash_can("쓰레기통", "Trash can"),


temporary_label("[임시 라벨입니다]", "[temporary label]"), // TODO

;
private final String korean;
private final String english;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ public List<InferenceTranslate> convertInference(List<Inference> inferences) {
continue;
}

Label label = getLabel(inference);
// TODO
Label label = null;
try {
label = getLabel(inference);
} catch (Exception e) {
label = Label.temporary_label;
}

Direction direction = getDirection(inference);

InferenceTranslate inferenceTranslate = new InferenceTranslate(inference.alert(), label, direction);
Expand Down

0 comments on commit b296375

Please sign in to comment.