-
Notifications
You must be signed in to change notification settings - Fork 2
Add GUI for YAML Configuration, Training, and Prediction in AOC Fruit Detector #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…I usage - Implemented a complete Tkinter-based GUI for training and prediction configuration. - Added modules: form renderer, YAML handler, prediction/training managers, tooltips, and constants. - GUI supports editing training/prediction YAML files, launching predictions (with or without ROS), and managing outputs. - Enhanced user experience with tooltips, field validation, and directory selectors. - Updated README.md to include GUI usage instructions, execution commands, and GUI screenshot. This commit fully integrates the GUI workflow into the repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a comprehensive graphical user interface (GUI) built with Tkinter to simplify configuration and execution of training and prediction tasks in the AOC Fruit Detector system, replacing the need for manual YAML file editing.
- Complete GUI implementation for editing YAML configuration files with tooltips and validation
- Integration of training and prediction execution workflows with real-time feedback
- Post-prediction statistics display and workflow management
Reviewed Changes
Copilot reviewed 12 out of 348 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
gui_predic_trainer/tooltip.py | Implements tooltip functionality for GUI help text |
gui_predic_trainer/main.py | Main application entry point and workflow orchestration |
gui_predic_trainer/gui_logic/yaml_handler.py | YAML file loading/saving with structure preservation |
gui_predic_trainer/gui_logic/training_manager.py | Training process execution management |
gui_predic_trainer/gui_logic/prediction_manager.py | Prediction execution and statistics parsing |
gui_predic_trainer/gui_logic/form_renderer.py | Dynamic GUI form generation and rendering |
gui_predic_trainer/constants.py | Field descriptions for tooltip system |
gui_predic_trainer/config_paths.py | Centralized configuration file paths |
config/training_parameters.yaml | New training configuration file |
config/ros_params.yaml | Updated ROS parameter default |
config/non_ros_params.yaml | Updated non-ROS parameter defaults |
README.md | Added GUI usage documentation |
print("STDERR:\n", e.stderr) | ||
|
||
from tkinter import messagebox | ||
messagebox.showerror("Error", "The prediction failed. Please verify that the image path is correct..") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message has a double period at the end ('correct..') which should be a single period.
messagebox.showerror("Error", "The prediction failed. Please verify that the image path is correct..") | |
messagebox.showerror("Error", "The prediction failed. Please verify that the image path is correct.") |
Copilot uses AI. Check for mistakes.
"datasets.validation_dataset_name", | ||
"files.config_file", | ||
"files.model_file", | ||
"files.config_file", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The field 'files.config_file' appears twice in the REQUIRED_FIELDS set (lines 31 and 33). This duplication should be removed.
"files.config_file", |
Copilot uses AI. Check for mistakes.
try: | ||
value = [v.strip().capitalize() == 'True' for v in value.strip('[]').split(',')] | ||
value = CommentedSeq(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The verbose field parsing logic uses a complex list comprehension with exception handling that could be simplified and made more readable with explicit validation.
try: | |
value = [v.strip().capitalize() == 'True' for v in value.strip('[]').split(',')] | |
value = CommentedSeq(value) | |
value = value.strip() | |
if not value.startswith('[') or not value.endswith(']'): | |
messagebox.showerror("Error", "Invalid value for 'verbose'. Expected a list like [True, False, ...]") | |
return | |
try: | |
bool_values = value[1:-1].split(',') | |
parsed_values = [] | |
for v in bool_values: | |
v = v.strip().capitalize() | |
if v not in ['True', 'False']: | |
raise ValueError("Invalid boolean value") | |
parsed_values.append(v == 'True') | |
value = CommentedSeq(parsed_values) |
Copilot uses AI. Check for mistakes.
x, y, _, _ = self.widget.bbox("insert") | ||
x = x + self.widget.winfo_rootx() + 25 | ||
y = y + self.widget.winfo_rooty() + 20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bbox("insert") call may raise a TclError if the widget doesn't support the insert index (e.g., for Label widgets). This should be wrapped in a try-except block.
x, y, _, _ = self.widget.bbox("insert") | |
x = x + self.widget.winfo_rootx() + 25 | |
y = y + self.widget.winfo_rooty() + 20 | |
try: | |
x, y, _, _ = self.widget.bbox("insert") | |
x = x + self.widget.winfo_rootx() + 25 | |
y = y + self.widget.winfo_rooty() + 20 | |
except tk.TclError: | |
x = self.widget.winfo_rootx() + 25 | |
y = self.widget.winfo_rooty() + 20 |
Copilot uses AI. Check for mistakes.
@Yael27V I updated this to the latest branch and also check the sensible automated review comments |
Summary
This Pull Request integrates a full graphical user interface (GUI) to simplify configuration and execution of training and prediction tasks in the AOC Fruit Detector system.
What's Included
ros_params.yaml
,non_ros_params.yaml
, andtraining_params.yaml
README.md
with GUI usage instructions and example imageHow to Launch GUI
From within the VSCode container: