From 6230840397ef49a601cba13e6d7c38208bae73f8 Mon Sep 17 00:00:00 2001 From: AdilZouitine Date: Tue, 22 Apr 2025 10:56:23 +0200 Subject: [PATCH] Fix linter issue part 2 --- examples/12_train_hilserl_classifier.md | 2 +- lerobot/scripts/server/crop_dataset_roi.py | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/12_train_hilserl_classifier.md b/examples/12_train_hilserl_classifier.md index da6932cca..34420f55f 100644 --- a/examples/12_train_hilserl_classifier.md +++ b/examples/12_train_hilserl_classifier.md @@ -42,7 +42,7 @@ Replace the `dataset_repo_id` field with the identifier for your dataset, which dataset_repo_id: "my_dataset_repo_id" ## Typical logs and metrics ``` -When you start the training process, you will first see your full configuration being printed in the terminal. You can check it to make sure that you config it correctly and your config is not overriden by other files. The final configuration will also be saved with the checkpoint. +When you start the training process, you will first see your full configuration being printed in the terminal. You can check it to make sure that you config it correctly and your config is not overridden by other files. The final configuration will also be saved with the checkpoint. After that, you will see training log like this one: diff --git a/lerobot/scripts/server/crop_dataset_roi.py b/lerobot/scripts/server/crop_dataset_roi.py index 72866017a..faca09b9f 100644 --- a/lerobot/scripts/server/crop_dataset_roi.py +++ b/lerobot/scripts/server/crop_dataset_roi.py @@ -33,23 +33,23 @@ def select_rect_roi(img): roi = None # Will store the final ROI as (top, left, height, width) drawing = False - ix, iy = -1, -1 # Initial click coordinates + index_x, index_y = -1, -1 # Initial click coordinates def mouse_callback(event, x, y, flags, param): - nonlocal ix, iy, drawing, roi, working_img + nonlocal index_x, index_y, drawing, roi, working_img if event == cv2.EVENT_LBUTTONDOWN: # Start drawing: record starting coordinates drawing = True - ix, iy = x, y + index_x, index_y = x, y elif event == cv2.EVENT_MOUSEMOVE: if drawing: # Compute the top-left and bottom-right corners regardless of drag direction - top = min(iy, y) - left = min(ix, x) - bottom = max(iy, y) - right = max(ix, x) + top = min(index_y, y) + left = min(index_x, x) + bottom = max(index_y, y) + right = max(index_x, x) # Show a temporary image with the current rectangle drawn temp = working_img.copy() cv2.rectangle(temp, (left, top), (right, bottom), (0, 255, 0), 2) @@ -58,10 +58,10 @@ def select_rect_roi(img): elif event == cv2.EVENT_LBUTTONUP: # Finish drawing drawing = False - top = min(iy, y) - left = min(ix, x) - bottom = max(iy, y) - right = max(ix, x) + top = min(index_y, y) + left = min(index_x, x) + bottom = max(index_y, y) + right = max(index_x, x) height = bottom - top width = right - left roi = (top, left, height, width) # (top, left, height, width)