Fix sliding window bug , better visualization and migrate codebase for python 3 compatibility#11
Open
ashrinc wants to merge 1 commit into
Open
Fix sliding window bug , better visualization and migrate codebase for python 3 compatibility#11ashrinc wants to merge 1 commit into
ashrinc wants to merge 1 commit into
Conversation
…r Python 3 compatibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request addresses several issues that were affecting detection correctness and runtime behavior.
Sliding Window Fix
Fixed a bug in the SlidingWindow function where window slicing mistakenly used the x-coordinate for both axes:
Previously:
image[x:x + windowSize[1], x:x + windowSize[0]]
Updated to:
image[x:x + windowSize[1], y:y + windowSize[0]]
This correction ensures windows are extracted properly. The earlier behavior could generate invalid patches and lead to unreliable detections.
Python 3 Compatibility
Updated legacy Python 2 code to run correctly under Python 3:
Replaced xrange with range
Updated YAML loading to yaml.safe_load
Improved path handling for OS independence
Resolved runtime errors caused by deprecated constructs
These changes allow the project to execute cleanly in modern environments.
Visualization Improvement
Adjusted detection visualization to accumulate detections during scanning and draw bounding boxes once after processing completes. This avoids continuous per-window rendering and produces a stable final output showing all detections together.
No algorithmic changes were introduced beyond correcting window extraction and updating compatibility.
Thank you for maintaining this project.