Skip to content

Parameter adjustments - #30

Merged
AdenAthar merged 6 commits into
devfrom
parameter_adjustments
Sep 11, 2025
Merged

Parameter adjustments#30
AdenAthar merged 6 commits into
devfrom
parameter_adjustments

Conversation

@AdenAthar

@AdenAthar AdenAthar commented Sep 2, 2025

Copy link
Copy Markdown
Collaborator

Summary

  • Add configurable confidence threshold parameter to segmentation analysis
  • Allow users to control YOLO detection sensitivity by setting minimum confidence level
  • Default value set to 0.25 (YOLO's standard default)
  • Parameter is optional with range validation (0.0 to 1.0)

Changes

  • Added FloatValue confidence threshold parameter to Segmentation class
  • Integrated threshold into YOLO model prediction calls
  • Maintains backward compatibility with existing segmentation workflows

Benefits

  • Users can filter out low-confidence detections to reduce false positives
  • Improves segmentation quality for challenging images
  • Provides fine-grained control over detection sensitivity

Test Plan

  • Verify segmentation runs with default threshold (0.25)
  • Test with custom threshold values (0.1, 0.5, 0.8)
  • Confirm parameter validation enforces 0.0-1.0 range
  • Check that existing segmentation workflows remain unaffected

Bug #1: FileDirValue validates before creating directory
- Fixed by creating directory first, then validating
- Prevents crashes during segmentation initialization

Bug #2: FileNameValue circular validation logic
- Fixed by setting value first, allowing model names
- Prevents TypeError when using model names vs file paths

Test Results:
- Segmentation works without manual directory creation
- Model name resolution works correctly
- Integration test: 18 fruits detected successfully

Closes: segmentation analysis crashes on startup
See: BUGFIXES.md for detailed documentation
- Add configurable confidence_threshold parameter (FloatValue)
- Default value: 0.25 (YOLO standard)
- Range: 0.0 to 1.0
- CLI usage: --confidence_threshold 0.5
- Parameter passed to YOLO model prediction

Enables users to fine-tune detection sensitivity:
- Lower values: more detections (may include false positives)
- Higher values: fewer detections (only high-confidence ones)

Tested with apple tray demo image - parameter correctly applied
@AdenAthar
AdenAthar changed the base branch from main to dev September 2, 2025 22:29
"""
{@inheritdoc}
"""
self.value = value if self.validate() else None

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix this once PR #29 is merged

self.confidence_threshold.setMax(1.0)
self.confidence_threshold.setIsRequired(False)

self.addInParam(self.model, self.input_images, self.confidence_threshold)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just test with a high threhsold that you do see some segements falling out.

- Add input validation before assigning to self.value
- Validate that input is a string and not empty
- Only set self.value after successful directory creation and validation
- Addresses requirement to validate all values before they get set
@AdenAthar AdenAthar closed this Sep 11, 2025
@AdenAthar AdenAthar reopened this Sep 11, 2025
- Add parameter_adjustments.rst with detailed confidence threshold guide
- Include usage examples, recommended values, and practical scenarios
- Update index.rst to include new documentation page
- Provides users with clear guidance on optimizing detection quality
- Replace parameter_adjustments.rst with parameter_adjustments.md
- Use Markdown format for better readability and compatibility
- Contains comprehensive confidence threshold parameter documentation
- Provides users with clear guidance on optimizing detection quality
@AdenAthar
AdenAthar merged commit 95fb60f into dev Sep 11, 2025
@AdenAthar
AdenAthar deleted the parameter_adjustments branch September 11, 2025 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants