Skip to content

Optimize the Python script#24

Merged
mzur merged 5 commits intomainfrom
22-cant-handle-large-volumes
Feb 2, 2026
Merged

Optimize the Python script#24
mzur merged 5 commits intomainfrom
22-cant-handle-large-volumes

Conversation

@dbrembilla
Copy link
Contributor

@dbrembilla dbrembilla commented Jan 15, 2026

Resolves #22
(at least partially, only optimizes the python script)
On my (admittedly very small) test dataset, the time to process a Job halves from 1h 7m to about 30 m
Also improves the organisation of the script.

@dbrembilla dbrembilla self-assigned this Jan 15, 2026
@dbrembilla dbrembilla marked this pull request as ready for review January 22, 2026 10:54
@dbrembilla dbrembilla requested a review from mzur January 22, 2026 12:19
Copy link
Member

@mzur mzur left a comment

Choose a reason for hiding this comment

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

I only gave the script a cursory look and added some comments. Otherwise this is beyond me. I tested it locally and it seemed to perform fine.

1. Changes the hardcoded 512 to crop_size
2. Adds check from image size before cropping
3. Avoids recreating the Sam object
4. Sets the threshold to 0.05 for image size
@dbrembilla dbrembilla requested a review from mzur February 2, 2026 08:57
Copy link
Member

@mzur mzur left a comment

Choose a reason for hiding this comment

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

Now you set all sorts of magic numbers to 0.05 but I guess you know what you are doing 😉

@mzur mzur merged commit 13505bc into main Feb 2, 2026
@mzur mzur deleted the 22-cant-handle-large-volumes branch February 2, 2026 14:17
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.

Can't handle large volumes

2 participants