diff --git a/src/main/java/solution/gdsc/PathPal/domain/inference/domain/Inference.java b/src/main/java/solution/gdsc/PathPal/domain/inference/domain/Inference.java index 93449e8..3508a22 100644 --- a/src/main/java/solution/gdsc/PathPal/domain/inference/domain/Inference.java +++ b/src/main/java/solution/gdsc/PathPal/domain/inference/domain/Inference.java @@ -1,5 +1,8 @@ package solution.gdsc.PathPal.domain.inference.domain; -public record Inference(String name, double confidence, double left_x, double right_x, boolean alert) { +public record Inference(String name, double confidence, + double left_x, double right_x, + double up_y, double down_y, + boolean alert) { } diff --git a/src/main/java/solution/gdsc/PathPal/domain/inference/service/InferenceService.java b/src/main/java/solution/gdsc/PathPal/domain/inference/service/InferenceService.java index 9fe7328..a1aba50 100644 --- a/src/main/java/solution/gdsc/PathPal/domain/inference/service/InferenceService.java +++ b/src/main/java/solution/gdsc/PathPal/domain/inference/service/InferenceService.java @@ -31,7 +31,7 @@ public String convertInference2(List inferences) { StringBuilder center = new StringBuilder(); StringBuilder right = new StringBuilder(); - final double confidenceThreshold = 0.3; + final double confidenceThreshold = 0.5; boolean isAlert = false; Set labelAndDirections = new HashSet<>(); @@ -40,7 +40,19 @@ public String convertInference2(List inferences) { continue; } if (inference.name().equals("brailleblock_dot") || - inference.name().equals("brailleblock_line")) { + inference.name().equals("brailleblock_line") || + inference.name().equals("flatness_D") || + inference.name().equals("flatness_E") || + inference.name().equals("walkway_paved") || + inference.name().equals("walkway_block") || + inference.name().equals("paved_state_broken") || + inference.name().equals("paved_state_normal") || + inference.name().equals("block_state_normal") || + inference.name().equals("block_kind_bad") + ) { + continue; + } + if ((inference.down_y() + inference.up_y()) / 2 < 0.333) { continue; } @@ -75,26 +87,6 @@ else if (direction == Direction.CENTER) { center.append(", "); } - /* - sb.append("["); - for (int i = 0; i < inferenceTranslates.size(); i++) { - sb.append("{\"koreanTTSString\": \""); - sb.append(inferenceTranslates.get(i).toKorean()); - sb.append("\", \"englishTTSString\": \""); - sb.append(inferenceTranslates.get(i).toEnglish()); - sb.append("\", \"needAlert\": \""); - sb.append(inferenceTranslates.get(i).isAlert()); - - if (i != inferenceTranslates.size() - 1) { - sb.append("\"},"); - } - else { - sb.append("\"}"); - } - } - sb.append("]"); - */ - if (!(left.isEmpty() && center.isEmpty() && right.isEmpty())) { return "[{\"koreanTTSString\":\"" + left.append(center).append(right) +