Skip to content

Commit 1394900

Browse files
authored
get_yolo_box: fixed bug where best_score wasn't updated. tweak Station 2 navigation routine. (#847)
1 parent 6de4022 commit 1394900

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStoryTools.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,7 @@ ImageFloatBox get_yolo_box(
14521452
yolo_detector.detect(snapshot);
14531453

14541454
ImageFloatBox target_box{-1, -1, -1, -1};
1455-
double target_score = 0;
1455+
double best_score = 0;
14561456
for (YOLOv5Session::DetectionBox detected_box : detected_boxes){
14571457
ImageFloatBox box = detected_box.box;
14581458
std::string label = yolo_detector.session()->label_name(detected_box.label_idx);
@@ -1461,8 +1461,9 @@ ImageFloatBox get_yolo_box(
14611461
if (target_label == label){
14621462
overlays.add(COLOR_RED, box, label_score);
14631463

1464-
if (score > target_score){
1464+
if (score > best_score){
14651465
target_box = box;
1466+
best_score = score;
14661467
}
14671468
}else{
14681469
overlays.add(COLOR_BLUE, box, label);

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_36.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ void checkpoint_96(SingleSwitchProgramEnvironment& env, ProControllerContext& co
126126

127127
// move towards rock-2-1 until box: {0.007812, 0.363889, 0.203125, 0.300000}. center-y: 0.513889 center-x: 0.109375
128128
move_forward_until_yolo_object_above_min_size(env, context, yolo_detector, "rock-2-1",
129-
0.15, 0.300,
129+
0.15, 0.25,
130130
[&](){
131131
run_wild_battle_press_A(env.console, context, BattleStopCondition::STOP_OVERWORLD);
132132
move_player_to_realign_via_yolo(env, context, yolo_detector, "rock-2-1", 0.15); // realign to target X

0 commit comments

Comments
 (0)