Skip to content

Commit 269500b

Browse files
authored
Merge pull request #1 from kHarshit/master
fix: Fix incorrect percentage of color shown in pie chart
2 parents 926c828 + fbc92b4 commit 269500b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Color Identification using Machine Learning.ipynb

+2
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@
269269
" labels = clf.fit_predict(modified_image)\n",
270270
" \n",
271271
" counts = Counter(labels)\n",
272+
" # sort to ensure correct color percentage\n",
273+
" counts = dict(sorted(counts.items()))\n",
272274
" \n",
273275
" center_colors = clf.cluster_centers_\n",
274276
" # We get ordered colors by iterating through the keys\n",

0 commit comments

Comments
 (0)