-
Notifications
You must be signed in to change notification settings - Fork 117
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
fix: redundant writes to dataframe #1105 #1106
fix: redundant writes to dataframe #1105 #1106
Conversation
|
||
Gx, Gy = np.gradient(im_intensity) | ||
diffG = np.sqrt(Gx**2 + Gy**2) | ||
cannyG = canny(im_intensity) | ||
|
||
for i in range(numLabels): | ||
if rprops[i] is None: |
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.
@X-TRON404 I think you are missing this statement
This reverts commit cd842a0.
I've made an update to the section of the code where we initially create the features DataFrame and then modify it by accessing its elements repeatedly. In the improved version, I'm now constructing the features using a native Python data structure first, and then transferring these features to the DataFrame in a single operation. This change has resulted in a performance increase of up to ~75%. |
e86bcc5
into
DigitalSlideArchive:1105-remove-redundant-access-to-dataframe
* fix: redundant writes to dataframe * refac: removed double quotes * refac: removed unused variables * fix: acc to latest version of HistomicsTK * refac: removed unused import * fix: Area is float in ground truth * refac: relative import * fix: rm coordinates from rprops * fix: ignore rprops if None * fix: ignore rprops if None * linting compute_fsd_features.py * lint compute_gradient_features.py * lint compute_haralick_features.py * lint compute_morphometry_features.py * lint test_feature_extraction.py * lint: rm conditionals from compute_nuclei_features * Revert "lint: rm conditionals from compute_nuclei_features" This reverts commit cd842a0. * lint: trailing comma and newline * lint: colon spacing in compute_haralick_features.py * lint: colon spacing in compute_nuclei_features.py --------- Co-authored-by: X-TRON404 <[email protected]> Co-authored-by: Lee Cooper <[email protected]>
I have submitted a pull request to address issue #1105. This entails first establishing a data structure, making modifications to it, and then generating a dataframe—all in a single instance.