Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -78,7 +78,7 @@ def closest_basic_color(rgb):
|
|
| 78 |
return closest_color
|
| 79 |
|
| 80 |
def get_dominant_color(image, num_colors=5):
|
| 81 |
-
image = image.resize((
|
| 82 |
pixels = np.array(image).reshape(-1, 3)
|
| 83 |
kmeans = MiniBatchKMeans(n_clusters=num_colors, random_state=0, n_init=5)
|
| 84 |
kmeans.fit(pixels)
|
|
|
|
| 78 |
return closest_color
|
| 79 |
|
| 80 |
def get_dominant_color(image, num_colors=5):
|
| 81 |
+
image = image.resize((200, 200))
|
| 82 |
pixels = np.array(image).reshape(-1, 3)
|
| 83 |
kmeans = MiniBatchKMeans(n_clusters=num_colors, random_state=0, n_init=5)
|
| 84 |
kmeans.fit(pixels)
|