Skip to content

Color_clustering_alhorithm#592

Closed
SethPolydore wants to merge 30 commits intomainfrom
Add-Color-Clustering
Closed

Color_clustering_alhorithm#592
SethPolydore wants to merge 30 commits intomainfrom
Add-Color-Clustering

Conversation

@SethPolydore
Copy link
Contributor

contains the scripts for the functionsto automatically segment images by color. There are two scripts: color_cluster_train (in the learn subpackage) which trains the model that does the segmentation and color_cluster_segmentation which does the actual segmenting.

Purpose
Adds new functionalities.

contains the scripts for the functionsto automatically segment images by color.  There are two scripts: color_cluster_train (in the learn subpackage) which trains the model that does the segmentation and color_cluster_segmentation which does the actual segmenting.
@nfahlgren
Copy link
Member

Hi @SethPolydore, I suggest refactoring the line causing the error in the tests.py file to:

spmask = pcv.color_clustering_segmentation(img=img, project_name=os.path.join(TEST_DATA, "temp_testing_multi"))

os.path.join will use the appropriate OS-specific file path separators.

@nfahlgren nfahlgren added the new feature New feature ideas and solutions label Aug 16, 2020
@nfahlgren nfahlgren added this to the PlantCV v3.10.0 milestone Aug 16, 2020
@codecov
Copy link

codecov bot commented Sep 1, 2020

Codecov Report

Merging #592 (56c21cb) into master (260aa20) will decrease coverage by 0.35%.
The diff coverage is 92.20%.

Impacted file tree graph

@@             Coverage Diff             @@
##            master     #592      +/-   ##
===========================================
- Coverage   100.00%   99.64%   -0.36%     
===========================================
  Files          142      144       +2     
  Lines         6482     6790     +308     
===========================================
+ Hits          6482     6766     +284     
- Misses           0       24      +24     
Flag Coverage Δ
unittests 99.64% <92.20%> (-0.36%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
plantcv/plantcv/__init__.py 100.00% <ø> (ø)
plantcv/plantcv/color_clustering_segmentation.py 89.38% <89.38%> (ø)
plantcv/learn/color_clustering_train.py 93.78% <93.78%> (ø)
plantcv/learn/__init__.py 100.00% <100.00%> (ø)
plantcv/__init__.py 100.00% <0.00%> (ø)

@HaleySchuhl
Copy link
Contributor

Hmm I added another two tests to try to cover L53 in gmm.py and L47 in gmm_classifier.py but when I try to test them locally they get hung up on the case where remove is empty. I think I need to do more testing in Jupyter to see why it freezes up under these additional tests.

@nfahlgren nfahlgren added the work in progress Mark work in progress label Sep 4, 2020
@nfahlgren nfahlgren self-assigned this Oct 6, 2020
--------------Changes----------------
This is the update of the Color Clustering Train and the Color Clustering Segmentation functions.  The functions can now use both gmm and Mini-Batch-Kmeans to segment images into different groups based on color.  I changed the names of the function from "gmm" in the Learn subpackage and "gmm_segmentation" back to "Color_Clustering_Train" and "Color_Clustering_Segmentation."

Color_Clustering_train can now output sample pixel values for each binary mask.  Color_Clustering_Segmentation can now use inputs of sample pixels in order to get only certain binary masks.
In both functions, using removing "gray" pixels is no longer automatic.  It's also far faster than before.

Type of update:
New feature or feature enhancement
Fixed to remove unneeded python script.
Updated test and formatted scripts to PEP8 standards.
@HaleySchuhl
Copy link
Contributor

Archiving

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature New feature ideas and solutions work in progress Mark work in progress

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants