Skip to content

Fix sliding window bug , better visualization and migrate codebase for python 3 compatibility#11

Open
ashrinc wants to merge 1 commit into
Griffintaur:masterfrom
ashrinc:master
Open

Fix sliding window bug , better visualization and migrate codebase for python 3 compatibility#11
ashrinc wants to merge 1 commit into
Griffintaur:masterfrom
ashrinc:master

Conversation

@ashrinc

@ashrinc ashrinc commented Feb 18, 2026

Copy link
Copy Markdown

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.

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.

1 participant