Skip to content

Commit

Permalink
feat: 위쪽에서 인식된 이미지면 무시하도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
redcarrot1 committed Feb 14, 2024
1 parent f95caa6 commit 0cce464
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -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) {
}

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public String convertInference2(List<Inference> inferences) {
StringBuilder center = new StringBuilder();
StringBuilder right = new StringBuilder();

final double confidenceThreshold = 0.3;
final double confidenceThreshold = 0.5;
boolean isAlert = false;
Set<LabelAndDirection> labelAndDirections = new HashSet<>();

Expand All @@ -40,7 +40,19 @@ public String convertInference2(List<Inference> 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;
}

Expand Down Expand Up @@ -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) +
Expand Down

0 comments on commit 0cce464

Please sign in to comment.